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

File defining the hook handlers for the Wikibase Client extension. More...

Static Public Member Functions

static onScribuntoExternalLibraries ( $engine, array &$extraLibraries)
 External library for Scribunto.
 
static onFormat (&$comment, $pre, $auto, $post, $title, $local, $wikiId=null)
 Handler for the FormatAutocomments hook, implementing localized formatting for machine readable autocomments generated by SummaryFormatter.
 
static buildWikidataItemLink (Skin $skin)
 Build 'Wikidata item' link for later addition to the toolbox section of the sidebar.
 
static onGetPreferences (User $user, array &$prefs)
 Adds a preference for showing or hiding Wikidata entries in recent changes.
 
static onCirrusSearchAddQueryFeatures ( $config, array &$extraFeatures)
 Add morelikewithwikibase keyword.
 
static onSkinAfterBottomScripts (Skin $skin, &$html)
 Injects a Wikidata inline JSON-LD script schema for search engine optimization.
 
static getLinkitemConfiguration ()
 Used to propagate configuration for the linkitem feature to JavaScript.
 
static onWikibaseContentLanguages (array &$contentLanguages)
 

Static Protected Member Functions

static isWikibaseEnabled ( $namespace)
 

Static Private Member Functions

static getEntityIdForTitle (Title $title)
 
static parseEntityId (?string $prefixedId)
 

Detailed Description

File defining the hook handlers for the Wikibase Client extension.

Member Function Documentation

◆ buildWikidataItemLink()

static Wikibase\Client\ClientHooks::buildWikidataItemLink ( Skin $skin)
static

Build 'Wikidata item' link for later addition to the toolbox section of the sidebar.

Parameters
Skin$skin
Returns
string[]|null Array of link elements or Null if link cannot be created.

◆ getEntityIdForTitle()

static Wikibase\Client\ClientHooks::getEntityIdForTitle ( Title $title)
staticprivate
Parameters
Title$title
Returns
EntityId|null

◆ getLinkitemConfiguration()

static Wikibase\Client\ClientHooks::getLinkitemConfiguration ( )
static

Used to propagate configuration for the linkitem feature to JavaScript.

This is used in the "wikibase.client.linkitem.init" module.

◆ isWikibaseEnabled()

static Wikibase\Client\ClientHooks::isWikibaseEnabled ( $namespace)
staticprotected
See also
NamespaceChecker::isWikibaseEnabled
Parameters
int$namespace
Returns
bool

◆ onCirrusSearchAddQueryFeatures()

static Wikibase\Client\ClientHooks::onCirrusSearchAddQueryFeatures ( $config,
array & $extraFeatures )
static

Add morelikewithwikibase keyword.

Parameters
SearchConfig$config
array&$extraFeatures

◆ onFormat()

static Wikibase\Client\ClientHooks::onFormat ( & $comment,
$pre,
$auto,
$post,
$title,
$local,
$wikiId = null )
static

Handler for the FormatAutocomments hook, implementing localized formatting for machine readable autocomments generated by SummaryFormatter.

Parameters
string&$commentreference to the autocomment text
bool$pretrue if there is content before the autocomment
string$autothe autocomment unformatted
bool$posttrue if there is content after the autocomment
Title | null$titleuse for further information
bool$localshall links be generated locally or globally
string | null$wikiIdThe ID of the wiki the comment applies to, if not the local wiki.

◆ onGetPreferences()

static Wikibase\Client\ClientHooks::onGetPreferences ( User $user,
array & $prefs )
static

Adds a preference for showing or hiding Wikidata entries in recent changes.

Parameters
User$user
array[]&$prefs

◆ onScribuntoExternalLibraries()

static Wikibase\Client\ClientHooks::onScribuntoExternalLibraries ( $engine,
array & $extraLibraries )
static

External library for Scribunto.

Parameters
string$engine
string[]&$extraLibraries

◆ onSkinAfterBottomScripts()

static Wikibase\Client\ClientHooks::onSkinAfterBottomScripts ( Skin $skin,
& $html )
static

Injects a Wikidata inline JSON-LD script schema for search engine optimization.

Parameters
Skin$skin
string&$html
Returns
bool Always true.

◆ onWikibaseContentLanguages()

static Wikibase\Client\ClientHooks::onWikibaseContentLanguages ( array & $contentLanguages)
static
Parameters
ContentLanguages[]&$contentLanguages

◆ parseEntityId()

static Wikibase\Client\ClientHooks::parseEntityId ( ?string $prefixedId)
staticprivate

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