Ugrás a tartalomhoz

Modul:EFC

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

EFC[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:EFC'})
	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.P4475 then
			id = entity.claims.P4475[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 = 'https://www.eurofencing.info/competitions/fencers/case:fencer/licence:' .. id,
		title = args[2] or args['név'] or require('Modul:String').simpletitle(),
		accessdate = args[3] or args.accessdate,
		work = 'eurofencing.info',
		publisher = '[[Európai Vívószövetség]]',
		language = 'angol'
	}}
end

return p