Module:Category handler: Difference between revisions

Content added Content deleted
(hmm, looks like the computer I was editing this on doesn't like the negation symbol)
(pass the demospace parameter to Module:Namespace detect)
Line 205: Line 205:
end
end
ndargs.page = args.page
ndargs.page = args.page
ndargs.demospace = args.demospace
local ndresult = nsDetect.main(ndargs)
local ndresult = nsDetect.main(ndargs)
if ndresult then
if ndresult then
Line 212: Line 213:
-- Namespace parameters exist; advanced usage.
-- Namespace parameters exist; advanced usage.
-- If the all parameter is specified, return it.
-- If the all parameter is specified, return it.
if args.all then
local all = args.all
ret = ret .. args.all
if type(all) == 'string' then
ret = ret .. all
end
end
Line 223: Line 225:
end
end
end
end
if args.other then
ndargs.other = args.other
ndargs.other = args.other
ndargs.page = args.page
end
ndargs.demospace = args.demospace
if args.page then
ndargs.page = args.page
end
local data = nsDetect.main(ndargs)
local data = nsDetect.main(ndargs)
Line 238: Line 237:
-- Remove non-positive integer values, as only positive integers
-- Remove non-positive integer values, as only positive integers
-- from 1-10 were used with the old template.
-- from 1-10 were used with the old template.
if datanum > 0
if datanum > 0 and math.floor(datanum) == datanum then
and math.floor(datanum) == datanum
local dataArg = args[datanum]
and args[datanum] then
if type(dataArg) == 'string' then
ret = ret .. args[datanum]
ret = ret .. dataArg
end
end
end
else
else