Zum Inhalt springen

Modul:Protection banner: Unterschied zwischen den Versionen

some more work on the Blurb class
(make some image tweaks and start a function for substituting blurb parameters)
(some more work on the Blurb class)
Zeile 164: Zeile 164:
local Blurb = class('Blurb')
local Blurb = class('Blurb')


function Blurb:initialize(bannerConfig)
function Blurb:initialize(configObj, protectionStatusObj, namespace)
self._config = bannerConfig
self._configObj = configObj
self._protectionStatusObj = protectionStatusObj
self._bannerConfig = configObj:getBannerConfig(protectionStatusObj)
self._namespace = namespace
end
end


function Blurb:_substituteParameters(msg, configObj)
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 = {}, {}
Zeile 183: Zeile 194:
parameterFuncs[1] = function ()
parameterFuncs[1] = function ()
return 'This page is currently [[Help:Protection|protected]] from editing'
return self:_makeIntroParameter()
end
end
-- TODO: Write parameter functions
-- TODO: Write parameter functions
self._params = params
self._params = params
Anonymer Benutzer