變更
無編輯摘要
function p._main(frame, args)
function p._main(frame, args)
local modules = mTableTools.compressSparseArray(args)
local modules = mTableTools.compressSparseArray(args)
local box = p.renderBox(frame, modules)
local box = p.renderBox(modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
local trackingCategories = p.renderTrackingCategories(args, modules)
return box .. trackingCategories
return box .. trackingCategories
end
end
local modules = mTableTools.compressSparseArray(args)
local modules = mTableTools.compressSparseArray(args)
return p.renderBox(frame, modules)
return p.renderBox(modules)
end
end
--end
--end
function p.renderBox(frame, modules)
function p.renderBox(modules)
local boxArgs = {}
local boxArgs = {}
if #modules < 1 then
if #modules < 1 then
for i, module in ipairs(modules) do
for i, module in ipairs(modules) do
moduleLinks[i] = string.format('%s', module)
moduleLinks[i] = string.format('%s', module)
moduleLinks[i] = '[[:Module:' ..frame:callParserFunction{name = "PAGENAME", args = moduleLinks[i]} .. ']]'
moduleLinks[i] = '[[:Module:' .. mw.title.new(moduleLinks[i]).text .. ']]'
end
end
local moduleList = mList.makeList('bulleted', moduleLinks)
local moduleList = mList.makeList('bulleted', moduleLinks)
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
for i, module in ipairs(modules) do
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if mw.title.new(module).protectionLevels["edit"] then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = "使用受保护Lua模块的模板"
break
end
end
end
end
end