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

Handler for ParserOutput-related hooks. More...

+ Inheritance diagram for Wikibase\Client\Hooks\SidebarHookHandler:
+ Collaboration diagram for Wikibase\Client\Hooks\SidebarHookHandler:

Public Member Functions

 __construct (LanguageLinkBadgeDisplay $badgeDisplay, NamespaceChecker $namespaceChecker)
 
 onOutputPageParserOutput ( $outputPage, $parserOutput)
 Add output page property if repo links are suppressed, and property for item id.
 
 onSkinTemplateGetLanguageLink (&$languageLink, $languageLinkTitle, $title, $output)
 Add badges to the language links.
 
 onSidebarBeforeOutput ( $skin, &$sidebar)
 SidebarBeforeOutput hook handler.
 
 buildOtherProjectsSidebar (Skin $skin)
 Build 'In other projects' section of the sidebar, if enabled project wide or the user has the beta featured enabled.
 

Private Attributes

 $namespaceChecker
 
 $badgeDisplay
 

Detailed Description

Handler for ParserOutput-related hooks.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Hooks\SidebarHookHandler::__construct ( LanguageLinkBadgeDisplay $badgeDisplay,
NamespaceChecker $namespaceChecker )

Member Function Documentation

◆ buildOtherProjectsSidebar()

Wikibase\Client\Hooks\SidebarHookHandler::buildOtherProjectsSidebar ( Skin $skin)

Build 'In other projects' section of the sidebar, if enabled project wide or the user has the beta featured enabled.

Parameters
Skin$skin
Returns
null|array[] Array of 'In other projects' contents or null if there are none

◆ onOutputPageParserOutput()

Wikibase\Client\Hooks\SidebarHookHandler::onOutputPageParserOutput ( $outputPage,
$parserOutput )

Add output page property if repo links are suppressed, and property for item id.

Parameters
OutputPage$outputPage
ParserOutput$parserOutput

◆ onSidebarBeforeOutput()

Wikibase\Client\Hooks\SidebarHookHandler::onSidebarBeforeOutput ( $skin,
& $sidebar )

SidebarBeforeOutput hook handler.

This handler adds too items to the sidebar section. First it adds the 'Wikidata items' to the 'toolbox' section of the sidebar. Second it adds the 'In other projects' item which lives in its own section.

The items generation logic are handled separately for each. This callback is only concerned with adding them to the &$sidebar array (if they exist).

If current page cannot have 'Wikidata item' link, this callback will receive null value from ClientHooks::buildWikidataItemLink() method and so it will skip attempting to add the link. Same thing repeats for the second case.

Parameters
Skin$skin
array&$sidebar

◆ onSkinTemplateGetLanguageLink()

Wikibase\Client\Hooks\SidebarHookHandler::onSkinTemplateGetLanguageLink ( & $languageLink,
$languageLinkTitle,
$title,
$output )

Add badges to the language links.

Parameters
array&$languageLink
Title$languageLinkTitle
Title$title
OutputPage | null$output

Member Data Documentation

◆ $badgeDisplay

Wikibase\Client\Hooks\SidebarHookHandler::$badgeDisplay
private

◆ $namespaceChecker

Wikibase\Client\Hooks\SidebarHookHandler::$namespaceChecker
private

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