Open main menu

Changes

Module:Authority control

105 bytes added, 07:26, 6 April 2013
m
no edit summary
function getCatForIdaddCatForId( frame, id )
local title = mw.title.getCurrentTitle()
local namespace = title.namespace
if namespace == 0 then
return frame:preprocess( '[[Category:Wikipedia articles with ' .. id .. ' identifiers]]')
elseif namespace == 2 and not title.isSubpage then
return frame:preprocess( '[[Category:User pages with ' .. id .. ' identifiers]]')
else
return frame:preprocess( '[[Category:Miscellaneous pages with ' .. id .. ' identifiers]]')
end
end
local link = params[4]( val )
if link then
table.insert( elements, params[2] .. ': <span class="uid">' .. link .. '</span>' .. getCatForId) addCatForId( frame, params[1] ) )
else
table.insert( elements, '<span class="error">The ' .. params[1] .. ' id ' .. val .. ' is not valid.</span>' ) frame:preprocess( '[[Category:Wikipedia articles with faulty authority control identifiers (' .. params[1] .. ')]]' )
end
Anonymous user