Vector
Vector is a skin for MediaWiki. Vector has been the default skin on all Wikimedia wikis since 2010.
Loading...
Searching...
No Matches
MediaWiki\Skins\Vector\Hooks Class Reference
+ Inheritance diagram for MediaWiki\Skins\Vector\Hooks:
+ Collaboration diagram for MediaWiki\Skins\Vector\Hooks:

Public Member Functions

 onSkinPageReadyConfig (RL\Context $context, array &$config)
 SkinPageReadyConfig hook handler.
 
 onResourceLoaderSiteStylesModulePages ( $skin, &$pages)
 Adds MediaWiki:Vector.css as the skin style that controls classic Vector.
 
 onResourceLoaderSiteModulePages ( $skin, &$pages)
 Adds MediaWiki:Vector.css as the skin style that controls classic Vector.
 
 onGetPreferences ( $user, &$prefs)
 Adds the persistent sidebar hidden API preference.
 
 onLocalUserCreated ( $user, $isAutoCreated)
 Called one time when initializing a users preferences for a newly created account.
 
 onRequestContextCreateSkin ( $context, &$skin)
 Temporary RequestContextCreateSkin hook handler.
 
 onMakeGlobalVariablesScript (&$vars, $out)
 NOTE: Please use ResourceLoaderGetConfigVars hook instead if possible for adding config to the page.
 

Static Public Member Functions

static getVectorResourceLoaderConfig (RL\Context $context, Config $config)
 Passes config variables to Vector (modern) ResourceLoader module.
 
static getVectorSearchResourceLoaderConfig (RL\Context $context, Config $config)
 Generates config variables for skins.vector.search Resource Loader module (defined in skin.json).
 
static makeIcon ( $name)
 Make an icon.
 
static updateMenuItemData ( $item, $isSmallIcon=false)
 Updates template data for Vector menu items.
 
static onSkinTemplateNavigation ( $sk, &$content_navigation)
 Upgrades Vector's watch action to a watchstar.
 

Member Function Documentation

◆ getVectorResourceLoaderConfig()

static MediaWiki\Skins\Vector\Hooks::getVectorResourceLoaderConfig ( RL\Context $context,
Config $config )
static

Passes config variables to Vector (modern) ResourceLoader module.

Parameters
RL\Context$context
Config$config
Returns
array

◆ getVectorSearchResourceLoaderConfig()

static MediaWiki\Skins\Vector\Hooks::getVectorSearchResourceLoaderConfig ( RL\Context $context,
Config $config )
static

Generates config variables for skins.vector.search Resource Loader module (defined in skin.json).

Parameters
RL\Context$context
Config$config
Returns
array<string,mixed>

◆ onGetPreferences()

MediaWiki\Skins\Vector\Hooks::onGetPreferences ( $user,
& $prefs )

Adds the persistent sidebar hidden API preference.

Parameters
User$userUser whose preferences are being modified.
array[]&$prefsPreferences description array, to be fed to a HTMLForm object.

◆ onLocalUserCreated()

MediaWiki\Skins\Vector\Hooks::onLocalUserCreated ( $user,
$isAutoCreated )

Called one time when initializing a users preferences for a newly created account.

Parameters
User$userNewly created user object.
bool$isAutoCreated

◆ onMakeGlobalVariablesScript()

MediaWiki\Skins\Vector\Hooks::onMakeGlobalVariablesScript ( & $vars,
$out )

NOTE: Please use ResourceLoaderGetConfigVars hook instead if possible for adding config to the page.

Adds config variables to JS that depend on current page/request.

Adds a config flag that can disable saving the VectorSidebarVisible user preference when the sidebar menu icon is clicked.

Parameters
array&$varsArray of variables to be added into the output.
OutputPage$outOutputPage instance calling the hook

◆ onRequestContextCreateSkin()

MediaWiki\Skins\Vector\Hooks::onRequestContextCreateSkin ( $context,
& $skin )

Temporary RequestContextCreateSkin hook handler.

Switches to new Vector on certain pages.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/RequestContextCreateSkin
Parameters
IContextSource$contextThe RequestContext object the skin is being created for.
Skin | null | string&$skinA variable reference you may set a Skin instance or string key on to override the skin that will be used for the context.
Returns
bool|void

◆ onResourceLoaderSiteModulePages()

MediaWiki\Skins\Vector\Hooks::onResourceLoaderSiteModulePages ( $skin,
& $pages )

Adds MediaWiki:Vector.css as the skin style that controls classic Vector.

Parameters
string$skin
array&$pages

◆ onResourceLoaderSiteStylesModulePages()

MediaWiki\Skins\Vector\Hooks::onResourceLoaderSiteStylesModulePages ( $skin,
& $pages )

Adds MediaWiki:Vector.css as the skin style that controls classic Vector.

Parameters
string$skin
array&$pages

◆ onSkinPageReadyConfig()

MediaWiki\Skins\Vector\Hooks::onSkinPageReadyConfig ( RL\Context $context,
array & $config )

SkinPageReadyConfig hook handler.

Replace searchModule provided by skin.

Since
1.35
Parameters
RL\Context$context
mixed[]&$configAssociative array of configurable options
Returns
void This hook must not abort, it must return no value

◆ onSkinTemplateNavigation()

static MediaWiki\Skins\Vector\Hooks::onSkinTemplateNavigation ( $sk,
& $content_navigation )
static

Upgrades Vector's watch action to a watchstar.

This is invoked inside SkinVector, not via skin registration, as skin hooks are not guaranteed to run last. This can possibly be revised based on the outcome of T287622.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateNavigation
Parameters
SkinTemplate$sk
array&$content_navigation

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