Anonymous user
Module:Protection banner: Difference between revisions
allow reading wrapper templates and default arguments from the config page
Enwikipedia>Mr. Stradivarius (use pipes as separators instead of hyphens for the protection category keys and validate reasons when we create the protection object to make sure they don't contain pipes) |
Enwikipedia>Mr. Stradivarius (allow reading wrapper templates and default arguments from the config page) |
||
Line 783:
function p._main(args, cfg, title)
args = args or {}
▲ cfg = require('Module:Protection banner/config')
-- Initialise the protection object and check for errors
Line 826 ⟶ 824:
end
function p.main(frame, cfg)
getArgs = getArgs or require('Module:Arguments').getArgs
local defaultArgs = cfg.wrappers[frame:getParent():getTitle()]
local args = getArgs(frame, {parentOnly = defaultArgs and true})
for k, v in pairs(defaultArgs or {}) do
args[k] = v
end
end
|