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

Outputs a sidebar section for other project links. More...

Public Member Functions

 __construct ( $localSiteId, SiteLinksForDisplayLookup $siteLinksForDisplayLookup, SiteLookup $siteLookup, SidebarLinkBadgeDisplay $sidebarLinkBadgeDisplay, array $siteIdsToOutput)
 
 buildProjectLinkSidebarFromItemId (ItemId $itemId)
 
 buildProjectLinkSidebar (Title $title)
 

Private Member Functions

 buildPreliminarySidebarFromSiteLinks (array $siteLinks)
 
 sortAndFlattenSidebar (array $linksByGroup)
 The arrays of link attributes are indexed by site group and by global site id.
 
 buildSidebarLink (SiteLink $siteLink, Site $site)
 

Private Attributes

 $localSiteId
 
 $siteLinksForDisplayLookup
 
 $siteLookup
 
 $sidebarLinkBadgeDisplay
 
 $siteIdsToOutput
 

Detailed Description

Outputs a sidebar section for other project links.

Author
Thomas Pellissier Tanon
Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::__construct ( $localSiteId,
SiteLinksForDisplayLookup $siteLinksForDisplayLookup,
SiteLookup $siteLookup,
SidebarLinkBadgeDisplay $sidebarLinkBadgeDisplay,
array $siteIdsToOutput )
Parameters
string$localSiteId
SiteLinksForDisplayLookup$siteLinksForDisplayLookup
SiteLookup$siteLookup
SidebarLinkBadgeDisplay$sidebarLinkBadgeDisplay
string[]$siteIdsToOutput

Member Function Documentation

◆ buildPreliminarySidebarFromSiteLinks()

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::buildPreliminarySidebarFromSiteLinks ( array $siteLinks)
private
Parameters
SiteLink[]$siteLinks
Returns
array[] Arrays of link attributes indexed by site group and by global site id.

◆ buildProjectLinkSidebar()

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::buildProjectLinkSidebar ( Title $title)
Parameters
Title$title
Returns
array[] Array of arrays of attributes describing sidebar links, sorted by the site's group and global ids.

◆ buildProjectLinkSidebarFromItemId()

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::buildProjectLinkSidebarFromItemId ( ItemId $itemId)
Parameters
ItemId$itemId
Returns
array[] Array of arrays of attributes describing sidebar links, sorted by the site's group and global ids.

◆ buildSidebarLink()

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::buildSidebarLink ( SiteLink $siteLink,
Site $site )
private
Parameters
SiteLink$siteLink
Site$site
Returns
string[] Array of attributes describing a sidebar link.

◆ sortAndFlattenSidebar()

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::sortAndFlattenSidebar ( array $linksByGroup)
private

The arrays of link attributes are indexed by site group and by global site id.

Sort them by both and then return the flattened array.

Parameters
array[]$linksByGroup
Returns
array[] Array of arrays of attributes describing sidebar links, sorted by the site's group and global ids.

Member Data Documentation

◆ $localSiteId

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::$localSiteId
private

◆ $sidebarLinkBadgeDisplay

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::$sidebarLinkBadgeDisplay
private

◆ $siteIdsToOutput

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::$siteIdsToOutput
private

◆ $siteLinksForDisplayLookup

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::$siteLinksForDisplayLookup
private

◆ $siteLookup

Wikibase\Client\Hooks\OtherProjectsSidebarGenerator::$siteLookup
private

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