לדלג לתוכן

יחידה:OCLC

מתוך המכלול, האנציקלופדיה היהודית

ניתן ליצור תיעוד על היחידה הזאת בדף יחידה:OCLC/תיעוד

local p= { }
function p.oclc(frame)
	local args = require('Module:Arguments').getArgs(frame)
	local short = args['מקוצר']
	local qid = args['qid']
	local oclc = args[1]
	local oclcUrl = ''
	if oclc==nil or oclc=='' then
		return ''
	else
		oclcUrl = 'http://www.worldcat.org/oclc/' .. oclc
	end
	
	if short then
		return mw.ustring.format('[%s %s]', oclcUrl, oclc)
	else
		local name = args[2]
		if name==nil or #name==0 then
			name = mw.title.getCurrentTitle().text
    		name = mw.ustring.gsub(name, " *[(].*[)]","")
    	end
		return mw.ustring.format('[%s %s], באתר [[Online Computer Library Center|OCLC]] %s', oclcUrl, name, frame:expandTemplate{ title = 'אנגלית' })
	end
end

return p