Wikibase
MediaWiki Wikibase extension
Wikibase\View\SiteLinksView Class Reference

Creates views for lists of site links. More...

Public Member Functions

 __construct (TemplateFactory $templateFactory, SiteList $sites, EditSectionGenerator $sectionEditLinkGenerator, EntityIdFormatter $entityIdFormatter, LanguageNameLookup $languageNameLookup, NumberLocalizer $numberLocalizer, array $badgeItems, array $specialSiteLinkGroups, LocalizedTextProvider $textProvider)
 
 getHtml (array $siteLinks, ?ItemId $itemId, array $groups)
 Builds and returns the HTML representing a WikibaseEntity's site-links. More...
 

Private Member Functions

 getHtmlForSectionHeading ( $heading)
 Returns the HTML for the heading of the sitelinks section. More...
 
 getHtmlForSiteLinkGroup (array $siteLinks, ?ItemId $itemId, $group)
 Builds and returns the HTML representing a group of a WikibaseEntity's site-links. More...
 
 getSitesForGroup ( $group)
 Get all sites for a given site group, with special handling for the "special" site group. More...
 
 getHtmlForSiteLinks (array $siteLinksForTable, $isSpecialGroup)
 
 getHtmlForPage (SiteLink $siteLink, Site $site)
 
 getHtmlForUnknownSiteLink (SiteLink $siteLink)
 
 getHtmlForBadges (array $badges)
 

Private Attributes

 $entityIdFormatter
 
 $templateFactory
 
 $sites
 
 $sectionEditLinkGenerator
 
 $languageNameLookup
 
 $numberLocalizer
 
 $badgeItems
 
 $specialSiteLinkGroups
 
 $textProvider
 

Detailed Description

Creates views for lists of site links.

Author
Adrian Heine adria.nosp@m.n.he.nosp@m.ine@w.nosp@m.ikim.nosp@m.edia..nosp@m.de
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\View\SiteLinksView::__construct ( TemplateFactory  $templateFactory,
SiteList  $sites,
EditSectionGenerator  $sectionEditLinkGenerator,
EntityIdFormatter  $entityIdFormatter,
LanguageNameLookup  $languageNameLookup,
NumberLocalizer  $numberLocalizer,
array  $badgeItems,
array  $specialSiteLinkGroups,
LocalizedTextProvider  $textProvider 
)
Parameters
TemplateFactory$templateFactory
SiteList$sites
EditSectionGenerator$sectionEditLinkGenerator
EntityIdFormatter$entityIdFormatterA plaintext producing EntityIdFormatter
LanguageNameLookup$languageNameLookup
NumberLocalizer$numberLocalizer
string[]$badgeItems
string[]$specialSiteLinkGroups
LocalizedTextProvider$textProvider

Member Function Documentation

◆ getHtml()

Wikibase\View\SiteLinksView::getHtml ( array  $siteLinks,
?ItemId  $itemId,
array  $groups 
)

Builds and returns the HTML representing a WikibaseEntity's site-links.

Parameters
SiteLink[]$siteLinksthe site links to render
ItemId | null$itemIdThe id of the item or might be null, if a new item.
string[]$groupsAn array of site group IDs
Returns
string HTML

◆ getHtmlForBadges()

Wikibase\View\SiteLinksView::getHtmlForBadges ( array  $badges)
private
Parameters
ItemId[]$badges
Returns
string HTML

◆ getHtmlForPage()

Wikibase\View\SiteLinksView::getHtmlForPage ( SiteLink  $siteLink,
Site  $site 
)
private
Parameters
SiteLink$siteLink
Site$site
Returns
string HTML

◆ getHtmlForSectionHeading()

Wikibase\View\SiteLinksView::getHtmlForSectionHeading (   $heading)
private

Returns the HTML for the heading of the sitelinks section.

Parameters
string$headingmessage key of the heading; also used as css class
Returns
string HTML

◆ getHtmlForSiteLinkGroup()

Wikibase\View\SiteLinksView::getHtmlForSiteLinkGroup ( array  $siteLinks,
?ItemId  $itemId,
  $group 
)
private

Builds and returns the HTML representing a group of a WikibaseEntity's site-links.

Parameters
SiteLink[]$siteLinksthe site links to render
ItemId | null$itemIdThe id of the item
string$groupa site group ID
Returns
string HTML

◆ getHtmlForSiteLinks()

Wikibase\View\SiteLinksView::getHtmlForSiteLinks ( array  $siteLinksForTable,
  $isSpecialGroup 
)
private
Parameters
array[]$siteLinksForTable
bool$isSpecialGroup
Returns
string HTML

◆ getHtmlForUnknownSiteLink()

Wikibase\View\SiteLinksView::getHtmlForUnknownSiteLink ( SiteLink  $siteLink)
private
Parameters
SiteLink$siteLink
Returns
string HTML

◆ getSitesForGroup()

Wikibase\View\SiteLinksView::getSitesForGroup (   $group)
private

Get all sites for a given site group, with special handling for the "special" site group.

Parameters
string$group
Returns
SiteList

Member Data Documentation

◆ $badgeItems

Wikibase\View\SiteLinksView::$badgeItems
private

◆ $entityIdFormatter

Wikibase\View\SiteLinksView::$entityIdFormatter
private

◆ $languageNameLookup

Wikibase\View\SiteLinksView::$languageNameLookup
private

◆ $numberLocalizer

Wikibase\View\SiteLinksView::$numberLocalizer
private

◆ $sectionEditLinkGenerator

Wikibase\View\SiteLinksView::$sectionEditLinkGenerator
private

◆ $sites

Wikibase\View\SiteLinksView::$sites
private

◆ $specialSiteLinkGroups

Wikibase\View\SiteLinksView::$specialSiteLinkGroups
private

◆ $templateFactory

Wikibase\View\SiteLinksView::$templateFactory
private

◆ $textProvider

Wikibase\View\SiteLinksView::$textProvider
private

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