Module:UprisingPageFooter

--   ')	end	local genLinkList = function(tbl)		tableinsert(out, '  ')		local links = {}		for i,v in ipairs(tbl) do			tableinsert(links,  .. v.text) or ) .. '')		end		tableinsert(out, tableconcat(links, ' &middot; '))		tableinsert(out, '   ')	end	local genLinkGrid = function(tbl)		tableinsert(out, '    ')	end	if options.iconList then		genIconList(options.iconList)	elseif options.linkList then		genLinkList(options.linkList)	elseif options.linkGrid then		genLinkGrid(options.linkGrid)	end	tableinsert(out, ' ')	return tableconcat(out) end

function p.genFooter(frame) local currentTitle = mw.title.getCurrentTitle local _titleParts = titleParts local parts = _titleParts.getTitleParts(currentTitle.nsText .. ':' .. currentTitle.text) local maxShowState = 0 local showStateTotal = 0 local defaultOptions = { collapsible = true, collapsed = false }	local isCollapsed = false local subGroupCount = 0 local _genSubGroupRow = function(opts) subGroupCount = subGroupCount + 1 local even = ((subGroupCount % 2 == 0) and true or false) local isShown = (opts._showState > 0 and ((opts._showState == GROUP_ALWAYS_SHOW or (opts._showState == GROUP_SHOW_IF_NO_EXACT and maxShowState == GROUP_SHOW_IF_NO_EXACT) or (showStateTotal == opts._showState)) and true) or false) local newGroup = p.genNavboxSubGroup(frame, _extend(opts, defaultOptions, { subGroup = true, isEven = even, collapsed = (not isShown) }))		return tableconcat({			rowSpacer,			' ',				'',					' ',					newGroup,				' ',				' ',			' '		}) end local function genGroups local groupsOut = {} for i,v in ipairs(footerData.groups) do			tableinsert(groupsOut, _genSubGroupRow(v)) end return tableconcat(groupsOut) end for i,v in ipairs(footerData.groups) do		if v.show then v._showState = v.show(currentTitle, parts) showStateTotal = showStateTotal + v._showState if v._showState > maxShowState then v._showState = maxShowState end end end --footerData.groups local out = { ' ',			' ',					' ',				' ',			' ',		' '	}	return tableconcat(out) end

function p._main(frame, args, getValue, argNames) return p.genFooter(frame) end

function getParentFrame(frame) return frame:getParent end

function getParentFrame2(frame) return frame.getParent end

function Try_getParentFrame(frame) local success,result = pcall(getParentFrame, frame) if success == false or result == nil or result.args == nil then local success2,result2 = pcall(getParentFrame2, frame) if success2 == false or result2 == nil or result2.args == nil then return nil end return result2 end return result end

function _getArgs(frame, deep) local args = {} local argNames = {} local parentFrame = nil local parentFrame2 = nil

local processArgList = function(_args) for k,v in pairs(_args) do           local lKey = toLower(k) argNames[lKey] = k           if v ~= nil and txttrim(tostring(v)) ~= '' then local isNum = txttrim(tostring(v)):match('^(%d+)$') if isNum ~= nil then args[lKey] = tonumber(isNum) elseif type(v) == 'string' then args[lKey] = txttrim(v) else args[lKey] = v               end end end end if frame then if frame.args ~= nil then processArgList(frame.args) end parentFrame = Try_getParentFrame(frame) if parentFrame == nil and frame.args == nil then processArgList(frame) end end if parentFrame and parentFrame.args ~= nil then processArgList(parentFrame.args) if deep then parentFrame2 = Try_getParentFrame(parentFrame) -- Allow page to be called by another page/template with own request if parentFrame2 and parentFrame2.args and parentFrame2.args.get ~= nil and type(parentFrame2.args.get) == 'string' then processArgList(parentFrame2.args) end end end

--if frame == mw.getCurrentFrame then local getValue = function(name, useDefault) local key = toLower(name) if not args[key] then if type(useDefault) == 'string' or type(useDefault) == 'number' then return useDefault elseif not useDefault then return nil else return defaults[key] end end return args[key] end local setValue = function(name, val) local key = toLower(name) if key ~= nil then args[key] = val if argNames[key] == nil and argNames[name] == nil then argNames[key] = name end end return val end return getValue, setValue, args, argNames --return p._main(frame, args, getValue, argNames) end

function p.main(frame) local getValue, setValue, args, argNames = _getArgs(frame, true) return p._main(frame, args, getValue, argNames) end

function p._debug local result = p.main({args = {}}) mw.log(result) return result end

return p -- --