Module:Protection banner: Difference between revisions
don't keep the whole export table around when we only need one thing from it
(fix method name) |
(don't keep the whole export table around when we only need one thing from it) |
||
Line 5: | Line 5: | ||
require('Module:No globals') | require('Module:No globals') | ||
local class = require('Module:Middleclass').class | local class = require('Module:Middleclass').class | ||
local | local newFileLink = require('Module:File link').new | ||
local | local effectiveProtectionLevel = require('Module:Effective protection level')._main | ||
local yesno = require('Module:Yesno') | local yesno = require('Module:Yesno') | ||
Line 105: | Line 105: | ||
-- Set level | -- Set level | ||
do | do | ||
local level = | local level = effectiveProtectionLevel(self._action, titleObj) | ||
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 635: | Line 635: | ||
or self._configObj:getMessage('image-filename-default') | or self._configObj:getMessage('image-filename-default') | ||
or 'Transparent.gif' | or 'Transparent.gif' | ||
return | return newFileLink(filename) | ||
:width(self._imageWidth or 20) | :width(self._imageWidth or 20) | ||
:alt(self._imageAlt) | :alt(self._imageAlt) |