Template:Hefner: Difference between revisions
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
--[[ | |||
Infobox class | |||
-- args : parameters from frame to pass through | |||
-- Sets a meta table and creates a <div> tag wrapper | |||
-- other fields are initialised in other functions | |||
--]] | |||
function Infobox.new(args) | |||
local obj = setmetatable({ | |||
args = args, -- parameters (uncleaned) | |||
rargs = {}, -- parameters (cleaned) | |||
params = {}, -- parameters mapped to functions | |||
paramnames = {}, -- parameter names | |||
dupeable = {}, -- parameters that are allowed to have duplicated switch data | |||
addrswibclass = true, | |||
switchfo = false, -- switch infobox? or not? | |||
switchfoattr = {}, -- switch data class changes | |||
maxbuttons = DEFAULT_MAX_BUTTONS, -- maximum number of buttons before switching becomes a menu | |||
switch_tag = '', -- switchfo data | |||
switch_buttons_tag = '', -- switchfo buttons | |||
custom_buttons = false, | |||
smw_error_tag = '', | |||
rtable = nil, -- returned infobox table | |||
labels = nil, -- returned labels | |||
_smw = {}, -- semantic mediawiki data | |||
_smwOne = {}, -- semantic mediawiki data part 2 | |||
_smwSubobject = {}, -- semantic mediawiki data part 3 | |||
_smwSubobjectName = nil, -- semantic mediawiki data part 3.5 | |||
_smwElement = {}, -- semantic mediawiki data part 4 | |||
set_default_version_smw = false, -- whether to set [[Property:Default version]] | |||
setSMWElement = true, | |||
suppressAllSMW = false, | |||
suppressVersionSMW = {}, | |||
versions = -1, -- number of switch versions (-1 is uncalculated) | |||
infoboxname = nil, -- template name | |||
appendStrs = {}, | |||
bottomlinks = { -- template bottom links | |||
links = { | |||
{ 'Template talk:%s', 'talk' }, | |||
{ 'Template:%s', 'view' } | |||
}, | |||
colspan = 2 | |||
}, | |||
catdata = {}, -- meta category data | |||
catlist = {}, -- defined table of category names (strings) | |||
__finished = false, -- infobox status | |||
}, | |||
Infobox) | |||
return obj | |||
end |
Revision as of 22:38, 29 March 2024
--[[ Infobox class -- args : parameters from frame to pass through
-- Sets a meta table and creates a
-- other fields are initialised in other functions --]] function Infobox.new(args) local obj = setmetatable({ args = args, -- parameters (uncleaned) rargs = {}, -- parameters (cleaned) params = {}, -- parameters mapped to functions paramnames = {}, -- parameter names dupeable = {}, -- parameters that are allowed to have duplicated switch data addrswibclass = true, switchfo = false, -- switch infobox? or not? switchfoattr = {}, -- switch data class changes maxbuttons = DEFAULT_MAX_BUTTONS, -- maximum number of buttons before switching becomes a menu switch_tag = , -- switchfo data switch_buttons_tag = , -- switchfo buttons custom_buttons = false, smw_error_tag = , rtable = nil, -- returned infobox table labels = nil, -- returned labels _smw = {}, -- semantic mediawiki data _smwOne = {}, -- semantic mediawiki data part 2 _smwSubobject = {}, -- semantic mediawiki data part 3 _smwSubobjectName = nil, -- semantic mediawiki data part 3.5 _smwElement = {}, -- semantic mediawiki data part 4 set_default_version_smw = false, -- whether to set Property:Default version setSMWElement = true, suppressAllSMW = false, suppressVersionSMW = {}, versions = -1, -- number of switch versions (-1 is uncalculated) infoboxname = nil, -- template name appendStrs = {}, bottomlinks = { -- template bottom links links = { { 'Template talk:%s', 'talk' }, { 'Template:%s', 'view' } }, colspan = 2 }, catdata = {}, -- meta category data catlist = {}, -- defined table of category names (strings) __finished = false, -- infobox status }, Infobox) return obj end