Module:Protection banner: Difference between revisions
Content added Content deleted
Enwikipedia>Mr. Stradivarius (make some image tweaks and start a function for substituting blurb parameters) |
Enwikipedia>Mr. Stradivarius (some more work on the Blurb class) |
||
Line 164: | Line 164: | ||
local Blurb = class('Blurb') |
local Blurb = class('Blurb') |
||
function Blurb:initialize( |
function Blurb:initialize(configObj, protectionStatusObj, namespace) |
||
self. |
self._configObj = configObj |
||
self._protectionStatusObj = protectionStatusObj |
|||
self._bannerConfig = configObj:getBannerConfig(protectionStatusObj) |
|||
self._namespace = namespace |
|||
end |
end |
||
function Blurb: |
function Blurb:_makeIntroParameter() |
||
end |
|||
function Blurb:_makePagetypeParameter() |
|||
local pagetypes = self._configObj:getConfigTable('pagetypeNamespaces') |
|||
return pagetypes[self._namespace] or pagetypes.default or 'page' |
|||
end |
|||
function Blurb:_substituteParameters(msg) |
|||
if not self._params then |
if not self._params then |
||
local params, parameterFuncs = {}, {} |
local params, parameterFuncs = {}, {} |
||
Line 183: | Line 194: | ||
parameterFuncs[1] = function () |
parameterFuncs[1] = function () |
||
return self:_makeIntroParameter() |
|||
return 'This page is currently [[Help:Protection|protected]] from editing' |
|||
end |
end |
||
-- TODO: Write parameter functions |
-- TODO: Write parameter functions |
||
self._params = params |
self._params = params |