Wikibase
MediaWiki Wikibase extension
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 ( $out, $parserOutput)
 Add output page property if repo links are suppressed, and property for item id. More...
 
 onSkinTemplateGetLanguageLink (&$languageLink, $languageLinkTitle, $title, $output)
 Add badges to the language links. More...
 
 onSidebarBeforeOutput ( $skin, &$sidebar)
 SidebarBeforeOutput hook handler. More...
 
 buildOtherProjectsSidebar (Skin $skin)
 Build 'In other projects' section of the sidebar, if enabled project wide or the user has the beta featured enabled. More...
 

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 (   $out,
  $parserOutput 
)

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

Parameters
OutputPage$out
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: