MobileFrontend
Mobile optimised frontend for MediaWiki
Loading...
Searching...
No Matches
MobileFrontendEditorHooks Class Reference
+ Inheritance diagram for MobileFrontendEditorHooks:
+ Collaboration diagram for MobileFrontendEditorHooks:

Public Member Functions

 onMakeGlobalVariablesScript (&$vars, $out)
 Handler for MakeGlobalVariablesScript hook.
 
 onCustomEditor ( $article, $user)
 Decide whether to bother showing the wikitext editor at all.
 

Static Public Member Functions

static getContentLanguageMessages (Context $context, Config $config, array $messagesKeys=[])
 Return messages in content language, for use in a ResourceLoader module.
 
static getResourceLoaderMFConfigVars ()
 Generate config for usage inside MobileFrontend This should be used for variables which:
 

Static Protected Member Functions

static isSupportedEditRequest (IContextSource $context)
 Whether the custom editor override should occur.
 

Member Function Documentation

◆ getContentLanguageMessages()

static MobileFrontendEditorHooks::getContentLanguageMessages ( Context $context,
Config $config,
array $messagesKeys = [] )
static

Return messages in content language, for use in a ResourceLoader module.

Parameters
Context$context
Config$config
array$messagesKeys
Returns
array

◆ getResourceLoaderMFConfigVars()

static MobileFrontendEditorHooks::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

◆ isSupportedEditRequest()

static MobileFrontendEditorHooks::isSupportedEditRequest ( IContextSource $context)
staticprotected

Whether the custom editor override should occur.

Parameters
IContextSource$context
Returns
bool Whether the frontend JS should try to display an editor

◆ onCustomEditor()

MobileFrontendEditorHooks::onCustomEditor ( $article,
$user )

Decide whether to bother showing the wikitext editor at all.

If not, we expect the editor initialisation JS to activate.

Parameters
Article$articleThe article being viewed.
User$userThe user-specific settings.
Returns
bool Whether to show the wikitext editor or not.

◆ onMakeGlobalVariablesScript()

MobileFrontendEditorHooks::onMakeGlobalVariablesScript ( & $vars,
$out )

Handler for MakeGlobalVariablesScript hook.

For values that depend on the current page, user or request state.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/MakeGlobalVariablesScript
Parameters
array&$varsVariables to be added into the output
OutputPage$outOutputPage instance calling the hook

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