Module:Protection banner: Difference between revisions
start changing the protection category function after a restructure of the config
(allow the first positional parameter to be used for the reason) |
(start changing the protection category function after a restructure of the config) |
||
Line 757: | Line 757: | ||
--]] | --]] | ||
local properties = { | local properties = { | ||
expiry = {order = 1 | expiry = {order = 1, val = protectionStatusObj:getExpiry()}, | ||
namespace = {order = 2 | namespace = {order = 2, val = nskey}, | ||
reason = {order = 3 | reason = {order = 3, val = protectionStatusObj:getReason()}, | ||
level = {order = 4 | level = {order = 4, val = protectionStatusObj:getLevel()}, | ||
action = {order = 5 | action = {order = 5, val = protectionStatusObj:getAction()} | ||
} | } | ||
Line 856: | Line 856: | ||
for j, t in ipairs(attemptOrder) do | for j, t in ipairs(attemptOrder) do | ||
if j > noActive then | if j > noActive then | ||
key[t. | key[t.order] = 'all' | ||
else | else | ||
local quotient = i / 2 ^ (j - 1) | local quotient = i / 2 ^ (j - 1) | ||
quotient = math.ceil(quotient) | quotient = math.ceil(quotient) | ||
if quotient % 2 == 1 then | if quotient % 2 == 1 then | ||
key[t. | key[t.order] = t.val | ||
else | else | ||
key[t. | key[t.order] = 'all' | ||
end | end | ||
end | end | ||
Line 910: | Line 910: | ||
local level = protectionStatusObj:getLevel() | local level = protectionStatusObj:getLevel() | ||
if | if level == '*' | ||
or action == 'move' and level == 'autoconfirmed' | or action == 'move' and level == 'autoconfirmed' | ||
or type(expiry) == 'number' and expiry < os.time() | |||
then | then | ||
Category.setName(self, configObj:getMessage('tracking-category-incorrect')) | Category.setName(self, configObj:getMessage('tracking-category-incorrect')) |