MobileFrontend
Mobile optimised frontend for MediaWiki
|
Hook handlers for MobileFrontend extension. More...
Static Public Member Functions | |
static | onBeforeInitialize ( $title, $unused, OutputPage $out) |
static | onMediaWikiPerformAction ( $output, $article, $title, $user, $request, $wiki) |
MediaWikiPerformAction hook handler (enable mwui for all pages) | |
static | onSkinAddFooterLinks (Skin $skin, string $key, array &$footerLinks) |
Update the footer. | |
static | onOutputPageBodyAttributes (OutputPage $out, Skin $skin, &$bodyAttrs) |
Modifies the <body> element's attributes. | |
static | onBeforePageRedirect ( $out, &$redirect, &$code) |
BeforePageRedirect hook handler. | |
static | onDifferenceEngineViewHeader ( $diff) |
DifferenceEngineViewHeader hook handler. | |
static | onResourceLoaderSiteStylesModulePages ( $skin, &$pages) |
ResourceLoaderSiteStylesModulePages hook handler. | |
static | onResourceLoaderSiteModulePages ( $skin, &$pages) |
ResourceLoaderSiteModulePages hook handler. | |
static | onGetCacheVaryCookies ( $out, &$cookies) |
GetCacheVaryCookies hook handler. | |
static | onPageRenderingHash (&$confstr, User $user, &$forOptions) |
Varies the parser cache if responsive images should have their variants stripped from the parser output, since the transformation happens during the parse. | |
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 | onListDefinedTags (&$tags) |
ListDefinedTags and ChangeTagsListActive hook handler. | |
static | onTaggableObjectCreation (Taggable $taggable) |
RecentChange_save hook handler that tags mobile changes. | |
static | onAbuseFilterGenerateUserVars ( $vars, $user, RecentChange $rc=null) |
AbuseFilter-generateUserVars hook handler that adds a user_mobile variable. | |
static | onAbuseFilterBuilder (&$builder) |
AbuseFilter-builder hook handler that adds user_mobile variable to list of valid vars. | |
static | onUserLoginComplete (&$currentUser, &$injected_html) |
UserLoginComplete hook handler. | |
static | onBeforePageDisplay (OutputPage &$out, Skin &$skin) |
BeforePageDisplay hook handler. | |
static | onUserGetDefaultOptions (&$defaultUserOptions) |
Register default preferences for MobileFrontend. | |
static | onGetPreferences ( $user, &$preferences) |
GetPreferences hook handler. | |
static | onAllowLegacyGadgets () |
Gadgets::allowLegacy hook handler. | |
static | onCentralAuthLoginRedirectData ( $centralUser, &$data) |
CentralAuthLoginRedirectData hook handler Saves mobile host so that the CentralAuth wiki could redirect back properly. | |
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 | onHTMLFileCacheUseFileCache () |
HTMLFileCache::useFileCache hook handler Disables file caching for mobile pageviews. | |
static | onLoginFormValidErrorMessages (&$messages) |
LoginFormValidErrorMessages hook handler to promote MF specific error message be valid. | |
static | onTitleSquidURLs (Title $title, array &$urls) |
Handler for TitleSquidURLs hook to add copies of the cache purge URLs which are transformed according to the wgMobileUrlTemplate, so that both mobile and non-mobile URL variants get purged. | |
static | onAPIQuerySiteInfoGeneralInfo (ApiQuerySiteinfo $module, array &$result) |
Add the base mobile site URL to the siteinfo API output. | |
Public Attributes | |
const | MOBILE_PREFERENCES_SPECIAL_PAGES = 'mobile-specialpages' |
const | MOBILE_PREFERENCES_EDITOR = 'mobile-editor' |
Static Protected Member Functions | |
static | getDefaultMobileSkin (Config $config) |
Obtain the default mobile skin. | |
Hook handlers for MobileFrontend extension.
Hook handler method names should be in the form of: on<HookName>() For instance, the hook handler for the 'RequestContextCreateSkin' would be called: onRequestContextCreateSkin()
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
|
static |
Finds the wikidata tagline associated with the page.
ParserOutput | $po | |
callable | $fallbackWikibaseDescriptionFunc | A fallback to provide Wikibase description. Function takes wikibase_item as a first and only argument |
|
staticprotected |
Obtain the default mobile skin.
Config | $config |
SkinException | If a factory function isn't registered for the skin name |
|
static |
Generate config for usage inside MobileFrontend This should be used for variables which:
|
static |
AbuseFilter-builder hook handler that adds user_mobile variable to list of valid vars.
array | &$builder | Array in AbuseFilter::getBuilderValues to add to. |
|
static |
AbuseFilter-generateUserVars hook handler that adds a user_mobile variable.
Altering the variables generated for a specific user
VariableHolder | $vars | object to add vars to |
User | $user | |
RecentChange | null | $rc | If the variables should be generated for an RC entry, this is the entry. Null if it's for the current action being filtered. |
|
static |
Gadgets::allowLegacy hook handler.
|
static |
Add the base mobile site URL to the siteinfo API output.
ApiQuerySiteinfo | $module | |
array | &$result | Api result array |
|
static |
mixed | $title | |
mixed | $unused | |
OutputPage | $out |
|
static |
BeforePageDisplay hook handler.
OutputPage | &$out | |
Skin | &$skin | Skin object that will be used to generate the page, added in 1.13. |
|
static |
BeforePageRedirect hook handler.
Ensures URLs are handled properly for select special pages.
OutputPage | $out | |
string | &$redirect | URL string, modifiable |
string | &$code | HTTP code (eg '301' or '302'), modifiable |
|
static |
CentralAuthLoginRedirectData hook handler Saves mobile host so that the CentralAuth wiki could redirect back properly.
\MediaWiki\Extension\CentralAuth\User\CentralAuthUser | $centralUser | |
array | &$data | Redirect data |
|
static |
CentralAuthSilentLoginRedirect hook handler Points redirects from CentralAuth wiki to mobile domain if user has logged in from it.
\MediaWiki\Extension\CentralAuth\User\CentralAuthUser | $centralUser | |
string | &$url | to redirect to |
array | $info | token information |
|
static |
DifferenceEngineViewHeader hook handler.
Redirect Diff page to mobile version if appropriate
DifferenceEngine | $diff | DifferenceEngine object that's calling |
|
static |
GetCacheVaryCookies hook handler.
OutputPage | $out | |
array | &$cookies | array of cookies name, add a value to it if you want to add a cookie that have to vary cache options |
|
static |
GetPreferences hook handler.
User | $user | User whose preferences are being modified |
array | &$preferences | Preferences description array, to be fed to an HTMLForm object |
|
static |
HTMLFileCache::useFileCache hook handler Disables file caching for mobile pageviews.
|
static |
ListDefinedTags and ChangeTagsListActive hook handler.
array | &$tags | The list of tags. Add your extension's tags to this array. |
|
static |
LoginFormValidErrorMessages hook handler to promote MF specific error message be valid.
array | &$messages | Array of already added messages |
|
static |
MediaWikiPerformAction hook handler (enable mwui for all pages)
OutputPage | $output | |
Article | $article | |
Title | $title | Page title |
User | $user | User performing action |
RequestContext | $request | |
MediaWiki | $wiki |
|
static |
Modifies the <body>
element's attributes.
By default, the class
attribute is set to the output's "bodyClassName" property.
OutputPage | $out | |
Skin | $skin | |
string[] | &$bodyAttrs |
|
static |
Varies the parser cache if responsive images should have their variants stripped from the parser output, since the transformation happens during the parse.
See $wgMFStripResponsiveImages
and $wgMFResponsiveImageWhitelist
for more detail about the stripping of responsive images.
See https://www.mediawiki.org/wiki/Manual:Hooks/PageRenderingHash for more detail about the PageRenderingHash
hook.
string | &$confstr | Reference to the parser cache key |
User | $user | The user that is requesting the page |
array | &$forOptions | The options used to generate the parser cache key |
|
static |
ResourceLoaderSiteModulePages hook handler.
string | $skin | |
array | &$pages | to sort modules from. |
|
static |
ResourceLoaderSiteStylesModulePages hook handler.
string | $skin | |
array | &$pages | to sort modules from. |
|
static |
Update the footer.
Skin | $skin | |
string | $key | the current key for the current group (row) of footer links. e.g. info or places . |
array | &$footerLinks | an empty array that can be populated with new links. keys should be strings and will be used for generating the ID of the footer item and value should be an HTML string. |
|
static |
RecentChange_save hook handler that tags mobile changes.
ManualLogEntryBeforePublish hook handler that tags actions logged when user uses mobile mode
Taggable | $taggable | Object to tag |
|
static |
Handler for TitleSquidURLs hook to add copies of the cache purge URLs which are transformed according to the wgMobileUrlTemplate, so that both mobile and non-mobile URL variants get purged.
Title | $title | the article title |
array | &$urls | the set of URLs to purge |
|
static |
Register default preferences for MobileFrontend.
array | &$defaultUserOptions | Reference to default options array |
|
static |
UserLoginComplete hook handler.
Used here to handle watchlist actions made by anons to be handled after login or account creation.
User | &$currentUser | the user object that was created on login |
string | &$injected_html | From 1.13, any HTML to inject after the login success message. |
|
static |
Should special pages be replaced with mobile formatted equivalents?
User | $user | for which we need to make the decision based on user prefs |