MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileFrontendHooks Class Reference

Hook handlers for MobileFrontend extension. More...

+ Inheritance diagram for MobileFrontendHooks:
+ Collaboration diagram for MobileFrontendHooks:

Public Member Functions

 onResourceLoaderSiteStylesModulePages ( $skin, array &$pages)
 ResourceLoaderSiteStylesModulePages hook handler.
 
 onResourceLoaderSiteModulePages ( $skin, array &$pages)
 ResourceLoaderSiteModulePages hook handler.
 
 onListDefinedTags (&$tags)
 ListDefinedTags hook handler.
 
 onChangeTagsListActive (&$tags)
 ChangeTagsListActive hook handler.
 
 addDefinedTags (&$tags)
 
 onRecentChange_save ( $recentChange)
 RecentChange_save hook handler that tags mobile changes.
 
 onManualLogEntryBeforePublish ( $logEntry)
 ManualLogEntryBeforePublish hook handler that tags actions logged when user uses mobile mode.
 
 onUserGetDefaultOptions (&$defaultUserOptions)
 Register default preferences for MobileFrontend.
 
 onGetPreferences ( $user, &$preferences)
 GetPreferences hook handler.
 
 onLoginFormValidErrorMessages (array &$messages)
 LoginFormValidErrorMessages hook handler to promote MF specific error message be valid.
 

Static Public Member Functions

static getResourceLoaderMFConfigVars ()
 Generate config for usage inside MobileFrontend This should be used for variables which:
 
static shouldMobileFormatSpecialPages ( $user)
 Should special pages be replaced with mobile formatted equivalents?
 
static onAbuseFilterBuilder (&$builder)
 AbuseFilter-builder hook handler that adds user_mobile variable to list of valid vars.
 
static onCentralAuthSilentLoginRedirect ( $centralUser, &$url, $info)
 CentralAuthSilentLoginRedirect hook handler Points redirects from CentralAuth wiki to mobile domain if user has logged in from it.
 
static findTagline (ParserOutput $po, $fallbackWikibaseDescriptionFunc)
 Finds the wikidata tagline associated with the page.
 
static hasEditNoticesFeatureConflict (Config $config, User $user)
 Check if a conflicting edit notices gadget is enabled for the current user.
 

Public Attributes

const MOBILE_PREFERENCES_SPECIAL_PAGES = 'mobile-specialpages'
 
const MOBILE_PREFERENCES_EDITOR = 'mobile-editor'
 
const MOBILE_PREFERENCES_FONTSIZE = 'mf-font-size'
 
const MOBILE_PREFERENCES_EXPAND_SECTIONS = 'mf-expand-sections'
 

Static Protected Member Functions

static getDefaultMobileSkin (Config $config)
 Obtain the default mobile skin.
 

Detailed Description

Hook handlers for MobileFrontend extension.

If your hook changes the behaviour of the Minerva skin, you are in the wrong place. Any changes relating to Minerva should go into Minerva.hooks.php

Member Function Documentation

◆ addDefinedTags()

MobileFrontendHooks::addDefinedTags ( & $tags)
Parameters
array&$tags

◆ findTagline()

static MobileFrontendHooks::findTagline ( ParserOutput $po,
$fallbackWikibaseDescriptionFunc )
static

Finds the wikidata tagline associated with the page.

Parameters
ParserOutput$po
callable$fallbackWikibaseDescriptionFuncA fallback to provide Wikibase description. Function takes wikibase_item as a first and only argument
Returns
?string the tagline as a string, or else null if none is found

◆ getDefaultMobileSkin()

static MobileFrontendHooks::getDefaultMobileSkin ( Config $config)
staticprotected

Obtain the default mobile skin.

Parameters
Config$config
Exceptions
SkinExceptionIf a factory function isn't registered for the skin name
Returns
Skin

◆ getResourceLoaderMFConfigVars()

static MobileFrontendHooks::getResourceLoaderMFConfigVars ( )
static

