Module:Protection banner: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(put Protection in charge of generating its own category links) |
(the only reason to ever use a title other than the current one is for testing, so don't bother exposing it to wikitext) |
||
Line 67: | Line 67: | ||
} |
} |
||
function Protection:initialize(args, cfg) |
function Protection:initialize(args, cfg, title) |
||
self._cfg = cfg |
self._cfg = cfg |
||
⚫ | |||
if args.title then |
|||
self.title = mw.title.new(args.title) |
|||
if not self.title then |
|||
error('Invalid title "' .. args.title .. '"', 2) |
|||
end |
|||
else |
|||
⚫ | |||
end |
|||
-- Set action |
-- Set action |
||
Line 884: | Line 877: | ||
end |
end |
||
function p._main(args, cfg) |
function p._main(args, cfg, title) |
||
if not cfg then |
if not cfg then |
||
cfg = mw.loadData('Module:Protection banner/config') |
cfg = mw.loadData('Module:Protection banner/config') |
||
Line 890: | Line 883: | ||
-- Initialise protection and blurb objects |
-- Initialise protection and blurb objects |
||
local protectionObj = Protection:new(args, cfg) |
local protectionObj = Protection:new(args, cfg, title) |
||
local blurbObj = Blurb:new(protectionObj, args, cfg) |
local blurbObj = Blurb:new(protectionObj, args, cfg) |
||