Changes

Jump to navigation Jump to search

Module:Authority control

138 bytes added, 17:43, 6 April 2013
no uid for Worldcat
end
function createRow( id, label, rawValue, link , withUid )
if link then
if withUid then return '* ' .. label .. ' <span class="uid">' .. link .. '</span>\n' else return '* ' .. label .. ' ' .. link .. '\n' end
else
return '* <span class="error">The ' .. id .. ' id ' .. rawValue .. ' is not valid.</span>[[Category:Wikipedia articles with faulty authority control identifiers (' .. id .. ')]]\n'
--Worldcat
if parentArgs['WORLDCATID'] and parentArgs['WORLDCATID'] ~= '' then
table.insert( elements, createRow( 'WORLDCATID', '', parentArgs['WORLDCATID'], '[http://www.worldcat.org/identities/' .. parentArgs['WORLDCATID'] .. ' WorldCat]' , false ) ) --Validation?
elseif parentArgs['LCCN'] and parentArgs['LCCN'] ~= '' then
local lccnParts = splitLccn( parentArgs['LCCN'] )
if lccnParts then
table.insert( elements, createRow( 'LCCN', '', parentArgs['LCCN'], '[http://www.worldcat.org/identities/lccn-' .. lccnParts[1] .. lccnParts[2] .. '-' .. lccnParts[3] .. ' WorldCat]' , false ) )
end
end
local val = parentArgs[params[1]]
if val and val ~= '' then
table.insert( elements, createRow( params[1], params[2] .. ':', val, params[4]( val ) , true ) )
end
end
Anonymous user

Navigation menu