Generate config for usage inside MobileFrontend This should be used for variables which:

  • vary with the html
  • variables that should work cross skin including anonymous users
  • used for both, stable and beta mode (don't use MobileContext::isBetaGroupMember in this function - T127860)
Returns
array

◆ hasEditNoticesFeatureConflict()

static MobileFrontendHooks::hasEditNoticesFeatureConflict ( Config $config,
User $user )
static

Check if a conflicting edit notices gadget is enabled for the current user.

Parameters
Config$config
User$user
Returns
bool

◆ onAbuseFilterBuilder()

static MobileFrontendHooks::onAbuseFilterBuilder ( & $builder)
static

AbuseFilter-builder hook handler that adds user_mobile variable to list of valid vars.

Parameters
array&$builderArray in AbuseFilter::getBuilderValues to add to.

◆ onCentralAuthSilentLoginRedirect()

static MobileFrontendHooks::onCentralAuthSilentLoginRedirect ( $centralUser,
& $url,
$info )
static

CentralAuthSilentLoginRedirect hook handler Points redirects from CentralAuth wiki to mobile domain if user has logged in from it.

See also
SpecialCentralLogin in CentralAuth extension
Parameters
\MediaWiki\Extension\CentralAuth\User\CentralAuthUser$centralUser
string&$urlto redirect to
array$infotoken information

◆ onChangeTagsListActive()

MobileFrontendHooks::onChangeTagsListActive ( & $tags)

ChangeTagsListActive hook handler.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ChangeTagsListActive
Parameters
array&$tagsThe list of tags. Add your extension's tags to this array.

◆ onGetPreferences()

MobileFrontendHooks::onGetPreferences ( $user,
& $preferences )

GetPreferences hook handler.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/GetPreferences
Parameters
User$userUser whose preferences are being modified
array&$preferencesPreferences description array, to be fed to an HTMLForm object

◆ onListDefinedTags()

MobileFrontendHooks::onListDefinedTags ( & $tags)

ListDefinedTags hook handler.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ListDefinedTags
Parameters
array&$tagsThe list of tags. Add your extension's tags to this array.

◆ onLoginFormValidErrorMessages()

MobileFrontendHooks::onLoginFormValidErrorMessages ( array & $messages)

LoginFormValidErrorMessages hook handler to promote MF specific error message be valid.

Parameters
array&$messagesArray of already added messages

◆ onManualLogEntryBeforePublish()

MobileFrontendHooks::onManualLogEntryBeforePublish ( $logEntry)

ManualLogEntryBeforePublish hook handler that tags actions logged when user uses mobile mode.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ManualLogEntryBeforePublish
Parameters
ManualLogEntry$logEntry

◆ onRecentChange_save()

MobileFrontendHooks::onRecentChange_save ( $recentChange)

RecentChange_save hook handler that tags mobile changes.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/RecentChange_save
Parameters
RecentChange$recentChange

◆ onResourceLoaderSiteModulePages()

MobileFrontendHooks::onResourceLoaderSiteModulePages ( $skin,
array & $pages )

ResourceLoaderSiteModulePages hook handler.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderSiteModulePages
Parameters
string$skin
array&$pagesto sort modules from.

◆ onResourceLoaderSiteStylesModulePages()

MobileFrontendHooks::onResourceLoaderSiteStylesModulePages ( $skin,
array & $pages )

ResourceLoaderSiteStylesModulePages hook handler.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderSiteStylesModulePages
Parameters
string$skin
array&$pagesto sort modules from.

◆ onUserGetDefaultOptions()

MobileFrontendHooks::onUserGetDefaultOptions ( & $defaultUserOptions)

Register default preferences for MobileFrontend.

Parameters
array&$defaultUserOptionsReference to default options array

◆ shouldMobileFormatSpecialPages()

static MobileFrontendHooks::shouldMobileFormatSpecialPages ( $user)
static

Should special pages be replaced with mobile formatted equivalents?

Parameters
User$userfor which we need to make the decision based on user prefs
Returns
bool whether special pages should be substituted with mobile friendly equivalents

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