Ugrás a tartalomhoz

Modul:FFR

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

FFR[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:FFR'})
	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.P7092 then
			id = entity.claims.P7092[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://www.rusfencing.ru/sportsmen_card.php?ID=' .. id,
		title = args[2] or args['név'] or require('Modul:String').simpletitle(),
		accessdate = args[3] or args.accessdate,
		work = 'rusfencing.ru',
		publisher = '[[Orosz Vívószövetség]]',
		language = 'orosz'
	}}
end

return p