Module:Protection banner: Difference between revisions

Jump to navigation Jump to search
make Blurb be responsible for setting its own fields
(condense _main and switch Blurb arg order)
(make Blurb be responsible for setting its own fields)
Line 339:
local Blurb = class('Blurb')
 
function Blurb:initialize(protectionObj, args, cfg)
self._cfg = cfg
self._protectionObj = protectionObj
self._bannerConfig = protectionObj.bannerConfig
self._title = protectionObj.title
self._deletionDiscussionPage = pageargs.xfd
self._username = usernameargs.user
self._section = args.section
end
 
Line 686 ⟶ 689:
 
-- Public methods --
 
function Blurb:setDeletionDiscussionPage(page)
self._deletionDiscussionPage = page
end
 
function Blurb:setUsername(username)
self._username = username
end
 
function Blurb:setSection(section)
self._section = section
end
 
function Blurb:makeReasonText()
Line 894 ⟶ 885:
-- Initialise protection and blurb objects
local protectionObj = Protection:new(args, cfg)
local blurbObj = Blurb:new(protectionObj, args, cfg)
blurbObj:setDeletionDiscussionPage(args.xfd)
blurbObj:setUsername(args.user)
blurbObj:setSection(args.section)
 
local ret = {}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu