Modul:Uses TemplateStyles: Unterschied zwischen den Versionen

Make function of category match name -- if CSS pages used by more than one template catch on, this may need to be reverted and the category renamed
(fix)
(Make function of category match name -- if CSS pages used by more than one template catch on, this may need to be reverted and the category renamed)
Zeile 74: Zeile 74:
end
end
cats[#cats + 1] = category
cats[#cats + 1] = category
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
local currentProt = titleObj.protectionLevels["edit"] and titleObj.protectionLevels["edit"][1] or nil
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, ts in ipairs(tStyles) do
for i, ts in ipairs(tStyles) do
local tsTitleObj = mw.title.new(ts)
local tsTitleObj = mw.title.new(ts)
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
local tsProt = tsTitleObj.protectionLevels["edit"] and tsTitleObj.protectionLevels["edit"][1] or nil
if tsProt == nil then tsProt = 0 else tsProt = protLevels[tsProt] end
if tsProt ~= currentProt then
if tsProt < currentProt then
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
cats[#cats + 1] = "Templates using TemplateStyles with a different protection level"
break
break
Anonymer Benutzer