Modul:Faktenbox: Unterschied zwischen den Versionen

bessere Code-Lesbarkeit
(Vorlage:CommonTabs/Karte in kartenTab() integriert)
(bessere Code-Lesbarkeit)
Zeile 101: Zeile 101:
-- =p.bildTab{pargs={Bild="Erloeserkirche.jpg"}}
-- =p.bildTab{pargs={Bild="Erloeserkirche.jpg"}}
local t = ""
local t = ""
local beschreibung = que.getValues("Datei:" .. (fbdata.pargs.Bild or ""), "Beschreibung")
local beschreibung = que.getValues("Datei:" .. (fbdata.pargs["Bild"] or ""), "Beschreibung")
local beschreibung = beschreibung[1] or ""
local beschreibung = beschreibung[1] or ""
if not com.isEmpty(fbdata.pargs.Bild) and wik.pageexists("Bild:" .. fbdata.pargs.Bild) then
if not com.isEmpty(fbdata.pargs["Bild"]) and wik.pageexists("Bild:" .. fbdata.pargs["Bild"]) then
t = t .. '{| class = "factbox_imagetable" border = "0" cellpadding = "0" cellspacing = "0" width = "100%"\n'
t = t .. '{| class = "factbox_imagetable" border = "0" cellpadding = "0" cellspacing = "0" width = "100%"\n'
t = t .. '|-\n'
t = t .. '|-\n'
t = t .. '|[[Bild::Datei:' .. fbdata.pargs.Bild .. '|768px|link=' .. (seite or '') .. ']]\n'
t = t .. '|[[Bild::Datei:' .. fbdata.pargs["Bild"] .. '|768px|link=' .. (seite or '') .. ']]\n'
if beschreibung ~= "" then
if beschreibung ~= "" then
t = t .. '|-\n'
t = t .. '|-\n'
Zeile 130: Zeile 130:
else
else
local args = {
local args = {
lat = fbdata.pargs.lat, location = fbdata.pargs.location,
lat = fbdata.pargs["lat"], location = fbdata.pargs["location"],
lon = fbdata.pargs.lon, locationlist = fbdata.pargs.locationlist,
lon = fbdata.pargs["lon"], locationlist = fbdata.pargs["locationlist"],
geojson = fbdata.pargs.geojson, zoom = fbdata.pargs.zoom or "18", -- 18 ist default-zoom
geojson = fbdata.pargs["geojson"], zoom = fbdata.pargs["zoom"] or "18", -- 18 ist default-zoom
Debug = fbdata.pargs.Debug,
Debug = fbdata.pargs["Debug"],
width = "", height = "", -- passt sich beides automatisch an die Box an
width = "", height = "", -- passt sich beides automatisch an die Box an
box = "nein", form = "ja" -- keine eigene Box; Seite hat Formular
box = "nein", form = "ja" -- keine eigene Box; Seite hat Formular
Zeile 141: Zeile 141:
-- über Formular-Wert GeoJsonKarte eine Karte aktiviert ist
-- über Formular-Wert GeoJsonKarte eine Karte aktiviert ist
if com.isEmpty(args.geojson) then
if com.isEmpty(args.geojson) then
if wik.pageexists("GeoJson:" .. fbdata.pagename) or com.isTrue(fbdata.pargs.GeoJsonKarte) then
if wik.pageexists("GeoJson:" .. fbdata.pagename) or com.isTrue(fbdata.pargs["GeoJsonKarte"]) then
args.geojson = fbdata.pagename
args.geojson = fbdata.pagename
end
end
Zeile 290: Zeile 290:
-- =p.zeileAktenNr{pargs={AktenNr="D-5-63-000-1464"}}
-- =p.zeileAktenNr{pargs={AktenNr="D-5-63-000-1464"}}
local t = ""
local t = ""
local aktennr = str.splitAndStrip(fbdata.pargs.AktenNr or "", ";")
local aktennr = str.splitAndStrip(fbdata.pargs["AktenNr"] or "", ";")
if #aktennr > 0 then
if #aktennr > 0 then
t = t .. "<dt>" .. "[[Attribut:AktenNr|Akten-Nr.]]</dt><dd>"
t = t .. "<dt>" .. "[[Attribut:AktenNr|Akten-Nr.]]</dt><dd>"
Zeile 431: Zeile 431:
-- Kategorien
-- Kategorien
local ehemals_text = ""
local ehemals_text = ""
if com.isTrue(fbdata.pargs.Ehemals) then
if com.isTrue(fbdata.pargs["Ehemals"]) then
ehemals_text = " (ehemals)"
ehemals_text = " (ehemals)"
end
end
Zeile 439: Zeile 439:
end
end
end
end
if com.isTrue(fbdata.pargs.DenkmalstatusBesteht) then
if com.isTrue(fbdata.pargs["DenkmalstatusBesteht"]) then
t = t .. "[[Kategorie:Denkmalliste]]"
t = t .. "[[Kategorie:Denkmalliste]]"
end
end
local stadtteil = str.splitAndStrip(fbdata.pargs.Stadtteil or "", ";")
local stadtteil = str.splitAndStrip(fbdata.pargs["Stadtteil"] or "", ";")
for _, s in ipairs(stadtteil) do
for _, s in ipairs(stadtteil) do
s = str.strip(tostring(s or ""))
s = str.strip(tostring(s or ""))
Zeile 448: Zeile 448:
end
end
-- Wartungs-Kategorien
-- Wartungs-Kategorien
if com.isEmpty(fbdata.pargs.Bild) then
if com.isEmpty(fbdata.pargs["Bild"]) then
if fbdata.kategorie ~= nil then
if fbdata.kategorie ~= nil then
t = t .. "[[Kategorie:" .. fbdata.kategorie[1] .. " ohne Bild]]"
t = t .. "[[Kategorie:" .. fbdata.kategorie[1] .. " ohne Bild]]"
Zeile 454: Zeile 454:
t = t .. "[[Kategorie:Ohne Bild]]"
t = t .. "[[Kategorie:Ohne Bild]]"
end
end
elseif not wik.pageexists("Bild:" .. fbdata.pargs.Bild) then
elseif not wik.pageexists("Bild:" .. fbdata.pargs["Bild"]) then
t = t .. "[[Kategorie:Bild nicht gefunden]]"
t = t .. "[[Kategorie:Bild nicht gefunden]]"
end
end
Zeile 468: Zeile 468:
end
end
end
end
if fbdata.positionscheck and (fbdata.pargs.lat or "") == "" and (fbdata.pargs.lon or "") == "" and
if fbdata.positionscheck and (fbdata.pargs["lat"] or "") == "" and (fbdata.pargs["lon"] or "") == "" and
  (fbdata.pargs.location or "") == "" and not wik.pageexists("GeoJson:" .. (fbdata.pargs.geojson or fbdata.pagename)) and
  (fbdata.pargs["location"] or "") == "" and not wik.pageexists("GeoJson:" .. (fbdata.pargs["geojson"] or fbdata.pagename)) and
fbdata.kategorie ~= nil then
fbdata.kategorie ~= nil then
t = t .. "[[Kategorie:" .. fbdata.kategorie[1] .. ehemals_text .. " ohne Position]]"
t = t .. "[[Kategorie:" .. fbdata.kategorie[1] .. ehemals_text .. " ohne Position]]"