Introduce stashMwGlobals method to MediaWikiTestCase
[lhc/web/wiklou.git] / docs / hooks.txt
index fd434d4..e7fa89b 100644 (file)
@@ -269,11 +269,19 @@ $reason: the reason for the move (added in 1.13)
 'AbortNewAccount': Return false to cancel explicit account creation.
 $user: the User object about to be created (read-only, incomplete)
 &$msg: out parameter: HTML to display on abort
+&$status: out parameter: Status object to return, replaces the older $msg param (added in 1.23)
+          Create the object with Status::newFatal() to ensure proper API error messages
+          are returned when creating account through API clients.
 
 'AbortTalkPageEmailNotification': Return false to cancel talk page email notification
 $targetUser: the user whom to send talk page email notification
 $title: the page title
 
+'SendWatchlistEmailNotification': Return true to send watchlist email notification
+$targetUser: the user whom to send watchlist email notification
+$title: the page title
+$this: EmailNotification object
+
 'AbortChangePassword': Return false to cancel password change.
 $user: the User object to which the password change is occuring
 $mOldpass: the old password provided by the user
@@ -295,6 +303,15 @@ $article: Article object
 $user: the User object that was created. (Parameter added in 1.7)
 $byEmail: true when account was created "by email" (added in 1.12)
 
+'AddNewAccountApiForm': Allow modifying internal login form when creating an account via API.
+$apiModule: the ApiCreateAccount module calling
+$loginForm: the LoginForm used
+
+'AddNewAccountApiResult': Modify API output when creating a new account via API.
+$apiModule: the ApiCreateAccount module calling
+$loginForm: the LoginForm used
+&$result: associative array for API result data
+
 'AfterFinalPageOutput': At the end of OutputPage::output() but before final
 ob_end_flush() which will send the buffered output to the client. This allows
 for last-minute modification of the output within the buffer by using
@@ -529,6 +546,7 @@ $wikiPage: WikiPage (object) being modified
 Wiki::articleFromTitle().
 $title: Title (object) used to create the article object
 $article: Article (object) that will be returned
+$context: IContextSource (object)
 
 'ArticleInsertComplete': After a new article is created. DEPRECATED, use
 PageContentInsertComplete.
@@ -763,6 +781,7 @@ $block: Block object (which is set to be autoblocking)
 'BlockIp': Before an IP address or user is blocked.
 $block: the Block object about to be saved
 $user: the user _doing_ the block (not the one being blocked)
+&$reason: if the hook is aborted, the error message to be returned in an array
 
 'BlockIpComplete': After an IP address or user is blocked.
 $block: the Block object that was saved
@@ -833,6 +852,15 @@ content model name, but no entry for that model exists in $wgContentHandlers.
 $modeName: the requested content model name
 &$handler: set this to a ContentHandler object, if desired.
 
+'ContentModelCanBeUsedOn': Called to determine whether that content model can
+be used on a given page. This is especially useful to prevent some content models
+to be used in some special location.
+$contentModel: ID of the content model in question
+$title: the Title in question.
+&$ok: Output parameter, whether it is OK to use $contentModel on $title.
+Handler functions that modify $ok should generally return false to prevent further
+hooks from further modifying $ok.
+
 'ConvertContent': Called by AbstractContent::convert when a conversion to another
 content model is requested.
 $content: The Content object to be converted.
@@ -885,8 +913,9 @@ $new: the ?new= param value from the url
 
 'DiffRevisionTools': Override or extend the revision tools available from the
 diff view, i.e. undo, etc.
-$rev: Revision object
+$newRev: Revision object of the "new" revision
 &$links: Array of HTML links
+$oldRev: Revision object of the "old" revision (may be null)
 
 'DiffViewHeader': Called before diff display
 $diff: DifferenceEngine object that's calling
@@ -1582,6 +1611,11 @@ $password: the password being submitted and found wanting
 $retval: a LoginForm class constant with authenticateUserData() return
   value (SUCCESS, WRONG_PASS, etc.).
 
+'LoginPasswordResetMessage': User is being requested to reset their password on login.
+Use this hook to change the Message that will be output on Special:ChangePassword.
+&$msg: Message object that will be shown to the user
+$username: Username of the user who's password was expired.
+
 'LogLine': Processes a single log entry on Special:Log.
 $log_type: string for the type of log entry (e.g. 'move'). Corresponds to
   logging.log_type database field.
