Changes
output the categories, and don't display the banner if the page is not protected
local Category = class('Category')
function Category:initialize(configObj, protectionStatusObj, titleObj)
self._configObj = configObj
self._protectionStatusObj = protectionStatusObj
end
local protectionStatusObj = self._protectionStatusObj
local titleObj = self._titleObj
-- Get the level and exit if the page is not protected.
local level = protectionStatusObj:getLevel()
if level == '*' then
return ''
end
-- Get the expiry.
local reason = protectionStatusObj:getReason()
local action = protectionStatusObj:getAction()
--[[
if cat then
Category.setName(self, cat)
return Category.exportrender(self)
else
error(
local cat = configObj:getMessage('tracking-category-expiry')
Category.setName(self, cat)
return Category.exportrender(self)
end
end
if level == '*' or type(expiry) == 'number' and expiry < os.time() then
Category.setName(self, configObj:getMessage('tracking-category-incorrect'))
return Category.exportrender(self)
end
end
-- Render the banner
-- Get the banner object
local isPadlock = yesno(args.small)
-- Render the categories
do
local objects = {
ProtectionCategory:new(configObj, protectionObj, titleObj),
ExpiryCategory:new(configObj, protectionObj),
ErrorCategory:new(configObj, protectionObj)
}
for _, obj in ipairs(objects) do
ret[#ret + 1] = obj:render()
end
end
return table.concat(ret)