14,061
edits
m (1 revision) |
(Reverted to revision 31218 by Tito Dutta (talk): Test. (TW)) |
||
Line 4: | Line 4: | ||
-- Initialise necessary modules. | -- Initialise necessary modules. | ||
require('Module:No globals') | require('Module:No globals') | ||
local | local newFileLink = require('Module:File link').new | ||
local effectiveProtectionLevel = require('Module:Effective protection level')._main | local effectiveProtectionLevel = require('Module:Effective protection level')._main | ||
local yesno = require('Module:Yesno') | local yesno = require('Module:Yesno') | ||
Line 126: | Line 126: | ||
-- Set level | -- Set level | ||
obj.level = | obj.level = effectiveProtectionLevel(obj.action, obj.title) | ||
if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then | if obj.level == 'accountcreator' then | ||
-- Lump titleblacklisted pages in with template-protected pages, | |||
-- since templateeditors can do both. | |||
obj.level = 'templateeditor' | |||
elseif not obj.level or (obj.action == 'move' and obj.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. | ||
Line 768: | Line 772: | ||
or self._cfg.msg['image-filename-default'] | or self._cfg.msg['image-filename-default'] | ||
or 'Transparent.gif' | or 'Transparent.gif' | ||
return | return newFileLink(filename) | ||
:width(self._imageWidth or 20) | |||
:alt(self._imageAlt) | |||
alt | :link(self._imageLink) | ||
link | :caption(self._imageCaption) | ||
caption | :render() | ||
end | end | ||
Line 868: | Line 871: | ||
-- If a page's edit protection is equally or more restrictive than its protection from some other action, | -- If a page's edit protection is equally or more restrictive than its protection from some other action, | ||
-- then don't bother displaying anything for the other action (except categories). | -- then don't bother displaying anything for the other action (except categories). | ||
if protectionObj.action == 'edit' | if protectionObj.action == 'edit' or not walkHierarchy(cfg.hierarchy, protectionObj.level)[effectiveProtectionLevel('edit', protectionObj.title)] then | ||
-- Initialise the blurb object | -- Initialise the blurb object | ||
local blurbObj = Blurb.new(protectionObj, args, cfg) | local blurbObj = Blurb.new(protectionObj, args, cfg) |