Zeile 1: |
Zeile 1: |
| local p = {} --p stands for package | | local p = {} --p stands for package |
| + | local c = require( "Module:Common" ) |
| | | |
| 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 ) |
| | | |
| -- The tab "Daten" is visible everytime | | -- The tab "Daten" is visible everytime |
− | tpl_daten = p.Daten( frame, args ) | + | --tpl_daten = p.DatenOld( frame, args ) |
− | tab_daten='<tab name=Daten>' .. | + | --tab_daten='<tab name=Daten>' .. |
− | tpl_daten .. '</tab>' | + | --tpl_daten .. '</tab>' |
| | | |
− | t ='<div class=factbox><tabs>' .. | + | --t ='<div class=factbox><tabs>' .. |
− | tab_daten ..
| + | -- tab_daten .. |
− | '</tabs></div>'
| + | -- '</tabs></div>' |
− | | + | |
| -- Use preprocess to render the factbox and all contens at once | | -- Use preprocess to render the factbox and all contens at once |
| return frame:preprocess(t) | | return frame:preprocess(t) |
| end | | end |
| | | |
− | function p.Daten( frame, args ) | + | function p.Daten(frame, args) |
| + | title = mw.title.getCurrentTitle().text |
| + | t = '<table class="wikitable">'.. |
| + | '<th colspan="4">'..title..'</th>' |
| + | |
| + | t=t..'<tr>'.. |
| + | '<td>[[Attribut:KlassenBildHauptseite|Bild auf Hauptseite (48px)]]</td>' |
| + | if not isEmpty(args.KlassenBildHauptseite) then |
| + | t=t..'<td colspan="3">[[KlassenBildHauptseite::Datei:'..args.KlassenBildHauptseite..']]</td>' |
| + | end |
| + | |
| + | t=t..'</tr><tr>'.. |
| + | '<td>[[Attribut:KlassenBildKategorie|Bild in Kategorie (64px)]]</td>' |
| + | if not isEmpty(args.KlassenBildKategorie) then |
| + | t=t..'<td colspan="3">[[KlassenBildKategorie::Datei:'..args.KlassenBildKategorie..']]</td>' |
| + | end |
| + | |
| + | t=t..'</tr><tr>'.. |
| + | '<td>[[Attribut:KlassenVorlage|Vorlage]]</td>' |
| + | if not isEmpty(title) then |
| + | t=t..'<td colspan="3">[[KlassenVorlage::Vorlage:'..title..']]</td>' |
| + | end |
| + | |
| + | t=t..'</tr><tr>'.. |
| + | '<td>[[Attribut:KlassenModul|Modul]]</td>' |
| + | if not isEmpty(title) then |
| + | t=t..'<td colspan="3">[[KlassenModul::Modul:'..title..']]</td>' |
| + | end |
| + | |
| + | t=t..'</tr><tr>'.. |
| + | '<td>[[Attribut:KlassenKategorie|Kategorie]]</td>' |
| + | if not isEmpty(args.KlassenKategorie) then |
| + | t=t..'<td colspan="3">[[KlassenKategorie::Kategorie:'..args.KlassenKategorie..']]</td>' |
| + | end |
| + | |
| + | t=t..'</tr><tr>'.. |
| + | '<td>[[Attribut:KlassenFormular|Formular]]</td>' |
| + | if not isEmpty(title) then |
| + | t=t..'<td colspan="3">[[KlassenFormular::Formular:'..title..']]</td>' |
| + | end |
| + | |
| + | t=t..'</tr><tr>'.. |
| + | '<td>[[Attribut:Suchformular|Suchformular]]</td>' |
| + | if not isEmpty(args.KlassenKategorie) then |
| + | t=t..'<td colspan="2">[[Suchformular::Abfrage_'..args.KlassenKategorie..']]</td>'.. |
| + | '<td>[[Formular:Abfrage_'..args.KlassenKategorie..']]</td>' |
| + | end |
| + | |
| + | t=t..'</tr><tr>'.. |
| + | '<td>[[Attribut:Suchvorlage|Suchvorlage]]</td>' |
| + | if not isEmpty(args.KlassenKategorie) then |
| + | t=t..'<td colspan="2">[[Suchvorlage::Abfrage_'..args.KlassenKategorie..']]</td>'.. |
| + | '<td>[[Spezial:Abfrage_ausführen/Abfrage_'..args.KlassenKategorie..']]</td>' |
| + | 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 |
| + | |
| + | function p.DatenOld( frame, args ) |
| t = frame:expandTemplate{title = 'Klasse.Daten', args={ | | t = frame:expandTemplate{title = 'Klasse.Daten', args={ |
− | KlassenName=frame:preprocess('{{PAGENAME}}'), | + | KlassenName=mw.title.getCurrentTitle().text, |
| KlassenBildHauptseite=args.KlassenBildHauptseite, | | KlassenBildHauptseite=args.KlassenBildHauptseite, |
| KlassenBildKategorie=args.KlassenBildKategorie, | | KlassenBildKategorie=args.KlassenBildKategorie, |