Anonymous user
Module:Lua banner: Difference between revisions
Putting that logic in the correct place
m (1 revision imported) |
(Putting that logic in the correct place) |
||
Line 74:
if titleObj.namespace == 10
and not subpageBlacklist[titleObj.subpageText]
and not args.noprotcat▼
then
local category = args.category
Line 89 ⟶ 88:
end
cats[#cats + 1] = category
sysop = 4
}
local currentProt
if titleObj.id ~= 0 then
-- id is 0 (page does not exist) if am previewing before creating a template.
currentProt = titleObj.protectionLevels["edit"][1]
end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
if moduleProt
if moduleProt < currentProt then
cats[#cats + 1] = "Templates using under-protected Lua modules"
break
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
|