Wikibase
MediaWiki Wikibase extension
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. More...
 
 onParserGetVariableValueSwitch ( $parser, &$cache, $magicWordId, &$ret, $frame)
 Handler for the ParserGetVariableValueSwitch hook. More...
 
 onResourceLoaderJqueryMsgModuleMagicWords (ResourceLoaderContext $context, array &$magicWords)
 Handler for the ResourceLoaderJqueryMsgModuleMagicWords hook. More...
 

Protected Member Functions

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

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 ( Language  $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$langLanguage 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 ( ResourceLoaderContext  $context,
array &  $magicWords 
)

Handler for the ResourceLoaderJqueryMsgModuleMagicWords hook.

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

Parameters
ResourceLoaderContext$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: