Modul:Protection banner: Unterschied zwischen den Versionen

rm unnecessary do/end blocks
(make the banner in charge of setting its own fields)
(rm unnecessary do/end blocks)
Zeile 72: Zeile 72:


-- Set action
-- Set action
do
if not args.action then
if not args.action then
self.action = 'edit'
self.action = 'edit'
elseif self.supportedActions[args.action] then
elseif self.supportedActions[args.action] then
self.action = args.action
self.action = args.action
else
else
error('Unsupported action ' .. args.action, 2)
error('Unsupported action ' .. args.action, 2)
end
end
end


-- Set level
-- Set level
do
self.level = effectiveProtectionLevel(self.action, self.title)
self.level = effectiveProtectionLevel(self.action, self.title)
if self.level == 'accountcreator' then
if self.level == 'accountcreator' then
-- Lump titleblacklisted pages in with template-protected pages,
-- Lump titleblacklisted pages in with template-protected pages,
-- since templateeditors can do both.
-- since templateeditors can do both.
self.level = 'templateeditor'
self.level = 'templateeditor'
elseif not self.level or (self.action == 'move' and self.level == 'autoconfirmed') then
elseif not self.level or (self.action == 'move' and self.level == 'autoconfirmed') then
-- Users need to be autoconfirmed to move pages anyway, so treat
-- Users need to be autoconfirmed to move pages anyway, so treat
-- semi-move-protected pages as unprotected.
-- semi-move-protected pages as unprotected.
self.level = '*'
self.level = '*'
end
end
end


Anonymer Benutzer