@@ -1596,6 +1630,12 @@ $paramArray: Array of parameters that corresponds to logging.log_params field.
 &$revert: string that is displayed in the UI, similar to $comment.
 $time: timestamp of the log entry (added in 1.12)
 
+'LonelyPagesQuery': Allow extensions to modify the query used by
+Special:LonelyPages.
+&$tables: tables to join in the query
+&$conds: conditions for the query
+&$joinConds: join conditions for the query
+
 'MaintenanceRefreshLinksInit': before executing the refreshLinks.php maintenance
 script.
 $refreshLinks: RefreshLinks object
@@ -1637,6 +1677,12 @@ $mediaWiki: The $mediawiki object
 $title: title of the message (string)
 $message: value (string), change it to the message you want to define
 
+'MessageCache::get': When fetching a message. Can be used to override the key
+for customisations. Given and returned message key must be in special format:
+1) first letter must be in lower case according to the content language.
+2) spaces must be replaced with underscores
+&$key: message key (string)
+
 'MessageCacheReplace': When a message page is changed. Useful for updating
 caches.
 $title: name of the page changed.
@@ -1937,6 +1983,12 @@ $form: the PreferencesForm object. This is a ContextSource as well
 $key: the section name
 &$legend: the legend text. Defaults to wfMessage( "prefs-$key" )->text() but may be overridden
 
+'PreferencesFormPreSave': Override preferences being saved
+ $formData: array of user submitted data
+ $form: PreferencesForm object, also a ContextSource
+ $user: User object with preferences to be saved set
+ &$result: boolean indicating success
+
 'PrefixSearchBackend': Override the title prefix search used for OpenSearch and
 AJAX search suggestions. Put results into &$results outparam and return false.
 $ns : array of int namespace keys to search in
@@ -1989,6 +2041,10 @@ IContextSource $context: The RequestContext the skin is being created for.
 &$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.
 
+'ResetPasswordExpiration': Allow extensions to set a default password expiration
+$user: The user having their password expiration reset
+&$newExpire: The new expiration date
+
 'ResetSessionID': Called from wfResetSessionID
 $oldSessionID: old session id
 $newSessionID: new session id
@@ -2157,6 +2213,13 @@ link" tab.
 $sktemplate: SkinTemplate object
 $nav_urls: array of tabs
 
+'SkinTemplateGetLanguageLink': After building the data for a language link from
+which the actual html is constructed.
+&$languageLink: array containing data about the link. The following keys can be
+  modified: href, text, title, class, lang, hreflang. Each of them is a string.
+$languageLinkTitle: Title object belonging to the external language link
+$title: Title object of the page the link belongs to
+
 To alter the structured navigation links in SkinTemplates, there are three
 hooks called in different spots:
 
@@ -2200,6 +2263,11 @@ $dummy: Called when SkinTemplateToolboxEnd is used from a BaseTemplate skin,
   dummy parameter with "$dummy=false" in their code and return without echoing
   any HTML to avoid creating duplicate toolbox items.
 
+'SkinVectorStyleModules': Called when defining the list of module styles to be
+loaded by the Vector skin.
+$skin: SkinVector object
+&$styles: Array of module names whose style will be loaded for the skin
+
 'SoftwareInfo': Called by Special:Version for returning information about the
 software.
 $software: The array of software in format 'name' => 'version'. See
@@ -2401,7 +2469,7 @@ $special: the special page object
 &$tables: array of tables to be queried
 &$join_conds: join conditions for the tables
 &$fields: array of query fields
-$values: array of variables with watchlist options
+$opts: A FormOptions object with watchlist options for the current request
 
 'SpecialWatchlistGetNonRevisionTypes': Called when building sql query for
 SpecialWatchlist. Allows extensions to register custom values they have
@@ -2485,6 +2553,7 @@ $nt: new title
 $user: user who did the move
 $pageid: database ID of the page that's been moved
 $redirid: database ID of the created redirect
+$reason: reason for the move
 
 'TitleReadWhitelist': Called at the end of read permissions checks, just before
 adding the default error message if nothing allows the user to read the page. If