Anonymous user
Module:Protection banner: Difference between revisions
add some more blurb parameter functions
Enwikipedia>Mr. Stradivarius (move the parameter functions to the top level of the blurb class and add a new one) |
Enwikipedia>Mr. Stradivarius (add some more blurb parameter functions) |
||
Line 47:
self._expiry = args.expiry or 'indef'
self._section = args.section
self._username = args.user
end
Line 67 ⟶ 69:
function ProtectionStatus:getSection()
return self._section
end
function ProtectionStatus:getProtectionDate()
end
function ProtectionStatus:getUsername()
return self._username
end
Line 167 ⟶ 177:
parameterFuncs[9] = function ()
return self:_makeDisputeLinkParameter()
end
Line 187 ⟶ 198:
parameterFuncs[14] = function ()
-- subject page
return self:_makeSubjectPageLinksParameter()
end
Line 259 ⟶ 272:
function Blurb:_makeProtectionDateParameter()
-- parameter $5
local protectionDate = self._protectionStatusObj:getProtectionDate()
▲ if self._protectionDate then
if protectionDate then
local lang = mw.language.getContentLanguage()
local success, date = pcall(
Line 265 ⟶ 279:
lang,
'j F Y',
protectionDate
▲ self._protectionDate
)
if success and date then
Line 271 ⟶ 285:
end
end
end
function Blurb:_makeVandalTemplateParameter()
local mVandalM = require('Module:Vandal-m')
local username = self._protectionStatusObj:getUsername()
username = username or self._titleObj.baseText
return mVandalM.luaMain{username}
end
|