Content deleted Content added
Adding category for pages using CSS without protection template |
Fixing logic |
||
Line 82:
end
cats[#cats + 1] = category
if not yesno(args.noprotcat) then
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil▼
local addedLevelCat = false▼
end▼
▲ local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
for i, ts in ipairs(tStyles) do▼
▲ local addedLevelCat = false
local
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil▼
▲ for i, ts in ipairs(tStyles) do
if tsProt ~= currentProt and not addedLevelCat then▼
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"▼
▲ local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
▲ end
▲ if tsProt ~= currentProt and not addedLevelCat then
if tsProt and not addedPadlockCat then
▲ cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
local content = tsTitleObj:getContent()▼
end▼
if
cats[#cats + 1] = "Templates using TemplateStyles without padlocks"▼
▲ local content = tsTitleObj:getContent()
addedPadlockCat = true
▲ end
▲ cats[#cats + 1] = "Templates using TemplateStyles without padlocks"
▲ addedPadlockCat = true
end
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
|