Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Proposal support

From Tardis Wiki, the free Doctor Who reference
Revision as of 18:03, 3 January 2023 by Bongolium500 (talk | contribs)

Documentation for this module may be created at Module:Proposal support/doc

local p = {}

--from [[Module:SMW]]
dump = function(entity, indent, omitType)
    local entity = entity
    local indent = indent and indent or ''
    local omitType = omitType
    if type( entity ) == 'table' then
        local subtable
        if not omitType then
            subtable = '(table)[' .. #entity .. ']:'
        end
        indent = indent .. '\t'
        for k, v in pairs( entity ) do
            subtable = concat(subtable, '\n', indent, k, ': ', dump(v, indent, omitType))
        end
        return subtable
    elseif type( entity ) == 'nil' or type( entity ) == 'function' or type( entity ) == 'boolean' then
        return ( not omitType and '(' .. type(entity) .. ') ' or '' ) .. print(entity)
    elseif type( entity ) == 'string' then
        entity = mw.ustring.gsub(mw.ustring.gsub(entity, "\\'", "'"), "'", "\\'")
        return concat(omitType or '(string) ', '\'', entity, '\'')
    else
        -- number value expected
        return concat(omitType or '(' .. type( entity ) .. ') ', entity)
    end
end


function p.proposalSupport(frame)
	local args = frame:getParent().args
	return dump(args)
	--[[local supporters = #args
	local list = ""
	for i=1, #args do
		list = list .. "\n* " .. args[i]
	end
	local final = '<div data-sort-value="' .. supporters .. '">' .. list .. '\n</div>'
	return final]]--
end

return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.