MobileFrontend
MobileoptimisedfrontendforMediaWiki
|
Hook handlers for MobileFrontend extension. More...
Static Public Member Functions | |
static | onRequestContextCreateSkin ( $context, &$skin) |
RequestContextCreateSkin hook handler. More... | |
static | onBeforeInitialize ( $title, $unused, OutputPage $out) |
static | onMediaWikiPerformAction ( $output, $article, $title, $user, $request, $wiki) |
MediaWikiPerformAction hook handler (enable mwui for all pages) More... | |
static | onSkinTemplateOutputPageBeforeExec (Skin &$skin, QuickTemplate &$tpl) |
SkinTemplateOutputPageBeforeExec hook handler. More... | |
static | onSkinAfterBottomScripts (Skin $skin, &$html) |
SkinAfterBottomScripts hook handler. More... | |
static | onOutputPageBeforeHTML (&$out, &$text) |
OutputPageBeforeHTML hook handler. More... | |
static | onBeforePageRedirect ( $out, &$redirect, &$code) |
BeforePageRedirect hook handler. More... | |
static | onDiffViewHeader ( $diff, $oldRev, $newRev) |
DiffViewHeader hook handler. More... | |
static | onGetCacheVaryCookies ( $out, &$cookies) |
GetCacheVaryCookies hook handler. More... | |
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. More... | |
static | getResourceLoaderMFConfigVars () |
Generate config for usage inside MobileFrontend This should be used for variables which: More... | |
static | shouldMobileFormatSpecialPages ( $user) |
Should special pages be replaced with mobile formatted equivalents? More... | |
static | onSpecialPageInitList (&$list) |
Hook for SpecialPage_initList in SpecialPageFactory. More... | |
static | onListDefinedTags (&$tags) |
ListDefinedTags and ChangeTagsListActive hook handler. More... | |
static | onTaggableObjectCreation (Taggable $taggable) |
RecentChange_save hook handler that tags mobile changes. More... | |
static | onAbuseFilterGenerateUserVars ( $vars, $user) |
AbuseFilter-GenerateUserVars hook handler that adds a user_mobile variable. More... | |
static | onAbuseFilterBuilder (&$builder) |
AbuseFilter-builder hook handler that adds user_mobile variable to list of valid vars. More... | |
static | onUserLoginComplete (&$currentUser, &$injected_html) |
UserLoginComplete hook handler. More... | |
static | onBeforePageDisplay (OutputPage &$out, Skin &$skin) |
BeforePageDisplay hook handler. More... | |
static | onAfterBuildFeedLinks (array &$tags) |
AfterBuildFeedLinks hook handler. More... | |
static | onUserGetDefaultOptions (&$wgDefaultUserOptions) |
Register default preferences for MobileFrontend. More... | |
static | onGetPreferences ( $user, &$preferences) |
GetPreferences hook handler. More... | |
static | onAllowLegacyGadgets () |
Gadgets::allowLegacy hook handler. More... | |
static | onCentralAuthLoginRedirectData ( $centralUser, &$data) |
CentralAuthLoginRedirectData hook handler Saves mobile host so that the CentralAuth wiki could redirect back properly. More... | |
static | onCentralAuthSilentLoginRedirect ( $centralUser, &$url, $info) |
CentralAuthSilentLoginRedirect hook handler Points redirects from CentralAuth wiki to mobile domain if user has logged in from it. More... | |
static | onResourceLoaderTestModules (array &$testModules, ResourceLoader $resourceLoader) |
ResourceLoaderTestModules hook handler. More... | |
static | onResourceLoaderRegisterModules (ResourceLoader &$resourceLoader) |
ResourceLoaderRegisterModules hook handler. More... | |
static | findTagline (ParserOutput $po, $fallbackWikibaseDescriptionFunc) |
Finds the wikidata tagline associated with the page. More... | |
static | onOutputPageParserOutput ( $outputPage, ParserOutput $po) |
OutputPageParserOutput hook handler. More... | |
static | onHTMLFileCacheUseFileCache () |
HTMLFileCache::useFileCache hook handler Disables file caching for mobile pageviews. More... | |
static | onThumbnailBeforeProduceHTML ( $thumbnail, &$attribs, &$linkAttribs) |
Removes the responsive image's variants from the parser output if configured to do so and the thumbnail's MIME type isn't whitelisted. More... | |
static | onLoginFormValidErrorMessages (&$messages) |
LoginFormValidErrorMessages hook handler to promote MF specific error message be valid. More... | |
static | onMakeGlobalVariablesScript (array &$vars, OutputPage $out) |
Handler for MakeGlobalVariablesScript hook. More... | |
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. More... | |
static | onAuthChangeFormFields (array $requests, array $fieldInfo, array &$formDescriptor, $action) |
Handler for the AuthChangeFormFields hook to add a logo on top of the login screen. More... | |
static | onAPIQuerySiteInfoGeneralInfo (ApiQuerySiteinfo $module, array &$result) |
Add the base mobile site URL to the siteinfo API output. More... | |
static | onGetDifferenceEngine (IContextSource $context, $old, $new, $refreshCache, $unhide, &$differenceEngine) |
Use inline diff engine when on Special:MobileDiff. More... | |
Static Protected Member Functions | |
static | getDefaultMobileSkin (IContextSource $context, Config $config) |
Obtain the default mobile skin. More... | |
Hook handlers for MobileFrontend extension.
Hook handler method names should be in the form of: on<HookName>() For intance, 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.
IContextSource | $context | ContextSource interface |
Config | $config |
RuntimeException | if MFDefaultSkinClass is incorrectly configured |
|
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
AbuseFilterVariableHolder | $vars | object to add vars to |
User | $user |
|
static |
AfterBuildFeedLinks hook handler.
Remove all feed links in mobile view.
array | &$tags | Added feed links |
|
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 |
Handler for the AuthChangeFormFields hook to add a logo on top of the login screen.
This is the AuthManager equivalent of changeUserLoginCreateForm.
AuthenticationRequest[] | $requests | AuthenticationRequest objects array |
array | $fieldInfo | Field description as given by AuthenticationRequest::mergeFieldInfo |
array | &$formDescriptor | A form descriptor suitable for the HTMLForm constructor |
string | $action | One of the AuthManager::ACTION_* constants |
|
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.
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.
CentralAuthUser | $centralUser | |
string | &$url | to redirect to |
array | $info | token information |
|
static |
DiffViewHeader hook handler.
Redirect Diff page to mobile version if appropriate
DifferenceEngine | $diff | DifferenceEngine object that's calling |
Revision | $oldRev | Revision object of the "old" revision (may be null/invalid) |
Revision | $newRev | Revision object of the "new" revision |
|
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 |
Use inline diff engine when on Special:MobileDiff.
IContextSource | $context | |
int | $old | Old revision ID or 0 for current |
int | $new | New revision ID or 0 for current |
bool | $refreshCache | Refresh diff cache |
bool | $unhide | Show deleted revisions |
DifferenceEngine | &$differenceEngine | Difference engine to alter/replace |
@phan-suppress-next-line PhanUndeclaredClassMethod Only for tests
|
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 |
Handler for MakeGlobalVariablesScript hook.
For values that depend on the current page, user or request state.
array | &$vars | Variables to be added into the output |
OutputPage | $out | OutputPage instance calling the hook |
|
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 |
OutputPageBeforeHTML hook handler.
Applies MobileFormatter to mobile viewed content Also enables Related Articles in the footer in the beta mode. Adds inline script to allow opening of sections while JS is still loading
OutputPage | &$out | the OutputPage object to which wikitext is added |
string | &$text | the HTML to be wrapped inside the #mw-content-text element |
|
static |
OutputPageParserOutput hook handler.
OutputPage | $outputPage | the OutputPage object to which wikitext is added |
ParserOutput | $po |
|
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 |
RequestContextCreateSkin hook handler.
IContextSource | $context | The RequestContext object the skin is being created for. |
Skin | null | string | &$skin | A variable reference you may set a Skin instance or string key on to override the skin that will be used for the context. |
|
static |
ResourceLoaderRegisterModules hook handler.
Registers:
ResourceLoader | &$resourceLoader |
|
static |
ResourceLoaderTestModules hook handler.
array | &$testModules | |
ResourceLoader | $resourceLoader |
|
static |
SkinAfterBottomScripts hook handler.
Adds an inline script for lazy loading the images in Grade C browsers.
Skin | $skin | |
string | &$html | bottomScripts text. Append to $text to add additional text/scripts after the stock bottom scripts. |
|
static |
SkinTemplateOutputPageBeforeExec hook handler.
Adds a link to view the current page in 'mobile view' to the desktop footer.
Skin | &$skin | |
QuickTemplate | &$tpl |
|
static |
Hook for SpecialPage_initList in SpecialPageFactory.
array | &$list | list of special page classes |
|
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 |
Removes the responsive image's variants from the parser output if configured to do so and the thumbnail's MIME type isn't whitelisted.
See https://www.mediawiki.org/wiki/Manual:Hooks/ThumbnailBeforeProduceHTML for more detail about the ThumbnailBeforeProduceHTML
hook.
ThumbnailImage | $thumbnail | |
array | &$attribs | The attributes of the DOMElement being contructed to represent the thumbnail |
array | &$linkAttribs | The attributes of the DOMElement being constructed to represent the link to original file |
|
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 | &$wgDefaultUserOptions | 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 |