Module:Protection banner: Difference between revisions
add expiry automatically for actions other than 'autoreview' using new {{PROTECTIONEXPIRY:action}} magic word implemented through Module:Effective protection expiry
m (Changed protection level of Module:Protection banner: High-risk Lua module: RFPP request ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
(add expiry automatically for actions other than 'autoreview' using new {{PROTECTIONEXPIRY:action}} magic word implemented through Module:Effective protection expiry) |
||
Line 6: | Line 6: | ||
local makeFileLink = require('Module:File link')._main | local makeFileLink = require('Module:File link')._main | ||
local effectiveProtectionLevel = require('Module:Effective protection level')._main | local effectiveProtectionLevel = require('Module:Effective protection level')._main | ||
local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main | |||
local yesno = require('Module:Yesno') | local yesno = require('Module:Yesno') | ||
Line 134: | Line 135: | ||
-- Set expiry | -- Set expiry | ||
if args.expiry then | local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title) | ||
if effectiveExpiry == 'infinity' then | |||
obj.expiry = 'indef' | |||
elseif effectiveExpiry ~= 'unknown' then | |||
obj.expiry = validateDate(effectiveExpiry, 'expiry date') | |||
elseif args.expiry then | |||
if cfg.indefStrings[args.expiry] then | if cfg.indefStrings[args.expiry] then | ||
obj.expiry = 'indef' | obj.expiry = 'indef' |