Module:Sandbox/BrandonXLF/4: Difference between revisions

Content deleted Content added
AC with every element
Fix errors
 
(29 intermediate revisions by the same user not shown)
Line 1:
-- Sandbox, do not delete
local ac = require('Module:Authority control')
local p = {}
 
local roadDataModule = require('Module:Road data/sandbox') -- REMOVE SANDBOX
function p.main()
 
local args = {}
function p.main_shieldmain(args)
local argsshields = {}
local routeCount = 1
while args[routeCount * 2 - 1] do
for i, v in ipairs(ac.conf) do
args[v[1]]local route = v[5]{
country = args['country' .. routeCount] or args.country,
state = args['state' .. routeCount] or args['province' .. routeCount] or args.state or args.province,
type = args[routeCount * 2 - 1],
route = args[routeCount * 2]
}
if not route.country then
local countryModule = mw.loadData('Module:Road data/countrymask')
route.country = countryModule[route.state] or 'UNK'
end
 
local shield = roadDataModule.shield(route, 'main', 'infobox', true)
table.insert(shields, shield)
 
routeCount = routeCount + 1
end
 
return table.concat(shields, ' ')
local parentFrame = mw.getCurrentFrame():newChild{title = 'Foo', args = args}
end
local frame = parentFrame:newChild{title = 'Template:Authority control', args = {}}
 
returnfunction acp.authorityControlshieldmain(frame)
local acargs = require('Module:Authority controlArguments').getArgs(frame)
return p._shieldmain(args)
end