Modul:Protection banner: Unterschied zwischen den Versionen
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) |
||
Zeile 757: | Zeile 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()} | ||
} | } | ||
Zeile 856: | Zeile 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 | ||
Zeile 910: | Zeile 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')) |