Module:Protection banner: Difference between revisions

en>Mr. Stradivarius
(add notes about when to add error/tracking categories)
en>Jackmcbarn
m (reflect changes to Module:Effective protection level)
Line 126: Line 126:
['move-sysop-template-all-all']          = 'Wikipedia move-protected templates',
['move-sysop-template-all-all']          = 'Wikipedia move-protected templates',
['move-sysop-user-all-all']              = 'Wikipedia move-protected user and user talk pages',
['move-sysop-user-all-all']              = 'Wikipedia move-protected user and user talk pages',
['pc-autoconfirmed-all-all-all']        = 'Wikipedia pending changes protected pages (level 1)',
['autoreview-autoconfirmed-all-all-all']        = 'Wikipedia pending changes protected pages (level 1)',
['pc-reviewer-all-all-all']              = 'Wikipedia pending changes protected pages (level 2)',
['autoreview-reviewer-all-all-all']              = 'Wikipedia pending changes protected pages (level 2)',
}
}


Line 166: Line 166:
-- Initialise necessary modules.
-- Initialise necessary modules.
local mArguments = require('Module:Arguments')
local mArguments = require('Module:Arguments')
local mProtectionLevel = require('Module:Effective protection level')
local mProtectionLevel = require('Module:Effective protection level')._main
local mMessageBox -- only needs to be loaded if we are outputting a banner, so lazily initialise
local mMessageBox -- only needs to be loaded if we are outputting a banner, so lazily initialise


Line 207: Line 207:
create = true,
create = true,
edit = true,
edit = true,
move = true
move = true,
autoreview = true
}
}
setmetatable(protectionData, {
setmetatable(protectionData, {
Line 213: Line 214:
local level
local level
if actions[key] then
if actions[key] then
level = mProtectionLevel.main(key, title)
level = mProtectionLevel(key, title)
if level == 'accountcreator' then
if level == 'accountcreator' then
-- Lump titleblacklisted pages in with template-protected pages,
-- Lump titleblacklisted pages in with template-protected pages,
Line 219: Line 220:
level = 'templateeditor'
level = 'templateeditor'
end
end
elseif key == 'pc' then
level = mProtectionLevel.pending(title)
end
end
protectionData[key] = level
protectionData[key] = level