Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:Infobox/water slide/doc. Changes can be proposed in the talk page.
Function list
L 18 — methodtable.getInfobox
L 51 — methodtable.setFrame
L 57 — WaterSlide.new
L 71 — WaterSlide.main

require( 'strict' )

local WaterSlide = {}
local status = require( 'Module:Status' ).get_status
local common = require( 'Module:Infobox/common' )
local cargo = mw.ext.cargo

local metatable = {}
local methodtable = {}

metatable.__index = methodtable

local config = {
	placeholder_image = 'Amusement Park Placeholder.svg'
}

--- Creates the infobox
function methodtable.getInfobox( self )
	local infobox = require( 'Module:Infobox' ):new( {
		placeholderImage = config.placeholder_image
	} )

	infobox:renderImage( self.frameArgs[ 'image' ] )
	
	if (self.frameArgs[ 'image2' ] ~= nil) then
		infobox:renderImage( self.frameArgs[ 'image2' ] )
	end
	if (self.frameArgs[ 'image3' ] ~= nil) then
		infobox:renderImage( self.frameArgs[ 'image3' ] )
	end
	
	infobox:renderSection( {
		content = tostring(mw.html.create( 'div' ):wikitext(self.frameArgs[ 'caption' ]))
	} )
	local badge
	if (self.frameArgs[ 'country' ] ~= nil) then
		badge = '[[File:'.. self.frameArgs[ 'country' ] .. '.svg|link='.. self.frameArgs[ 'country' ] .. '|45px]]'
	end
	local name = self.frameArgs[ 'name' ] or 'unknown'
	infobox:renderHeader( {
		title = name,
		subtitle =  common.get_attraction_subheading(self.frameArgs[ 'park' ], self.frameArgs[ 'owner' ], self.frameArgs[ 'location' ], self.frameArgs[ 'state' ], self.frameArgs[ 'country' ]),
		badge = badge
	} )

	return infobox:renderInfobox( )
end

--- Set the frame and load args
--- @param frame table
function methodtable.setFrame( self, frame )
	self.currentFrame = frame
	self.frameArgs = require( 'Module:Arguments' ).getArgs( frame )
end

--- New Instance
function WaterSlide.new( self )
    local instance = {
        categories = {}
    }
    
    setmetatable( instance, metatable )

    return instance
end

--- "Main" entry point for templates that saves the API Data and outputs the infobox
---
--- @param frame table Invocation frame
--- @return string
function WaterSlide.main( frame )
	local instance = WaterSlide:new()
	instance:setFrame( frame )
	-- instance:setShortDescription()
	-- instance:setCategories()
	-- instance:setCargoData()
	local infobox = instance:getInfobox()

	return infobox .. table.concat( instance.categories )
end

return WaterSlide