Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Hooks\LanguageLinkBadgeDisplay Class Reference

Provides access to the badges of the current page's sitelinks and adds some properties to the HTML output to display them. More...

Public Member Functions

 __construct (SidebarLinkBadgeDisplay $sidebarLinkBadgeDisplay)
 
 attachBadgesToOutput (array $langLinks, ParserOutput $parserOutput)
 Attaches info about link badges in the given OutputPage, for later retrieval and processing by applyBadges().
 
 applyBadges (array &$languageLink, Title $languageLinkTitle, OutputPage $outputPage)
 Applies the badges described in the wikibase_badges property of $output to the language link to $languageLinkTitle.
 

Protected Attributes

 $sidebarLinkBadgeDisplay
 

Detailed Description

Provides access to the badges of the current page's sitelinks and adds some properties to the HTML output to display them.

Author
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Hooks\LanguageLinkBadgeDisplay::__construct ( SidebarLinkBadgeDisplay $sidebarLinkBadgeDisplay)

Member Function Documentation

◆ applyBadges()

Wikibase\Client\Hooks\LanguageLinkBadgeDisplay::applyBadges ( array & $languageLink,
Title $languageLinkTitle,
OutputPage $outputPage )

Applies the badges described in the wikibase_badges property of $output to the language link to $languageLinkTitle.

The badge info for this linked is looked up in the wikibase_badges data using the key returned by $languageLinkTitle->getInterwiki().

This is generally called in the context of generating skin output.

Parameters
array&$languageLink
Title$languageLinkTitle
OutputPage$outputPageThe output page to take the wikibase_badges property from.

◆ attachBadgesToOutput()

Wikibase\Client\Hooks\LanguageLinkBadgeDisplay::attachBadgesToOutput ( array $langLinks,
ParserOutput $parserOutput )

Attaches info about link badges in the given OutputPage, for later retrieval and processing by applyBadges().

This is typically called in the context of parsing a wiki page.

Parameters
SiteLink[]$langLinksSite links indexed by local interwiki prefix.
ParserOutput$parserOutputThe output page to set the wikibase_badges property on.

Member Data Documentation

◆ $sidebarLinkBadgeDisplay

Wikibase\Client\Hooks\LanguageLinkBadgeDisplay::$sidebarLinkBadgeDisplay
protected

The documentation for this class was generated from the following file: