Modul:Uses TemplateStyles: Unterschied zwischen den Versionen

Fixing logic
(Adding category for pages using CSS without protection template)
(Fixing logic)
Zeile 82: Zeile 82:
end
end
cats[#cats + 1] = category
cats[#cats + 1] = category
if yesno(args.noprotcat) then
if not yesno(args.noprotcat) then
return ""
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
end
local addedLevelCat = false
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local addedPadlockCat = false
local addedLevelCat = false
for i, ts in ipairs(tStyles) do
local addedPadlockCat = false
local tsTitleObj = mw.title.new(ts)
for i, ts in ipairs(tStyles) do
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
local tsTitleObj = mw.title.new(ts)
if tsProt ~= currentProt and not addedLevelCat then
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
if tsProt ~= currentProt and not addedLevelCat then
end
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
if tsProt and not addedPadlockCat then
end
local content = tsTitleObj:getContent()
if tsProt and not addedPadlockCat then
if not content:find("{{pp-") then
local content = tsTitleObj:getContent()
cats[#cats + 1] = "Templates using TemplateStyles without padlocks"
if not content:find("{{pp-") then
addedPadlockCat = true
cats[#cats + 1] = "Templates using TemplateStyles without padlocks"
end
addedPadlockCat = true
end
end
end
end
end
end
end
end
for i, cat in ipairs(cats) do
for i, cat in ipairs(cats) do
cats[i] = string.format('[[Category:%s]]', cat)
cats[i] = string.format('[[Category:%s]]', cat)
Anonymer Benutzer