Anonymous user
Module:Protection banner: Difference between revisions
allow passing the config object into the exportToLua and exportToWiki functions
Enwikipedia>Jackmcbarn (get a few other changes from the ec) |
Enwikipedia>Mr. Stradivarius (allow passing the config object into the exportToLua and exportToWiki functions) |
||
Line 10:
-- Lazily initialise modules and objects we don't always need.
local mArguments, mMessageBox, lang
--------------------------------------------------------------------------------
Line 933:
local ProtectionBanner = {}
function ProtectionBanner.exportToWiki(frame, configObj, titleObj)
mArguments = mArguments or require('Module:Arguments')
local args = mArguments.getArgs(frame)
return ProtectionBanner.exportToLua(args, configObj, titleObj)
end
function ProtectionBanner.exportToLua(args, configObj, titleObj)
titleObj = titleObj or mw.title.getCurrentTitle()
--
▲ config = mw.loadData('Module:Protection banner/config')
local protectionObj = Protection:new(args, configObj, titleObj)
local blurbObj = Blurb:new(configObj, protectionObj, titleObj)
blurbObj:setDeletionDiscussionPage(args.xfd)
|