Přeskočit na obsah

Modul:Cedule

Z Wikicest

Dokumentaci tohoto modulu lze vytvořit na stránce Modul:Cedule/Dokumentace

-- @brief
--  Backend for {{Cedule}}.
-- 
-- @author
--  [[meta:User:Danny B.]]
local _module = {}
----------------------------------------


function _module.print( frame )
	
	local output = ""
	local parentFrame = frame:getParent()
	local templateArgs = {}
	
	
	for param, value in pairs( parentFrame.args ) do
		templateArgs[param] = mw.text.trim( value ) ~= "" and value or nil
	end
	
	output = output .. "<div class=\"label label-pageinfo"
	output = templateArgs["typ"] and output .. " label-pageinfo-type-" .. templateArgs["typ"] or output
	output = templateArgs["id"] and output .. " label-id-" .. templateArgs["id"] or output
	output = output .. " plainlinks\">\n"
	
	output = output .. "<div class=\"label_message\">\n"
	
	output = templateArgs["obrázek"] and output .. "<div class=\"label_image\">[[Soubor:" .. templateArgs["obrázek"] .. "|48x48px|alt=|link=]]</div>\n" or output
	
	if templateArgs["nadpis"] then
		output = output .. "<div class=\"label_message_headline"
		output = templateArgs["obrázek"] and output or output .. " label_message_headline-noimage"
		output = output .. "\">" .. templateArgs["nadpis"] .. "</div>\n"
	end
	
	output = output .. "<div class=\"label_message_text"
	output = templateArgs["obrázek"] and output or output .. " label_message_text-noimage"
	output = output .. "\">\n"
	output = output .. ( templateArgs["text"] or "" ) .. "\n"
	output = output .. "</div>\n"
	
	output = output .. "</div>\n"
	
	if templateArgs["poznámka"] then
		output = output .. "<hr />\n"
		output = output .. "<div class=\"label_note\">\n"
		output = output .. "<div class=\"label_image\">[[Soubor:Preferences-system.svg|16x16px|alt=|link=]]</div>\n"
		output = output .. "<div class=\"label_note_text\">\n"
		output = output .. templateArgs["poznámka"]
		output = output .. "</div>"
		output = output .. "</div>"
	end
	
	output = output .. "</div>"
	
	output = frame:preprocess( output )
	
	return output
	
end


----------------------------------------
return _module