Modul:category tree/templates
Erscheinungsbild
local export = {}
function export.exists(frame)
local args = frame.args
local template = args["template"]; if template == "" then template = nil end
local info = {}
info.code = args["code"]; if info.code == "" then info.code = nil end
info.label = args["label"]; if info.label == "" then info.label = nil end
info.sc = args["sc"]; if info.sc == "" then info.sc = nil end
local submodule = require("Module:category tree/" .. template)
local obj = submodule.new(info)
return (obj ~= nil and "1" or "")
end
function export.get_item(frame)
local args = frame.args
local template = args["template"]; if template == "" then template = nil end
local item = args[1]; if item == "" then item = nil end
local info = {}
info.code = args["code"]; if info.code == "" then info.code = nil end
info.label = args["label"]; if info.label == "" then info.label = nil end
info.sc = args["sc"]; if info.sc == "" then info.sc = nil end
local submodule = require("Module:category tree/" .. template)
local obj = submodule.new(info)
if item:find("^umbrella_") then
item = item:gsub("^umbrella_", "")
obj = obj:getUmbrella()
end
if obj and obj[item] then
ret = obj[item](obj)
else
error("The requested data item \"" .. item .. "\" is not recognized.")
end
if not ret then
return ""
else
return ret
end
end
return export