Anonymous user
Module:Protection banner: Difference between revisions
make the protection object responsible for accessing the title object and the config inside the Blurb class
(remove another unnecessary local) |
(make the protection object responsible for accessing the title object and the config inside the Blurb class) |
||
Line 313:
self._cfg = cfg
self._protectionObj = protectionObj
self._deletionDiscussionPage = args.xfd
self._username = args.user
Line 396 ⟶ 394:
-- protection.
local action = self._protectionObj.action
local pagename = self.
if action == 'move' then
-- We need the move log link.
Line 438 ⟶ 436:
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self.
self.
section,
disputes
Line 491 ⟶ 489:
local action = self._protectionObj.action
local level = self._protectionObj.level
local namespace = self.
local isTalk = self.
-- @TODO: add semi-protection and pending changes blurbs
Line 554 ⟶ 552:
function Blurb:_makePagetypeParameter()
local pagetypes = self._cfg.pagetypes
local namespace = self.
return pagetypes[namespace] or pagetypes.default or error('no default pagetype defined')
end
Line 603 ⟶ 601:
function Blurb:_makeProtectionLogParameter()
local action = self._protectionObj.action
local pagename = self.
if action == 'autoreview' then
-- We need the pending changes log.
Line 635 ⟶ 633:
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self.
self.
section or 'top',
display
Line 654 ⟶ 652:
local mVandalM = require('Module:Vandal-m')
local username = self._username
username = username or self.
return mVandalM._main{username}
end
Line 661 ⟶ 659:
function Blurb:makeReasonText()
local msg = self.
if msg then
return self:_substituteParameters(msg)
Line 668 ⟶ 666:
function Blurb:makeExplanationText()
local msg = self.
return self:_substituteParameters(msg)
end
function Blurb:makeTooltipText()
local msg = self.
return self:_substituteParameters(msg)
end
function Blurb:makeAltText()
local msg = self.
return self:_substituteParameters(msg)
end
function Blurb:makeLinkText()
local msg = self.
return self:_substituteParameters(msg)
end
|