跳转到内容

Module:DotmOld

来自维基导游
--[[
	@exports
		dotm( frame )
		otbp( frame )
		ftt( frame )
		_dotm( frame, string )
		__dotm( frame )
]]
 
local p = {}

function p.dotm(frame)
	return p._dotm(frame, 'dotm')
end

function p.otbp(frame)
	return p._dotm(frame, 'otbp')
end

function p.ftt(frame)
	return p._dotm(frame, 'ftt')
end

function p._dotm(frame, dtype)
	local ttext = mw.title.makeTitle( 'Template', dtype ):getContent()
	local ntext = mw.ustring.gsub( ttext, "<noinclude>.+</noinclude>", "" )
	--ntext = mw.ustring.gsub( ntext, "{{banner|", "{{#invoke:DotmOld|__dotm|dtype="..dtype.."|" )
	ntext = mw.ustring.gsub( ntext, "{{banner|", "{{#invoke:DotmOld|__dotm|" )
 
	return frame:preprocess( ntext )
end

function p.__dotm(frame)
	local args = frame.args or {}
	--local dtype = args['dtype'] or 'dotm'
	local title = args['title'] or '未定'
	local image = args['image'] or 'Big Banner Example.png'
	local quote = args['quote'] or '未定'
	
	return '[[File:'..image..'|left|200px|link='..title..']]'..quote
end

return p