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 ) |
Zeile 13: |
Zeile 14: |
| '<th colspan="4">'..mw.title.getCurrentTitle().text..'</th>' | | '<th colspan="4">'..mw.title.getCurrentTitle().text..'</th>' |
| | | |
− | if not isEmpty(args.Genre) then | + | if not c.isEmpty(args.Genre) then |
| t=t..'<tr>'.. | | t=t..'<tr>'.. |
| '<td>[[Attribut:Genre|Genre]]</td>' .. | | '<td>[[Attribut:Genre|Genre]]</td>' .. |
Zeile 21: |
Zeile 22: |
| '</tr>' | | '</tr>' |
| end | | end |
− | if not isEmpty(args.Urheber) then | + | if not c.isEmpty(args.Urheber) then |
| t=t..'<tr>'.. | | t=t..'<tr>'.. |
| '<td>[[Attribut:Urheber|Urheber]]</td>' .. | | '<td>[[Attribut:Urheber|Urheber]]</td>' .. |
Zeile 27: |
Zeile 28: |
| '</tr>' | | '</tr>' |
| end | | end |
− | if not isEmpty(args.Quellangaben) then | + | if not c.isEmpty(args.Quellangaben) then |
| t=t..'<tr>'.. | | t=t..'<tr>'.. |
| '<td>[[Attribut:Quellangaben|Quellangaben]]</td>'.. | | '<td>[[Attribut:Quellangaben|Quellangaben]]</td>'.. |
Zeile 33: |
Zeile 34: |
| '</tr>' | | '</tr>' |
| end | | end |
− | if not isEmpty(args.Ort) then | + | if not c.isEmpty(args.Ort) then |
| t = t .. '<tr>'.. | | t = t .. '<tr>'.. |
| '<td>[[Attribut:Ort|Ort]]</td>'.. | | '<td>[[Attribut:Ort|Ort]]</td>'.. |
Zeile 40: |
Zeile 41: |
| '<td><b>ausblenden:</b></td>' | | '<td><b>ausblenden:</b></td>' |
| z = '<td></td>' | | z = '<td></td>' |
− | if not isEmpty(args.ZeigeNichtInOrt) then | + | if not c.isEmpty(args.ZeigeNichtInOrt) then |
| z = '<td>'..args.ZeigeNichtInOrt..'</td>' | | z = '<td>'..args.ZeigeNichtInOrt..'</td>' |
| end | | end |
| t=t..z..'</tr>' | | t=t..z..'</tr>' |
| end | | end |
− | if not isEmpty(args.Strasse) then | + | if not c.isEmpty(args.Strasse) then |
| t=t..'<tr>'.. | | t=t..'<tr>'.. |
| '<td>[[Attribut:Strasse|Straße]]</td>'.. | | '<td>[[Attribut:Strasse|Straße]]</td>'.. |
Zeile 52: |
Zeile 53: |
| '<td><b>ausblenden:</b></td>' | | '<td><b>ausblenden:</b></td>' |
| z = '<td></td>' | | z = '<td></td>' |
− | if not isEmpty(args.ZeigeNichtInStrasse) then | + | if not c.isEmpty(args.ZeigeNichtInStrasse) then |
| z = '<td>'..args.ZeigeNichtInStrasse..'</td>' | | z = '<td>'..args.ZeigeNichtInStrasse..'</td>' |
| end | | end |
Zeile 91: |
Zeile 92: |
| } | | } |
| return t | | return t |
− | end
| |
− |
| |
− | function isEmpty(a)
| |
− | return a == '' or a == nil
| |
| end | | end |
| | | |
| return p | | return p |