MediaWiki REL1_40
|
This class provides an implementation of the hook interfaces used by the core Action API, forwarding hook calls to HookContainer for dispatch to extensions. More...
Inherits MediaWiki\Api\Hook\APIAfterExecuteHook, MediaWiki\Api\Hook\ApiCheckCanExecuteHook, MediaWiki\Api\Hook\ApiDeprecationHelpHook, MediaWiki\Api\Hook\ApiFeedContributions__feedItemHook, MediaWiki\Api\Hook\ApiFormatHighlightHook, MediaWiki\Api\Hook\APIGetAllowedParamsHook, MediaWiki\Api\Hook\APIGetDescriptionMessagesHook, MediaWiki\Api\Hook\APIGetParamDescriptionMessagesHook, MediaWiki\Api\Hook\APIHelpModifyOutputHook, MediaWiki\Api\Hook\ApiMain__moduleManagerHook, MediaWiki\Api\Hook\ApiMain__onExceptionHook, MediaWiki\Api\Hook\ApiMakeParserOptionsHook, MediaWiki\Api\Hook\ApiMaxLagInfoHook, MediaWiki\Api\Hook\ApiOpenSearchSuggestHook, MediaWiki\Api\Hook\ApiOptionsHook, MediaWiki\Api\Hook\ApiParseMakeOutputPageHook, MediaWiki\Api\Hook\APIQueryAfterExecuteHook, MediaWiki\Api\Hook\ApiQueryBaseAfterQueryHook, MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook, MediaWiki\Api\Hook\ApiQueryBaseProcessRowHook, MediaWiki\Api\Hook\APIQueryGeneratorAfterExecuteHook, MediaWiki\Api\Hook\APIQuerySiteInfoGeneralInfoHook, MediaWiki\Api\Hook\APIQuerySiteInfoStatisticsInfoHook, MediaWiki\Api\Hook\ApiQueryTokensRegisterTypesHook, MediaWiki\Api\Hook\ApiQueryWatchlistExtractOutputDataHook, MediaWiki\Api\Hook\ApiQueryWatchlistPrepareWatchedItemQueryServiceOptionsHook, MediaWiki\Api\Hook\ApiQuery__moduleManagerHook, MediaWiki\Api\Hook\ApiRsdServiceApisHook, MediaWiki\Api\Hook\ApiValidatePasswordHook, MediaWiki\Api\Hook\RequestHasSameOriginSecurityHook, MediaWiki\Hook\EditFormPreloadTextHook, MediaWiki\Hook\FileUndeleteCompleteHook, MediaWiki\Hook\GetLinkColoursHook, MediaWiki\Hook\ImportSourcesHook, MediaWiki\Hook\LanguageLinksHook, MediaWiki\Hook\OutputPageBeforeHTMLHook, MediaWiki\Hook\OutputPageCheckLastModifiedHook, MediaWiki\Hook\UserLoginCompleteHook, MediaWiki\Hook\UserLogoutCompleteHook, and MediaWiki\SpecialPage\Hook\ChangeAuthenticationDataAuditHook.
Public Member Functions | |
__construct (HookContainer $container) | |
onAPIAfterExecute ( $module) | |
This hook is called after calling the execute() method of an API module. | |
onApiCheckCanExecute ( $module, $user, &$message) | |
This hook is called during ApiMain::checkCanExecute. | |
onApiDeprecationHelp (&$msgs) | |
Use this hook to add messages to the 'deprecation-help' warning generated from ApiBase::addDeprecation(). | |
onApiFeedContributions__feedItem ( $row, $context, &$feedItem) | |
Use this hook to convert the result of ContribsPager into a MediaWiki\Feed\FeedItem instance that ApiFeedContributions can consume. | |
onApiFormatHighlight ( $context, $text, $mime, $format) | |
Use this hook to syntax-highlight API pretty-printed output. | |
onAPIGetAllowedParams ( $module, &$params, $flags) | |
Use this hook to modify a module's parameters. | |
onAPIGetDescriptionMessages ( $module, &$msg) | |
Use this hook to modify a module's help message. | |
onAPIGetParamDescriptionMessages ( $module, &$msg) | |
Use this hook to modify a module's parameter descriptions. | |
onAPIHelpModifyOutput ( $module, &$help, $options, &$tocData) | |
Use this hook to modify an API module's help output. | |
onApiMain__moduleManager ( $moduleManager) | |
This hook is called when ApiMain has finished initializing its module manager. | |
onApiMain__onException ( $apiMain, $e) | |
This hook is called by ApiMain::executeActionWithErrorHandling() when an exception is thrown during API action execution. | |
onApiMakeParserOptions ( $options, $title, $params, $module, &$reset, &$suppressCache) | |
This hook is called from ApiParse and ApiExpandTemplates to allow extensions to adjust the ParserOptions before parsing. | |
onApiMaxLagInfo (&$lagInfo) | |
This hook is called when lag information is being requested via API. | |
onApiOpenSearchSuggest (&$results) | |
This hook is called when constructing the OpenSearch results. | |
onApiOptions ( $apiModule, $user, $changes, $resetKinds) | |
This hook is called by action=options before applying changes to user preferences. | |
onApiParseMakeOutputPage ( $module, $output) | |
This hook is called when preparing the OutputPage object for ApiParse. | |
onApiQuery__moduleManager ( $moduleManager) | |
This hook is called when ApiQuery has finished initializing its module manager. | |
onAPIQueryAfterExecute ( $module) | |
This hook is called after calling the execute() method of an action=query submodule. | |
onApiQueryBaseAfterQuery ( $module, $result, &$hookData) | |
This hook is called for (some) API query modules after the database query has returned. | |
onApiQueryBaseBeforeQuery ( $module, &$tables, &$fields, &$conds, &$query_options, &$join_conds, &$hookData) | |
This hook is called for (some) API query modules before a database query is made. | |
onApiQueryBaseProcessRow ( $module, $row, &$data, &$hookData) | |
This hook is called for (some) API query modules as each row of the database result is processed. | |
onAPIQueryGeneratorAfterExecute ( $module, $resultPageSet) | |
This hook is called after calling the executeGenerator() method of an action=query submodule. | |
onAPIQuerySiteInfoGeneralInfo ( $module, &$results) | |
Use this hook to add extra information to the site's general information. | |
onAPIQuerySiteInfoStatisticsInfo (&$results) | |
Use this hook to add extra information to the site's statistics information. | |
onApiQueryTokensRegisterTypes (&$salts) | |
Use this hook to add additional token types to action=query&meta=tokens. | |
onApiQueryWatchlistExtractOutputData ( $module, $watchedItem, $recentChangeInfo, &$vals) | |
Use this hook to extract row data for ApiQueryWatchlist. | |
onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions ( $module, $params, &$options) | |
Use this hook to populate the options to be passed from ApiQueryWatchlist to WatchedItemQueryService. | |
onApiRsdServiceApis (&$apis) | |
Use this hook to add or remove APIs from the RSD services list. | |
onApiValidatePassword ( $module, &$r) | |
This hook is called from ApiValidatePassword. | |
onChangeAuthenticationDataAudit ( $req, $status) | |
This hook is called when a user changes their password. | |
onEditFormPreloadText (&$text, $title) | |
Use this hook to populate the edit form when creating pages. | |
onFileUndeleteComplete ( $title, $fileVersions, $user, $reason) | |
This hook is called when a file is undeleted. | |
onGetLinkColours ( $pagemap, &$classes, $title) | |
Use this hook to modify the CSS class of an array of page links. | |
onImportSources (&$importSources) | |
This hook is called when reading from the $wgImportSources configuration variable. | |
onLanguageLinks ( $title, &$links, &$linkFlags) | |
Use this hook to manipulate a page's language links. | |
onOutputPageBeforeHTML ( $out, &$text) | |
This hook is called when a page has been processed by the parser and the resulting HTML is about to be displayed. | |
onOutputPageCheckLastModified (&$modifiedTimes, $out) | |
This hook is called when checking if the page has been modified since the last visit. | |
onRequestHasSameOriginSecurity ( $request) | |
Use this hook to determine if the request is somehow flagged to lack same-origin security. | |
onUserLoginComplete ( $user, &$inject_html, $direct) | |
Use this hook to show custom content after a user has logged in via the web interface. | |
onUserLogoutComplete ( $user, &$inject_html, $oldName) | |
This hook is called after a user has logged out. | |
This class provides an implementation of the hook interfaces used by the core Action API, forwarding hook calls to HookContainer for dispatch to extensions.
To get an instance, use ApiBase::getHookRunner().
Definition at line 14 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::__construct | ( | HookContainer | $container | ) |
Definition at line 59 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIAfterExecute | ( | $module | ) |
This hook is called after calling the execute() method of an API module.
Use this hook to extend core API modules.
ApiBase | $module |
Implements MediaWiki\Api\Hook\APIAfterExecuteHook.
Definition at line 63 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiCheckCanExecute | ( | $module, | |
$user, | |||
& | $message ) |
This hook is called during ApiMain::checkCanExecute.
Use this hook to further authenticate and authorize API clients before executing the module.
ApiBase | $module | |
User | $user | Current user |
IApiMessage | Message | string | array | &$message | API message to die with. Specific values accepted depend on the MediaWiki version:
|
Implements MediaWiki\Api\Hook\ApiCheckCanExecuteHook.
Definition at line 70 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiDeprecationHelp | ( | & | $msgs | ) |
Use this hook to add messages to the 'deprecation-help' warning generated from ApiBase::addDeprecation().
Message[] | &$msgs | Messages to include in the help. Multiple messages will be joined with spaces. |
Implements MediaWiki\Api\Hook\ApiDeprecationHelpHook.
Definition at line 77 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiFeedContributions__feedItem | ( | $row, | |
$context, | |||
& | $feedItem ) |
Use this hook to convert the result of ContribsPager into a MediaWiki\Feed\FeedItem instance that ApiFeedContributions can consume.
Implementors of this hook may cancel the hook to signal that the item is not viewable in the provided context.
stdClass | $row | A row of data from ContribsPager. The set of data returned by ContribsPager can be adjusted by handling the ContribsPager::reallyDoQuery hook. |
IContextSource | $context | |
\\MediaWiki\\Feed\\FeedItem | null | &$feedItem | Set this to a FeedItem instance if the callback can handle the provided row. This is provided to the hook as a null, if it is non-null then another callback has already handled the hook. |
Implements MediaWiki\Api\Hook\ApiFeedContributions__feedItemHook.
Definition at line 84 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiFormatHighlight | ( | $context, | |
$text, | |||
$mime, | |||
$format ) |
Use this hook to syntax-highlight API pretty-printed output.
IContextSource | $context | |
string | $text | Text to be highlighted |
string | $mime | MIME type of $text |
string | $format | API format code for $text |
Implements MediaWiki\Api\Hook\ApiFormatHighlightHook.
Definition at line 91 of file ApiHookRunner.php.
References $mime.
MediaWiki\Api\ApiHookRunner::onAPIGetAllowedParams | ( | $module, | |
& | $params, | ||
$flags ) |
Use this hook to modify a module's parameters.
ApiBase | $module | |
array | &$params | Array of parameters |
int | $flags | Zero or OR-ed flags like ApiBase::GET_VALUES_FOR_HELP |
Implements MediaWiki\Api\Hook\APIGetAllowedParamsHook.
Definition at line 98 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIGetDescriptionMessages | ( | $module, | |
& | $msg ) |
Use this hook to modify a module's help message.
Implements MediaWiki\Api\Hook\APIGetDescriptionMessagesHook.
Definition at line 105 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIGetParamDescriptionMessages | ( | $module, | |
& | $msg ) |
Use this hook to modify a module's parameter descriptions.
Implements MediaWiki\Api\Hook\APIGetParamDescriptionMessagesHook.
Definition at line 112 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIHelpModifyOutput | ( | $module, | |
& | $help, | ||
$options, | |||
& | $tocData ) |
Use this hook to modify an API module's help output.
ApiBase | $module | |
string[] | &$help | Array of HTML strings to be joined for the output |
array | $options | Array of formatting options passed to ApiHelp::getHelp |
array | &$tocData | If a TOC is being generated, this array has keys as anchors in the page and values as for Linker::generateTOC(). |
Implements MediaWiki\Api\Hook\APIHelpModifyOutputHook.
Definition at line 119 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiMain__moduleManager | ( | $moduleManager | ) |
This hook is called when ApiMain has finished initializing its module manager.
Use this hook to conditionally register API modules.
ApiModuleManager | $moduleManager |
Implements MediaWiki\Api\Hook\ApiMain__moduleManagerHook.
Definition at line 126 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiMain__onException | ( | $apiMain, | |
$e ) |
This hook is called by ApiMain::executeActionWithErrorHandling() when an exception is thrown during API action execution.
Implements MediaWiki\Api\Hook\ApiMain__onExceptionHook.
Definition at line 133 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiMakeParserOptions | ( | $options, | |
$title, | |||
$params, | |||
$module, | |||
& | $reset, | ||
& | $suppressCache ) |
This hook is called from ApiParse and ApiExpandTemplates to allow extensions to adjust the ParserOptions before parsing.
ParserOptions | $options | |
Title | $title | Title to be parsed |
array | $params | Parameter array for the API module |
ApiBase | $module | API module (which is also a ContextSource) |
ScopedCallback | null | &$reset | Set to a ScopedCallback used to reset any hooks after the parse is done |
bool | &$suppressCache | Set true if cache should be suppressed |
Implements MediaWiki\Api\Hook\ApiMakeParserOptionsHook.
Definition at line 140 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onApiMaxLagInfo | ( | & | $lagInfo | ) |
This hook is called when lag information is being requested via API.
Use this hook to override lag information. Generally a hook function should only replace $lagInfo if the new $lagInfo['lag'] is greater than the current $lagInfo['lag'].
array | &$lagInfo | Maximum lag information array. Fields in the array are:
|
You can also add more fields that are returned to the user in the API response.
Implements MediaWiki\Api\Hook\ApiMaxLagInfoHook.
Definition at line 149 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiOpenSearchSuggest | ( | & | $results | ) |
This hook is called when constructing the OpenSearch results.
Hooks can alter or append to the array.
array[] | &$results | Array with integer keys to associative arrays. Keys in associative array:
|
Implements MediaWiki\Api\Hook\ApiOpenSearchSuggestHook.
Definition at line 157 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiOptions | ( | $apiModule, | |
$user, | |||
$changes, | |||
$resetKinds ) |
This hook is called by action=options before applying changes to user preferences.
ApiOptions | $apiModule | Calling ApiOptions object |
User | $user | User object whose preferences are being changed |
array | $changes | Associative array of preference name => value |
string[] | $resetKinds | Array of strings specifying which options kinds to reset See User::resetOptions() and User::getOptionKinds() for possible values. |
Implements MediaWiki\Api\Hook\ApiOptionsHook.
Definition at line 164 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiParseMakeOutputPage | ( | $module, | |
$output ) |
This hook is called when preparing the OutputPage object for ApiParse.
This is mainly intended for calling OutputPage::addContentOverride() or OutputPage::addContentOverrideCallback().
ApiBase | $module | ApiBase (which is also a ContextSource) |
OutputPage | $output |
Implements MediaWiki\Api\Hook\ApiParseMakeOutputPageHook.
Definition at line 171 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQuery__moduleManager | ( | $moduleManager | ) |
This hook is called when ApiQuery has finished initializing its module manager.
Use this hook to conditionally register API query modules.
ApiModuleManager | $moduleManager |
Implements MediaWiki\Api\Hook\ApiQuery__moduleManagerHook.
Definition at line 255 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQueryAfterExecute | ( | $module | ) |
This hook is called after calling the execute() method of an action=query submodule.
Use this hook to extend core API modules.
ApiBase | $module |
Implements MediaWiki\Api\Hook\APIQueryAfterExecuteHook.
Definition at line 178 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryBaseAfterQuery | ( | $module, | |
$result, | |||
& | $hookData ) |
This hook is called for (some) API query modules after the database query has returned.
An API query module wanting to use this hook should see the ApiQueryBase::select() and ApiQueryBase::processRow() documentation.
ApiQueryBase | $module | Module in question |
IResultWrapper | $result | ResultWrapper |
array | &$hookData | Array that was passed to the ApiQueryBaseBeforeQuery hook and will be passed to the ApiQueryBaseProcessRow hook, intended for inter-hook communication |
Implements MediaWiki\Api\Hook\ApiQueryBaseAfterQueryHook.
Definition at line 185 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryBaseBeforeQuery | ( | $module, | |
& | $tables, | ||
& | $fields, | ||
& | $conds, | ||
& | $query_options, | ||
& | $join_conds, | ||
& | $hookData ) |
This hook is called for (some) API query modules before a database query is made.
WARNING: It would be very easy to misuse this hook and break the module! Any joins added must join on a unique key of the target table unless you really know what you're doing. An API query module wanting to use this hook should see the ApiQueryBase::select() and ApiQueryBase::processRow() documentation.
ApiQueryBase | $module | Module in question |
array | &$tables | Array of tables to be queried |
array | &$fields | Array of columns to select |
array | &$conds | Array of WHERE conditionals for query |
array | &$query_options | Array of options for the database request |
array | &$join_conds | Join conditions for the tables |
array | &$hookData | Array that will be passed to the ApiQueryBaseAfterQuery and ApiQueryBaseProcessRow hooks, intended for inter-hook communication. |
Implements MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook.
Definition at line 192 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryBaseProcessRow | ( | $module, | |
$row, | |||
& | $data, | ||
& | $hookData ) |
This hook is called for (some) API query modules as each row of the database result is processed.
An API query module wanting to use this hook should see the ApiQueryBase::select() and ApiQueryBase::processRow() documentation.
ApiQueryBase | $module | Module in question |
stdClass | $row | Database result row |
array | &$data | Array to be included in the ApiResult |
array | &$hookData | Array that was be passed to the ApiQueryBaseBeforeQuery and ApiQueryBaseAfterQuery hooks, intended for inter-hook communication |
Implements MediaWiki\Api\Hook\ApiQueryBaseProcessRowHook.
Definition at line 202 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQueryGeneratorAfterExecute | ( | $module, | |
$resultPageSet ) |
This hook is called after calling the executeGenerator() method of an action=query submodule.
Use this hook to extend core API modules.
ApiBase | $module | |
ApiPageSet | $resultPageSet |
Implements MediaWiki\Api\Hook\APIQueryGeneratorAfterExecuteHook.
Definition at line 209 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQuerySiteInfoGeneralInfo | ( | $module, | |
& | $results ) |
Use this hook to add extra information to the site's general information.
ApiQuerySiteinfo | $module | Current ApiQuerySiteinfo module |
array | &$results | Array of results, add things here |
Implements MediaWiki\Api\Hook\APIQuerySiteInfoGeneralInfoHook.
Definition at line 216 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onAPIQuerySiteInfoStatisticsInfo | ( | & | $results | ) |
Use this hook to add extra information to the site's statistics information.
array | &$results | Array of results, add things here |
Implements MediaWiki\Api\Hook\APIQuerySiteInfoStatisticsInfoHook.
Definition at line 223 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryTokensRegisterTypes | ( | & | $salts | ) |
Use this hook to add additional token types to action=query&meta=tokens.
Note that most modules will probably be able to use the CSRF token instead of creating their own token types.
array | &$salts | [ type => salt to pass to User::getEditToken(), or array of salt and key to pass to Session::getToken() ] |
Implements MediaWiki\Api\Hook\ApiQueryTokensRegisterTypesHook.
Definition at line 230 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryWatchlistExtractOutputData | ( | $module, | |
$watchedItem, | |||
$recentChangeInfo, | |||
& | $vals ) |
Use this hook to extract row data for ApiQueryWatchlist.
ApiQueryWatchlist | $module | |
WatchedItem | $watchedItem | |
array | $recentChangeInfo | Array of recent change info data |
array | &$vals | Associative array of data to be output for the row |
Implements MediaWiki\Api\Hook\ApiQueryWatchlistExtractOutputDataHook.
Definition at line 237 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiQueryWatchlistPrepareWatchedItemQueryServiceOptions | ( | $module, | |
$params, | |||
& | $options ) |
Use this hook to populate the options to be passed from ApiQueryWatchlist to WatchedItemQueryService.
ApiQueryWatchlist | $module | |
array | $params | Array of parameters, as would be returned by $module->extractRequestParams() |
array | &$options | Array of options for WatchedItemQueryService::getWatchedItemsWithRecentChangeInfo() |
Implements MediaWiki\Api\Hook\ApiQueryWatchlistPrepareWatchedItemQueryServiceOptionsHook.
Definition at line 246 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiRsdServiceApis | ( | & | $apis | ) |
Use this hook to add or remove APIs from the RSD services list.
Each service should have its own entry in the $apis array and have a unique name, passed as key for the array that represents the service data. In this data array, the key-value-pair identified by the apiLink key is required.
array | &$apis | Array of services |
Implements MediaWiki\Api\Hook\ApiRsdServiceApisHook.
Definition at line 262 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onApiValidatePassword | ( | $module, | |
& | $r ) |
This hook is called from ApiValidatePassword.
ApiValidatePassword | $module | |
array | &$r | Result array |
Implements MediaWiki\Api\Hook\ApiValidatePasswordHook.
Definition at line 269 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onChangeAuthenticationDataAudit | ( | $req, | |
$status ) |
This hook is called when a user changes their password.
No return data is accepted; this hook is for auditing only.
AuthenticationRequest | $req | Object describing the change (and target user) |
StatusValue | $status | StatusValue with the result of the action |
Implements MediaWiki\SpecialPage\Hook\ChangeAuthenticationDataAuditHook.
Definition at line 276 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onEditFormPreloadText | ( | & | $text, |
$title ) |
Use this hook to populate the edit form when creating pages.
string | &$text | Text to preload with |
Title | $title | Page being created |
Implements MediaWiki\Hook\EditFormPreloadTextHook.
Definition at line 283 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onFileUndeleteComplete | ( | $title, | |
$fileVersions, | |||
$user, | |||
$reason ) |
This hook is called when a file is undeleted.
Title | $title | Title object for the file |
int[] | $fileVersions | Array of undeleted filearchive IDs. Empty if all versions were restored. |
User | $user | User who performed the undeletion |
string | $reason |
Implements MediaWiki\Hook\FileUndeleteCompleteHook.
Definition at line 290 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onGetLinkColours | ( | $linkcolour_ids, | |
& | $colours, | ||
$title ) |
Use this hook to modify the CSS class of an array of page links.
string[] | $linkcolour_ids | Array of prefixed DB keys of the pages linked to, indexed by page_id |
string[] | &$colours | (Output) Array of CSS classes, indexed by prefixed DB keys |
Title | $title | Title of the page being parsed, on which the links will be shown |
Implements MediaWiki\Hook\GetLinkColoursHook.
Definition at line 297 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onImportSources | ( | & | $importSources | ) |
This hook is called when reading from the $wgImportSources configuration variable.
This can be used to lazy-load the import sources list.
array | &$importSources | The value of $wgImportSources. Modify as necessary. See \MediaWiki\MainConfigSchema::ImportSources. |
Implements MediaWiki\Hook\ImportSourcesHook.
Definition at line 304 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onLanguageLinks | ( | $title, | |
& | $links, | ||
& | $linkFlags ) |
Use this hook to manipulate a page's language links.
This hook is called in various places to allow extensions to define the effective language links for a page.
Title | $title | |
string[] | &$links | Array with elements of the form "language:title" in the order that they will be output |
array | &$linkFlags | Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. |
Implements MediaWiki\Hook\LanguageLinksHook.
Definition at line 311 of file ApiHookRunner.php.
References $title.
MediaWiki\Api\ApiHookRunner::onOutputPageBeforeHTML | ( | $out, | |
& | $text ) |
This hook is called when a page has been processed by the parser and the resulting HTML is about to be displayed.
OutputPage | $out | OutputPage object that corresponds to the page |
string | &$text | Text that will be displayed, in HTML |
Implements MediaWiki\Hook\OutputPageBeforeHTMLHook.
Definition at line 318 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onOutputPageCheckLastModified | ( | & | $modifiedTimes, |
$out ) |
This hook is called when checking if the page has been modified since the last visit.
string[] | &$modifiedTimes | Array of timestamps. The following keys are set: page, user, epoch. |
OutputPage | $out | since 1.28 |
Implements MediaWiki\Hook\OutputPageCheckLastModifiedHook.
Definition at line 325 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onRequestHasSameOriginSecurity | ( | $request | ) |
Use this hook to determine if the request is somehow flagged to lack same-origin security.
Note that if the "somehow" involves HTTP headers, you'll probably need to make sure the header is varied on.
WebRequest | $request |
Implements MediaWiki\Api\Hook\RequestHasSameOriginSecurityHook.
Definition at line 332 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onUserLoginComplete | ( | $user, | |
& | $inject_html, | ||
$direct ) |
Use this hook to show custom content after a user has logged in via the web interface.
For functionality that needs to run after any login (API or web) use UserLoggedIn.
User | $user | The user object that was created on login |
string | &$inject_html | Any HTML to inject after the "logged in" message. |
bool | $direct | (bool) The hook is called directly after a successful login. This will only happen once per login. A UserLoginComplete call with direct=false can happen when the user visits the login page while already logged in. |
Implements MediaWiki\Hook\UserLoginCompleteHook.
Definition at line 339 of file ApiHookRunner.php.
MediaWiki\Api\ApiHookRunner::onUserLogoutComplete | ( | $user, | |
& | $inject_html, | ||
$oldName ) |
This hook is called after a user has logged out.
User | $user | the user object after logout (won't have name, ID, etc.) |
string | &$inject_html | Any HTML to inject after the "logged out" message. |
string | $oldName | name of the user before logout (string) |
Implements MediaWiki\Hook\UserLogoutCompleteHook.
Definition at line 346 of file ApiHookRunner.php.