Basic display logic to output badges in the sidebar.
More...
Basic display logic to output badges in the sidebar.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Client\Hooks\SidebarLinkBadgeDisplay::__construct |
( |
LabelDescriptionLookup |
$labelDescriptionLookup, |
|
|
array |
$badgeClassNames, |
|
|
Language |
$language |
|
) |
| |
- Parameters
-
LabelDescriptionLookup | $labelDescriptionLookup | |
string[] | $badgeClassNames | |
Language | $language | |
◆ applyBadgeToLink()
Wikibase\Client\Hooks\SidebarLinkBadgeDisplay::applyBadgeToLink |
( |
array & |
$sidebarLink, |
|
|
array |
$badgeInfo |
|
) |
| |
Applies the badges described in the wikibase_badges property of $output to the language link.
This is generally called in the context of generating skin output.
- Parameters
-
string[] | &$sidebarLink | |
string[] | $badgeInfo | An associative array with the keys 'class' and 'label' with assigned string values. These fields are the one outputted by the getBadgeInfo() function. |
◆ getBadgeInfo()
Wikibase\Client\Hooks\SidebarLinkBadgeDisplay::getBadgeInfo |
( |
array |
$badgeIds | ) |
|
Builds badge information for the given badges.
CSS classes are derived from the given list of badges, and any extra badge class names specified in the badgeClassNames setting are added. For badges that have a such an extra class name assigned, this also adds a title according to the items' labels. Other badges do not have labels added to the link's title attribute, so the can be effectively ignored on this client wiki.
- Parameters
-
- Returns
- string[] An associative array with the keys 'class' and 'label' with assigned string values. These fields correspond to the fields in the description array for language links used by the SkinTemplateGetLanguageLink hook and expected by the applyBadgeToLink() function.
◆ getLabel()
Wikibase\Client\Hooks\SidebarLinkBadgeDisplay::getLabel |
( |
ItemId |
$badgeId | ) |
|
|
private |
Returns the label for the given badge.
- Parameters
-
- Returns
- string|null
◆ $badgeClassNames
Wikibase\Client\Hooks\SidebarLinkBadgeDisplay::$badgeClassNames |
|
private |
◆ $labelDescriptionLookup
Wikibase\Client\Hooks\SidebarLinkBadgeDisplay::$labelDescriptionLookup |
|
private |
◆ $language
Wikibase\Client\Hooks\SidebarLinkBadgeDisplay::$language |
|
private |
The documentation for this class was generated from the following file: