Zeile 1: |
Zeile 1: |
| local p = {} | | local p = {} |
− | local c = require( "Module:Common" ) | + | --local c = require( "Module:Common" ) |
| + | local f = require( "Module:Datei" ) |
| | | |
| function p.Faktenbox( frame ) | | function p.Faktenbox( frame ) |
| pf = frame:getParent() | | pf = frame:getParent() |
| args = pf.args | | args = pf.args |
− | t = p.Daten( frame, args ) | + | t = f.Daten( frame, args ) |
| return frame:preprocess(t) | | return frame:preprocess(t) |
| end | | end |
− |
| |
− | function p.Daten( frame, args )
| |
− | t = '<table class="wikitable">'..
| |
− | '<th colspan="4">'..mw.title.getCurrentTitle().text..'</th>'
| |
− |
| |
− | if not isEmpty(args.Genre) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Genre|Genre]]</td>' ..
| |
− | '<td colspan="3">' ..
| |
− | frame:callParserFunction(
| |
− | '#arraymap', args.Genre, ';', 'x', '[[:Kategorie:x|x]] [[Kategorie:x]]') .. '</td>' ..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | -- Liste Freiattribute und Werte auf
| |
− | for i=1,6 do
| |
− | a='Attribut'..i
| |
− | w='Wert'..i
| |
− | if not isEmpty(args[a]) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:'..args[a]..'|'..args[a]..']]</td>'..
| |
− | '<td colspan="3">'..frame:callParserFunction(
| |
− | '#arraymap', args[w], ';', 'x', '[['..args[a]..'::x]]')..'</td>'
| |
− | frame:callParserFunktion(
| |
− | '#set', args[a], 'Kindergarten', args[w], a)
| |
− | t=t..'</tr>'
| |
− | end
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Urheber) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Urheber|Urheber]]</td>' ..
| |
− | '<td colspan="3">[[Urheber::' .. args.Urheber ..']]</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Quellangaben) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Quellangaben|Quellangaben]]</td>'..
| |
− | '<td colspan="3">[[Quellangaben::'..args.Quellangaben..']]</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Ort) then
| |
− | t = t .. '<tr>'..
| |
− | '<td>[[Attribut:Ort|Ort]]</td>'..
| |
− | '<td>'..frame:callParserFunction(
| |
− | '#arraymap', args.Ort, ';', 'x', '[[Ort::x]]') ..'</td>'..
| |
− | '<td><b>ausblenden:</b></td>'
| |
− | z = '<td>[[ZeigeNichtInOrt::Nein]]</td>'
| |
− | if not isEmpty(args.ZeigeNichtInOrt) then
| |
− | z = '<td>[[ZeigeNichtInOrt::'..args.ZeigeNichtInOrt..']]</td>'
| |
− | end
| |
− | t=t..z..'</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Strasse) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Strasse|Straße]]</td>'..
| |
− | '<td>'..frame:callParserFunction(
| |
− | '#arraymap', args.Strasse, ';', 'x', '[[Strasse::x]]')
| |
− | if not isEmpty(args.Hausnummer) then
| |
− | t=t..' '..args.Hausnummer
| |
− | end
| |
− | t=t..'</td>'..
| |
− | '<td><b>ausblenden:</b></td>'
| |
− | z = '<td>[[ZeigeNichtInStrasse::Nein]]</td>'
| |
− | if not isEmpty(args.ZeigeNichtInStrasse) then
| |
− | z = '<td>[[ZeigeNichtInStrasse::'..args.ZeigeNichtInStrasse..']]</td>'
| |
− | end
| |
− | t=t..z..'</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Erstellungsdatum) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Erstellungsdatum|Erstellungsdatum]]</td>'..
| |
− | '<td colspan="3">'..frame:expandTemplate{title='LinkFormDatum', args={
| |
− | args.Erstellungsdatum,
| |
− | 'Erstellungsdatum',
| |
− | 'Erstellungstag',
| |
− | 'Erstellungsjahr'}}..'</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.UeberDatum) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:UeberDatum|Über Datum]]</td>'..
| |
− | '<td colspan="3">'..frame:expandTemplate{title='LinkFormDatum', args={
| |
− | args.UeberDatum,
| |
− | 'UeberDatum',
| |
− | 'UeberTag',
| |
− | 'UeberJahr'}}..'</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Seitennummer) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Seitennummer|Seitennummer]]</td>'..
| |
− | '<td colspan="3">'..frame:callParserFunction(
| |
− | '#arraymap', args.Seitennummer, ';', 'x', '[[Seitennummer::x]]') ..'</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Signatur) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Signatur|Signatur]]</td>'..
| |
− | '<td colspan="3">[[Signatur::'..args.Signatur..']]</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Lizenz) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Lizenz|Lizenz]]</td>'..
| |
− | '<td colspan="3">[[Lizenz::'..args.Lizenz..']]</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | if not isEmpty(args.Beschreibung) then
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Attribut:Beschreibung|Beschreibung]]</td>'..
| |
− | '<td colspan="3">[[Beschreibung::'..args.Beschreibung..']]</td>'..
| |
− | '</tr>'
| |
− | end
| |
− |
| |
− | t=t..'<tr>'..
| |
− | '<td>[[Bild:IconSearch32px.png|16px|semantisches Browsen|link=Spezial:Durchsuchen/{{NAMESPACE}}:{{PAGENAME}}]]</td>'..
| |
− | '<td colspan="3">[[Spezial:Durchsuchen/{{NAMESPACE}}:{{PAGENAME}}|semantisches Browsen]]</td>'..
| |
− | '</tr>'
| |
− | t=t..'</table>'
| |
− | return t
| |
− | end
| |
| | | |
| return p | | return p |