17.658
Bearbeitungen
(+ fbdata.attr Attribute Handling) |
(Umstellung fbdata.attr und subobject, Sonstiges) |
||
| Zeile 7: | Zeile 7: | ||
local smw = require("Modul:SMW") | local smw = require("Modul:SMW") | ||
function p. | function p.preprocess_(fbdata) | ||
-- mw.log(" | -- mw.log("preprocess_(fbdata)") | ||
-- mw.logObject(fbdata, "fbdata") | -- mw.logObject(fbdata, "fbdata") | ||
-- Konsolenzeile zum Debuggen: | -- Konsolenzeile zum Debuggen: | ||
-- =p. | -- =p.preprocess_{frame=mw.getCurrentFrame();attr={list={}};formular="Gebäude/Work",klasse={"Gebäude","Kirche"},kategorie={"Gebäude","Kirchen"},strasse_hnr={suspekt=true},positionscheck=true,pargs={Bild="Angie Oeckl.JPG",Ehemals="Ja",DenkmalstatusBesteht="Ja",Stadtteil="Ronhof; Nordstadt ",location="bla"},pagename="Test/Test;Test"} | ||
local t = "" | local t = "" | ||
-- Klasse | -- Klasse | ||
| Zeile 34: | Zeile 34: | ||
t = t .. "[[Kategorie:Denkmalliste]]" | t = t .. "[[Kategorie:Denkmalliste]]" | ||
end | end | ||
local stadtteil = str.splitAndStrip(fbdata.pargs["Stadtteil"] | local stadtteil = str.splitAndStrip(fbdata.pargs["Stadtteil"], ";") | ||
for _, s in ipairs(stadtteil) do | for _, s in ipairs(stadtteil) do | ||
s = str.strip(tostring(s | s = str.strip(tostring(s)) | ||
t = t .. "[[Kategorie:" .. s .. "]]" | t = t .. "[[Kategorie:" .. s .. "]]" | ||
end | end | ||
| Zeile 43: | Zeile 43: | ||
t = t .. "[[Kategorie:Hat leere Faktenbox]]" | t = t .. "[[Kategorie:Hat leere Faktenbox]]" | ||
end | end | ||
if | if fbdata.pargs["Bild"] == nil 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 79: | Zeile 79: | ||
end | end | ||
function p. | function p.getFbdata_(frame) | ||
-- mw.log(" | -- mw.log("getFbdata_(frame)") | ||
-- mw.logObject(fbdata, "fbdata") | -- mw.logObject(fbdata, "fbdata") | ||
-- Konsolenzeile zum Debuggen: | -- Konsolenzeile zum Debuggen: | ||
-- =p.fbdata_{pargs={a=1}} | -- =p.fbdata_{pargs={a=1}} | ||
local fbdata = {} | local fbdata = {} | ||
fbdata.frame, fbdata.pargs = dev.GetFrameAndParentArgs(frame) | fbdata.frame, fbdata.pargs, fbdata.args = dev.GetFrameAndParentArgs(frame) | ||
fbdata.pargs = wik.getArgs(fbdata.pargs) -- copy and emptyness removement | |||
fbdata.args = wik.getArgs(fbdata.args) | |||
wik.setPagenames(fbdata) | wik.setPagenames(fbdata) | ||
fbdata.attr = {list = {}} | fbdata.attr = {list = {}} | ||