Changes
add template protection tracking category
function ProtectionStatus:getLevel()
return self._level
end
function ProtectionStatus:isProtected()
return self._level ~= '*'
end
-- Get the level and exit if the page is not protected.
return ''
end
local reason = protectionStatusObj:getReason()
local action = protectionStatusObj:getAction()
local level = protectionStatusObj:getLevel()
--[[
end
if cat then
end
return Category.render(self)
end
and not reasonsWithoutExpiryCheck[reason]
then
end
return Category.render(self)
end
local level = protectionStatusObj:getLevel()
if level == '*' not protectionStatusObj:isProtected() or type(expiry) == 'number' and expiry < os.time() then Category.self:setName(self, configObj:getMessage('tracking-category-incorrect')) end return Category.render(self)end ---------------------------------------------------------------------------------- TemplateCategory class-------------------------------------------------------------------------------- local TemplateCategory = Category:subclass('TemplateCategory') function TemplateCategory:initialize(configObj, protectionStatusObj, titleObj) Category.initialize(self, configObj, protectionStatusObj) self._titleObj = titleObjend function TemplateCategory:render() local configObj = self._configObj local protectionStatusObj = self._protectionStatusObj local titleObj = self._titleObj local action = protectionStatusObj:getAction() local level = protectionStatusObj:getLevel() local namespace = titleObj.namespace if level == 'templateeditor' and ( action == 'create' or not (namespace == 10 or namespace == 828) ) then self:setName(configObj:getMessage('tracking-category-template'))
end
return Category.render(self)
end
ProtectionCategory:new(configObj, protectionObj, titleObj),
ExpiryCategory:new(configObj, protectionObj),
ErrorCategory:new(configObj, protectionObj), TemplateCategory:new(configObj, protectionObj, titleObj)
}
for _, obj in ipairs(objects) do