Ugrás a tartalomhoz

Modul:FIE

A Wikipédiából, a szabad enciklopédiából

FIE[mi ez?] • [dokumentáció: mutat, szerkeszt] • [tesztek: létrehozás]

require('strict')

local p = {}

local getArgs = require('Modul:Arguments').getArgs

function p.link(frame, args)
	if not args then
		args = getArgs(frame, {wrappers = 'Sablon:FIE'})
	end
	-- This is a check to see if the optional first parameter contains ".html". If it does, remove it.
	local id = string.gsub(args[1] or args.id or '', '', '')
	if id == '' then
		local entity = mw.wikibase.getEntityObject()
		if entity and entity.claims and entity.claims.P2423 then
			id = entity.claims.P2423[1].mainsnak.datavalue.value
		end
	end
	if id == '' then
		return '[[Kategória:Hiányzó Wikidata-adattal rendelkező szócikkek]]'
	end
	return frame:expandTemplate{title = 'Cite web', args = {
		url = 'http://fie.org/fencers/fencer/' .. id,
		title = args[2] or args['név'] or require('Modul:String').simpletitle(),
		accessdate = args[3] or args.accessdate,
		work = 'fie.org',
		publisher = '[[Nemzetközi Vívószövetség]]',
		language = 'angol'
	}}
end

return p