Module:Catégorisation badges/Détection

From ChaldeanWiki
< Module:Catégorisation badges
Revision as of 06:18, 9 May 2015 by Ian (Talk | contribs) (1 revision imported)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Documentation for this module may be created at Module:Catégorisation badges/Détection/doc

local p = { }

function p.hasAnyBadge( frame )
        local entity = mw.wikibase.getEntityObject()
        if not entity then
                return ''
        end
        for siteid, linkTable in pairs( entity.sitelinks ) do
                if next(entity.sitelinks[ siteid ].badges) ~= nil then
                        return '1'
                end
        end
        return ''
end

return p