Zuletzt bearbeitet vor 4 Monaten
von Xineohp1506

Mod

Version vom 2. Dezember 2024, 02:09 Uhr von Xineohp1506 (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „local getArgs = require('Module:Arguments').getArgs local helper = require('Module:LPON/Helper') local mod = {} function mod.render(frame) local args = getArgs(frame) local output = "" -- DISPLAYTITLE setzen if args["Titel"] then helper.setDisplayTitle({title = args["Titel"]}) end -- Semantische Eigenschaften setzen if args["Projekt"] then helper.setProperty({args = {["LPON:Projekt"] = args["Projekt"]}})…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Die Dokumentation für dieses Modul kann unter Modul:LPON/Mod/Doku erstellt werden

local getArgs = require('Module:Arguments').getArgs
local helper = require('Module:LPON/Helper')
local mod = {}

function mod.render(frame)
    local args = getArgs(frame)
    local output = ""

    -- DISPLAYTITLE setzen
    if args["Titel"] then
        helper.setDisplayTitle({title = args["Titel"]})
    end

    -- Semantische Eigenschaften setzen
    if args["Projekt"] then
        helper.setProperty({args = {["LPON:Projekt"] = args["Projekt"]}})
    end
    if args["Game"] then
        helper.setProperty({args = {["LPON:Game"] = args["Game"]}})
    end
    if args["Kategorie"] then
        helper.setProperty({args = {["LPON:Mod-Kategorie"] = args["Kategorie"]}})
    end

    -- Tabelle erstellen
    output = output .. '<table class="lpnon-mod-table">\n'

    -- Titel
    output = output .. '<tr><th>Mod-Name</th><td>' .. (args["Titel"] or "Unbekannt") .. '</td></tr>\n'

    -- Projekt
    if args["Projekt"] then
        output = output .. '<tr><th>Projekt</th><td>' .. args["Projekt"] .. '</td></tr>\n'
    end

    -- Spiel
    if args["Game"] then
        output = output .. '<tr><th>Spiel</th><td>' .. args["Game"] .. '</td></tr>\n'
    end

    -- Kategorie
    if args["Kategorie"] then
        output = output .. '<tr><th>Kategorie</th><td>' .. args["Kategorie"] .. '</td></tr>\n'
    end

    -- Version
    if args["Version"] then
        output = output .. '<tr><th>Version</th><td>' .. args["Version"] .. '</td></tr>\n'
    end

    -- Download
    if args["Download"] then
        local source = args["Quelle"] or "Unbekannt"
        output = output .. string.format('<tr><th>Download</th><td><a href="%s">%s</a></td></tr>\n', args["Download"], source)
    else
        output = output .. '<tr><th>Download</th><td>PRIVAT</td></tr>\n'
    end

    -- Beschreibung
    if args["Beschreibung"] then
        output = output .. '<tr><th>Beschreibung</th><td>' .. args["Beschreibung"] .. '</td></tr>\n'
    end

    output = output .. '</table>\n' -- Ende der Tabelle

    return output
end

return mod