MinervaNeue
A responsive mobile first skin
Loading...
Searching...
No Matches
MediaWiki\Minerva\Hooks Class Reference

Hook handlers for Minerva skin. More...

Static Public Member Functions

static onResourceLoaderRegisterModules (ResourceLoader $resourceLoader)
 ResourceLoaderRegisterModules hook handler.
 
static onFetchChangesList (User $user, Skin $skin, &$list, $groups=[])
 Disable recent changes enhanced mode (table mode)
 
static onMobileFrontendFeaturesRegistration ( $featureManager)
 Register mobile web beta features.
 
static onSpecialPageBeforeExecute (SpecialPage $special, $subpage)
 Invocation of hook SpecialPageBeforeExecute.
 
static onMobileFrontendBeforeDOM (MobileContext $mobileContext, MobileFormatter $formatter)
 MobileFrontendBeforeDOM hook handler that runs before the MobileFormatter executes.
 
static onUserLogoutComplete (User $user)
 UserLogoutComplete hook handler.
 
static onRequestContextCreateSkinMobile (MobileContext $mobileContext, Skin $skin)
 BeforePageDisplayMobile hook handler.
 
static onResourceLoaderGetConfigVars (&$vars, $skin)
 ResourceLoaderGetConfigVars hook handler.
 
static onBeforePageDisplay (OutputPage $out, Skin $skin)
 The Minerva skin loads message box styles differently from core, to reduce the amount of styles on the critical path.
 
static onOutputPageBodyAttributes (OutputPage $out, Skin $skin, &$bodyAttrs)
 Modifies the <body> element's attributes.
 
static onSkinPageReadyConfig (ResourceLoaderContext $context, array &$config)
 SkinPageReadyConfig hook handler.
 

Detailed Description

Hook handlers for Minerva skin.

Hook handler method names should be in the form of: on<HookName>()

Member Function Documentation

◆ onBeforePageDisplay()

static MediaWiki\Minerva\Hooks::onBeforePageDisplay ( OutputPage $out,
Skin $skin )
static

The Minerva skin loads message box styles differently from core, to reduce the amount of styles on the critical path.

This adds message box styles to pages that need it, to avoid loading them on pages where they are not.

Parameters
OutputPage$out
Skin$skin

◆ onFetchChangesList()

static MediaWiki\Minerva\Hooks::onFetchChangesList ( User $user,
Skin $skin,
& $list,
$groups = [] )
static

Disable recent changes enhanced mode (table mode)

See also
https://www.mediawiki.org/wiki/Manual:Hooks/FetchChangesList
Parameters
User$user
Skin$skin
array&$list
array$groups
Returns
bool|null

◆ onMobileFrontendBeforeDOM()

static MediaWiki\Minerva\Hooks::onMobileFrontendBeforeDOM ( MobileContext $mobileContext,
MobileFormatter $formatter )
static

MobileFrontendBeforeDOM hook handler that runs before the MobileFormatter executes.

We use it to determine whether or not the talk page is eligible to be simplified (we want it only to be simplified when the MobileFormatter makes expandable sections).

Parameters
MobileContext$mobileContext
MobileFormatter$formatter

◆ onMobileFrontendFeaturesRegistration()

static MediaWiki\Minerva\Hooks::onMobileFrontendFeaturesRegistration ( $featureManager)
static

Register mobile web beta features.

See also
https://www.mediawiki.org/wiki/ Extension:MobileFrontend/MobileFrontendFeaturesRegistration
Parameters
FeaturesManager$featureManager

◆ onOutputPageBodyAttributes()

static MediaWiki\Minerva\Hooks::onOutputPageBodyAttributes ( OutputPage $out,
Skin $skin,
& $bodyAttrs )
static

Modifies the <body> element's attributes.

By default, the class attribute is set to the output's "bodyClassName" property.

Parameters
OutputPage$out
Skin$skin
string[]&$bodyAttrs

◆ onRequestContextCreateSkinMobile()

static MediaWiki\Minerva\Hooks::onRequestContextCreateSkinMobile ( MobileContext $mobileContext,
Skin $skin )
static

BeforePageDisplayMobile hook handler.

Parameters
MobileContext$mobileContext
Skin$skin

◆ onResourceLoaderGetConfigVars()

static MediaWiki\Minerva\Hooks::onResourceLoaderGetConfigVars ( & $vars,
$skin )
static

ResourceLoaderGetConfigVars hook handler.

Used for setting JS variables which are pulled in dynamically with RL instead of embedded directly on the page with a script tag. These vars have a shorter cache-life than those in getJsConfigVars.

Parameters
array&$varsArray of variables to be added into the output of the RL startup module.
string$skin

◆ onResourceLoaderRegisterModules()

static MediaWiki\Minerva\Hooks::onResourceLoaderRegisterModules ( ResourceLoader $resourceLoader)
static

ResourceLoaderRegisterModules hook handler.

Registers:

  • EventLogging schema modules, if the EventLogging extension is loaded;
  • Modules for the Visual Editor overlay, if the VisualEditor extension is loaded; and
  • Modules for the notifications overlay, if the Echo extension is loaded.
See also
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderRegisterModules
Parameters
ResourceLoader$resourceLoader

◆ onSkinPageReadyConfig()

static MediaWiki\Minerva\Hooks::onSkinPageReadyConfig ( ResourceLoaderContext $context,
array & $config )
static

SkinPageReadyConfig hook handler.

Disable collapsible and sortable on page load

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

◆ onSpecialPageBeforeExecute()

static MediaWiki\Minerva\Hooks::onSpecialPageBeforeExecute ( SpecialPage $special,
$subpage )
static

Invocation of hook SpecialPageBeforeExecute.

We use this hook to ensure that login/account creation pages are redirected to HTTPS if they are not accessed via HTTPS and $wgSecureLogin == true - but only when using the mobile site.

Parameters
SpecialPage$special
string$subpage

◆ onUserLogoutComplete()

static MediaWiki\Minerva\Hooks::onUserLogoutComplete ( User $user)
static

UserLogoutComplete hook handler.

Resets skin options if a user logout occurs - this is necessary as the RequestContextCreateSkinMobile hook runs before the UserLogout hook.

Parameters
User$user

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