Changes
allow passing the config object into the exportToLua and exportToWiki functions
-- Lazily initialise modules and objects we don't always need.
local mArguments, mMessageBox, lang, config
--------------------------------------------------------------------------------
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) configObj = configObj or mw.loadData('Module:Protection banner/config')
titleObj = titleObj or mw.title.getCurrentTitle()
-- Get data Initialise protection and blurb objects if not config then config = mw.loadData('Module:Protection banner/config') end local configObj = config
local protectionObj = Protection:new(args, configObj, titleObj)
local blurbObj = Blurb:new(configObj, protectionObj, titleObj)
blurbObj:setDeletionDiscussionPage(args.xfd)