14,091
edits
m (1 revision) |
(Change) |
||
Line 67: | Line 67: | ||
-- other items down accordingly. | -- other items down accordingly. | ||
return table.insert(t, table.remove(t, pos)) | return table.insert(t, table.remove(t, pos)) | ||
end | end | ||
Line 863: | Line 846: | ||
function p._main(args, cfg, title) | function p._main(args, cfg, title) | ||
args = args or {} | args = args or {} | ||
cfg = cfg or require( | cfg = cfg or require('Module:Protection banner/config') | ||
-- Initialise the protection object and check for errors | -- Initialise the protection object and check for errors | ||
Line 886: | Line 869: | ||
) | ) | ||
end | end | ||
-- Initialise the blurb object | |||
local blurbObj = Blurb.new(protectionObj, args, cfg) | |||
local ret = {} | local ret = {} | ||
-- | -- Render the banner | ||
if protectionObj:isProtected() then | |||
if protectionObj | ret[#ret + 1] = tostring( | ||
(yesno(args.small) and Padlock or Banner) | |||
.new(protectionObj, blurbObj, cfg) | |||
) | |||
end | |||
-- Render the categories | -- Render the categories | ||
if yesno(args.category) ~= false then | if yesno(args.category) ~= false then | ||
Line 916: | Line 895: | ||
-- Find default args, if any. | -- Find default args, if any. | ||
local | local parentTitle = frame:getParent():getTitle() | ||
parentTitle = parentTitle:gsub('/sandbox$', '') | |||
local defaultArgs = cfg.wrappers[parentTitle] or {} | |||
-- Find user args, and use the parent frame if we are being called from a | -- Find user args, and use the parent frame if we are being called from a |