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

File defining hooks related to magic words. More...

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

Public Member Functions

 __construct (SettingsArray $settings)
 
 onMagicWordwgVariableIDs (&$aCustomVariableIds)
 Register all magic words.
 
 onParserGetVariableValueSwitch ( $parser, &$cache, $magicWordId, &$ret, $frame)
 Handler for the ParserGetVariableValueSwitch hook.
 
 onResourceLoaderJqueryMsgModuleMagicWords (RL\Context $context, array &$magicWords)
 Handler for the ResourceLoaderJqueryMsgModuleMagicWords hook.
 

Protected Member Functions

 getRepoName ( $lang)
 Gets the user-facing repository name.
 

Protected Attributes

 $settings
 

Detailed Description

File defining hooks related to magic words.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Hooks\MagicWordHookHandler::__construct ( SettingsArray $settings)

Member Function Documentation

◆ getRepoName()

Wikibase\Client\Hooks\MagicWordHookHandler::getRepoName ( $lang)
protected

Gets the user-facing repository name.

This can either be a message's text, or the raw value from settings if that is not a message

Parameters
Language | string$langLanguage (code) to get text in
Returns
string

◆ onMagicWordwgVariableIDs()

Wikibase\Client\Hooks\MagicWordHookHandler::onMagicWordwgVariableIDs ( & $aCustomVariableIds)

Register all magic words.

Parameters
string[]&$aCustomVariableIds
Returns
bool

◆ onParserGetVariableValueSwitch()

Wikibase\Client\Hooks\MagicWordHookHandler::onParserGetVariableValueSwitch ( $parser,
& $cache,
$magicWordId,
& $ret,
$frame )

Handler for the ParserGetVariableValueSwitch hook.

Apply the magic word.

Parameters
Parser$parser
string[]&$cache
string$magicWordId
?string&$ret
PPFrame$frame

◆ onResourceLoaderJqueryMsgModuleMagicWords()

Wikibase\Client\Hooks\MagicWordHookHandler::onResourceLoaderJqueryMsgModuleMagicWords ( RL\Context $context,
array & $magicWords )

Handler for the ResourceLoaderJqueryMsgModuleMagicWords hook.

Adds magic word constant(s) for use by jQueryMsg.

Parameters
RL\Context$context
string[]&$magicWordsAssociative array mapping all-caps magic words to string values

Member Data Documentation

◆ $settings

Wikibase\Client\Hooks\MagicWordHookHandler::$settings
protected

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