Zum Inhalt springen

Modul:Wikidata utilities: Unterschied zwischen den Versionen

+getSitelinkTable
K (Änderte den Schutzstatus für „Modul:Wikidata utilities“ ([Bearbeiten=Nur Administratoren erlauben] (unbeschränkt) [Verschieben=Nur Administratoren erlauben] (unbeschränkt)))
(+getSitelinkTable)
Zeile 4: Zeile 4:
local WikidataUtilities = {
local WikidataUtilities = {
suite  = 'WikidataUtilities',
suite  = 'WikidataUtilities',
serial = '2020-10-11',
serial = '2020-11-21',
item  = 65439025
item  = 65439025
}
}
Zeile 87: Zeile 87:
return isSet( globalSiteId ) and entity:getSitelink( globalSiteId )
return isSet( globalSiteId ) and entity:getSitelink( globalSiteId )
or entity:getSitelink( globalSiteId )
or entity:getSitelink( globalSiteId )
end
end
function wu.getSitelinkTable( entity, globalSiteId )
if not isSet( entity ) then
return nil
elseif type( entity ) == 'string' then -- entity is id
entity = mw.wikibase.getEntity( entity )
end
if not globalSiteId then
globalSiteId = mw.getContentLanguage():getCode() .. mw.site.siteName:lower()
end
if entity and entity.sitelinks then
return entity.sitelinks[ globalSiteId ]
else
return nil
end
end
end
end
Anonymer Benutzer