Jump to content

Module:Sandbox/SD0001/Tabbed window

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SD0001 (talk | contribs) at 07:24, 28 January 2025 (WIP not working yet). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local Arguments = require('Module:Arguments')

local p = {}

p.main = function(frame)
	return p._main(Arguments.getArgs(frame))
end

p._main = function(args)
	local tabsTable = {}
	for param, value in ipairs(args) do
		if string.match(param, "^tab%d+") ~= nil then
			local num = tonumber(string.match(param, '%d+'))
			if num ~= nil and args['content'..num] ~= nil then
				tabsTable[value] = args['content'..num]
			end
		end
	end
	return tabsTable
end

return p