617
edits
m (1 revision imported) |
m (1 revision imported) |
||
(One intermediate revision by one other user not shown) | |||
Line 72:
testcases = true
}
if not subpageBlacklist[titleObj.
local protCatName
if titleObj.namespace == 10 then
and not args.noprotcat▼
local category = args.category
local categories = {▼
▲ local categories = {
['Module:
['Module:
['Module:
}▼
▲ ['Module:Citation'] = 'Lua-based citation templates'
categories['Module:Citation/CS1'] = categories['Module:Citation']
▲ }
category =
end
cats[#cats + 1] = category▼
elseif titleObj.namespace == 828 then
protCatName = "Modules depending on under-protected modules"
end
▲ cats[#cats + 1] = category
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
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 module ~= "WP:libraryUtil" then
if moduleProt
if moduleProt < currentProt then
▲ cats[#cats + 1] = "Templates using under-protected Lua modules"
cats[#cats + 1] = protCatName
break
end
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
|