Content deleted Content added
embed function |
mNo edit summary |
||
Line 820:
local initialise = function(args, raw_args, parent_args, inactive_status)
---------------------------
-- Initialise arguments ---
local project_name = args.PROJECT_NAME or 'WikiProject ' .. (args.PROJECT or 'PROJECT')▼
---------------------------
local banner_name = mw.title.new(args.BANNER_NAME or 'Template:WikiProject ' .. (args.PROJECT or 'PROJECT'))▼
local on_template_page = not demo and current_title.rootPageTitle==banner_name.rootPageTitle▼
▲
local unknown_parameters = ''▼
local demo = not yesno(args.category or true, true) or args.demo_page
if banner_name.exists and not demo then -- check for unknown parameters▼
local parameters = {}▼
for parameter in banner_name:getContent():gmatch('{{{([^|}]+)') do▼
table.insert(parameters, parameter)▼
end▼
end
▲ local check_for_unknown = require('Module:Check for unknown parameters')._check
▲ if unknowns and unknowns~='' then-- there are some unknown parameters
▲ parameters.preview = cfg.unknown_parameters.preview:format(wikilink(banner_name.fullText))
▲ local unknown_category = cfg.unknown_parameters.tracking:format(project_name)
▲ if not mw.title.new(unknown_category).exists then
▲ unknown_category = cfg.unknown_parameters.default
▲ parameters.unknown = unknown_category and '[[' .. unknown_category .. '|_VALUE_]]' or ''
▲ unknown_parameters = check_for_unknown(parameters, parent_args)
▲ end
if on_template_page then▼
local templatepage = require('Module:WikiProject banner/templatepage' .. (sandbox or '')).templatepage▼
return templatepage(args, raw_args, inactive_status)▼
else▼
return unknown_parameters▼
.. p._main(args, raw_args, demo or inactive_status, banner_name, inactive_status and true or false), nil -- nil to disregard subsequent returned values▼
end
▲
▲
end
|