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

Hook handlers for Minerva skin. More...

+ Inheritance diagram for MediaWiki\Minerva\Hooks:
+ Collaboration diagram for MediaWiki\Minerva\Hooks:

Public Member Functions

 __construct (ConfiguredReadOnlyMode $configuredReadOnlyMode, SkinOptions $skinOptions, UserOptionsLookup $userOptionsLookup, ?MobileContext $mobileContext)
 
 onResourceLoaderRegisterModules (ResourceLoader $resourceLoader)
 ResourceLoaderRegisterModules hook handler.
 
 onGetPreferences ( $user, &$prefs)
 Adds Minerva-specific user preferences that can only be accessed via API.
 
 onPreferencesGetLayout (&$useMobileLayout, $skinName, $skinProperties=[])
 PreferencesGetLayout hook handler.
 
 onFetchChangesList ( $user, $skin, &$list, $groups)
 Disable recent changes enhanced mode (table mode)
 
 onSpecialPageBeforeExecute ( $special, $subpage)
 Invocation of hook SpecialPageBeforeExecute.
 
 onUserLogoutComplete ( $user, &$inject_html, $oldName)
 UserLogoutComplete hook handler.
 
 onResourceLoaderGetConfigVars (array &$vars, $skin, Config $config)
 ResourceLoaderGetConfigVars hook handler.
 
 onOutputPageBodyAttributes ( $out, $skin, &$bodyAttrs)
 Modifies the <body> element's attributes.
 
 onSkinPageReadyConfig (Context $context, array &$config)
 SkinPageReadyConfig hook handler.
 
 onDifferenceEngineViewHeader ( $differenceEngine)
 Force inline diffs on mobile site.
 

Public Attributes

const FEATURE_OVERFLOW_PAGE_ACTIONS = 'MinervaOverflowInPageActions'
 

Detailed Description

Hook handlers for Minerva skin.

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

Member Function Documentation

◆ onDifferenceEngineViewHeader()

MediaWiki\Minerva\Hooks::onDifferenceEngineViewHeader ( $differenceEngine)

Force inline diffs on mobile site.

Parameters
DifferenceEngine$differenceEngine

◆ onFetchChangesList()

MediaWiki\Minerva\Hooks::onFetchChangesList ( $user,
$skin,
& $list,
$groups )

Disable recent changes enhanced mode (table mode)

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

◆ onGetPreferences()

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

Adds Minerva-specific user preferences that can only be accessed via API.

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

◆ onOutputPageBodyAttributes()

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

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

◆ onPreferencesGetLayout()

MediaWiki\Minerva\Hooks::onPreferencesGetLayout ( & $useMobileLayout,
$skinName,
$skinProperties = [] )

PreferencesGetLayout hook handler.

Use mobile layout in Special:Preferences

See also
https://www.mediawiki.org/wiki/Manual:Hooks/PreferencesGetLayout
Parameters
bool&$useMobileLayout
string$skinName
array$skinProperties

◆ onResourceLoaderGetConfigVars()

MediaWiki\Minerva\Hooks::onResourceLoaderGetConfigVars ( array & $vars,
$skin,
Config $config )

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
Config$config

◆ onResourceLoaderRegisterModules()

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

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()

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

SkinPageReadyConfig hook handler.

Parameters
Context$context
mixed[]&$configAssociative array of configurable options

◆ onSpecialPageBeforeExecute()

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

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()

MediaWiki\Minerva\Hooks::onUserLogoutComplete ( $user,
& $inject_html,
$oldName )

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
string&$inject_html
string$oldName

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