Открыть меню
Открыть персональное меню
Вы не представились системе
Your IP address will be publicly visible if you make any edits.

Модуль:Gallery

Материал из wiki.iccup.org
Message_documentation_title[view] [edit] [history] [purge]
message_transclude_desc
Semantic MediaWiki is not installed or configured properly.
Function list
L 5 — p.main
L 10 — p._main
{{#seo:

| type = website | description = Модуль:Gallery is a template page used on the iCCup Wiki. Templates are pages that are embedded (transcluded) into other pages to allow for the repetition of information. | site_name = iCCup Wiki | locale = ru }}

Module:Gallery is a module that implements the {{Gallery}} template. Please see the template page for usage instructions.


local getArgs = require('Module:Arguments').getArgs
local p = {}
local root

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end

function p._main(args)
	local filearg = ''
	local height = '120'
	local prependarg = '[[File:'
	local apprendarg = '|frameless|' .. 'x' .. height .. 'px]]'
	
	for key,value in pairs(args) do
			local content = args[key]
			-- Check if arg is a valid file name
			if content:match('.[^{}<>]+%.%w+') then
				content = prependarg .. content .. apprendarg
			end
	    	filearg = filearg .. content
	end
	
	root = mw.html.create('div')
	root
		:addClass('template-gallery citizen-overflow')
		:wikitext( filearg )
	
	return tostring(root)
end

return p