zhtable makefile: Remove unused variables, fix almost all pep8 errors
[lhc/web/wiklou.git] / docs / hooks.txt
index 5e2269a..8d36603 100644 (file)
@@ -575,6 +575,7 @@ $error: if the deletion was prohibited, the (raw HTML) error message to display
   (added in 1.13)
 $status: Status object, modify this to throw an error. Overridden by $error
   (added in 1.20)
+$suppress: Whether this is a suppression deletion or not (added in 1.27)
 
 'ArticleDeleteAfterSuccess': Output after an article has been deleted.
 $title: Title of the article that has been deleted.
@@ -641,16 +642,14 @@ $popts: parser options to be used for pre-save transformation
 'ArticleProtect': Before an article is protected.
 $wikiPage: the WikiPage being protected
 $user: the user doing the protection
-$protect: boolean whether this is a protect or an unprotect
+$protect: Set of restriction keys
 $reason: Reason for protect
-$moveonly: boolean whether this is for move only or not
 
 'ArticleProtectComplete': After an article is protected.
 $wikiPage: the WikiPage that was protected
 $user: the user who did the protection
-$protect: boolean whether it was a protect or an unprotect
+$protect: Set of restriction keys
 $reason: Reason for protect
-$moveonly: boolean whether it was for move only or not
 
 'ArticlePurge': Before executing "&action=purge".
 $wikiPage: WikiPage (object) to purge
@@ -662,7 +661,8 @@ $oldPageID: the page ID of the revision when archived (may be null)
 
 'ArticleRevisionVisibilitySet': Called when changing visibility of one or more
 revisions of an article.
-&$title: Title object of the article
+$title: Title object of the article
+$ids: Ids to set the visibility for
 
 'ArticleRollbackComplete': After an article rollback is completed.
 $wikiPage: the WikiPage that was edited
@@ -1271,20 +1271,21 @@ $user: User being checked
 $confirmed: Whether or not the email address is confirmed
 
 'EmailUser': Before sending email from one user to another.
-$to: address of receiving user
-$from: address of sending user
+$to: MailAddress object of receiving user
+$from: MailAddress object of sending user
 $subject: subject of the mail
 $text: text of the mail
+&$error: Out-param for an error
 
 'EmailUserCC': Before sending the copy of the email to the author.
-$to: address of receiving user
-$from: address of sending user
+$to: MailAddress object of receiving user
+$from: MailAddress object of sending user
 $subject: subject of the mail
 $text: text of the mail
 
 'EmailUserComplete': After sending email from one user to another.
-$to: address of receiving user
-$from: address of sending user
+$to: MailAddress object of receiving user
+$from: MailAddress object of sending user
 $subject: subject of the mail
 $text: text of the mail
 
@@ -1376,6 +1377,9 @@ $auto: The extracted part of the parsed comment before the call to the hook.
 $post: Boolean, true if there is text after this autocomment
 $title: An optional title object used to links to sections. Can be null.
 $local: Boolean indicating whether section links should refer to local page.
+$wikiId: String containing the ID (as used by WikiMap) of the wiki from which the
+  autocomment originated; null for the local wiki. Added in 1.26, should default
+  to null in handler functions, for backwards compatibility.
 
 'GalleryGetModes': Get list of classes that can render different modes of a
 gallery.
@@ -1576,9 +1580,10 @@ $imagePage: ImagePage object ($this)
 &$html: HTML for the hook to add
 
 'ImagePageFileHistoryLine': Called when a file history line is constructed.
+$imagePage: ImagePage object ($this)
 $file: the file
-$line: the HTML of the history line
-$css: the line CSS class
+&$line: the HTML of the history line
+&$css: the line CSS class
 
 'ImagePageFindFile': Called when fetching the file associated with an image
 page.
@@ -1628,6 +1633,11 @@ Return false to stop further processing of the tag
 $reader: XMLReader object
 $revisionInfo: Array of information
 
+'ImportSources': Called when reading from the $wgImportSources configuration
+variable. Can be used to lazy-load the import sources list.
+&$importSources: The value of $wgImportSources. Modify as necessary. See the
+comment in DefaultSettings.php for the detail of how to structure this array.
+
 'InfoAction': When building information to display on the action=info page.
 $context: IContextSource object
 &$pageInfo: Array of information
@@ -1841,6 +1851,10 @@ optional localisation messages
 &$ignored: Array of ignored message keys
 &$optional: Array of optional message keys
 
+'LocalUserCreated': Called when a local user has been created
+$user: User object for the created user
+$autocreated: Boolean, whether this was an auto-creation
+
 'LogEventsListGetExtraInputs': When getting extra inputs to display on
 Special:Log for a specific log type
 $type: String of log type being displayed
@@ -1943,12 +1957,14 @@ $rcid: ID of the revision to be marked patrolled
 $user: the user (object) marking the revision as patrolled
 $wcOnlySysopsCanPatrol: config setting indicating whether the user needs to be a
   sysop in order to mark an edit patrolled.
+$auto true if the edit is being marked as patrolled automatically
 
 'MarkPatrolledComplete': After an edit is marked patrolled.
 $rcid: ID of the revision marked as patrolled
 $user: user (object) who marked the edit patrolled
 $wcOnlySysopsCanPatrol: config setting indicating whether the user must be a
   sysop to patrol the edit.
+$auto true if the edit is being marked as patrolled automatically
 
 'MediaWikiPerformAction': Override MediaWiki::performAction(). Use this to do
 something completely different, after the basic globals have been set up, but
@@ -2155,9 +2171,10 @@ $article: the article that the history is loading for
 $context: RequestContext object
 
 'PageHistoryLineEnding': Right before the end <li> is added to a history line.
-$row: the revision row for this line
-$s: the string representing this parsed line
-$classes: array containing the <li> element classes
+$historyAction: the action object
+&$row: the revision row for this line
+&$s: the string representing this parsed line
+&$classes: array containing the <li> element classes
 
 'PageHistoryPager::doBatchLookups': Called after the pager query was run, before
 any output is generated, to allow batch lookups for prefetching information
@@ -2176,6 +2193,7 @@ which depends on user options should install this hook and append its values to
 the key.
 &$confstr: reference to a hash key string which can be modified
 $user: User (object) requesting the page
+&$forOptions: array of options the hash is for
 
 'PageViewUpdates': Allow database (or other) changes to be made after a
 page view is seen by MediaWiki.  Note this does not capture views made
@@ -2444,10 +2462,6 @@ $context: (IContextSource) The RequestContext the skin is being created for.
 $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
-
 'ResourceLoaderForeignApiModules': Called from ResourceLoaderForeignApiModule.
 Use this to add dependencies to 'mediawiki.ForeignApi' module when you wish
 to override its behavior. See the module docs for more information.
@@ -2664,8 +2678,10 @@ $out: OutputPage object
 
 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink': After creating the "permanent
 link" tab.
-$sktemplate: SkinTemplate object
-$nav_urls: array of tabs
+&$sktemplate: SkinTemplate object
+&$nav_urls: array of tabs
+&$revid: The revision id of the permanent link
+&$revid2: The revision id of the permanent link, second time
 
 'SkinTemplateGetLanguageLink': After building the data for a language link from
 which the actual html is constructed.
@@ -2894,6 +2910,7 @@ $term: Search term specified by the user
 on the search results page.  Useful for including a feedback link.
 $specialSearch: SpecialSearch object ($this)
 $output: $wgOut
+$term: Search term specified by the user
 
 'SpecialSearchSetupEngine': Allows passing custom data to search engine.
 $search: SpecialSearch special page object
@@ -3105,7 +3122,9 @@ $descriptor: (array) the HTMLForm descriptor
 
 'UploadFormSourceDescriptors': after the standard source inputs have been
 added to the descriptor
-$descriptor: (array) the HTMLForm descriptor
+&$descriptor: (array) the HTMLForm descriptor
+&$radio: Boolean, if source type should be shown as radio button
+$selectedSourceType: The selected source type
 
 'UploadVerification': Additional chances to reject an uploaded file. Consider
 using UploadVerifyFile instead.
@@ -3200,6 +3219,12 @@ $context: IContextSource object
 $user: User to get rights for
 &$rights: Current rights
 
+'UserGroupsChanged': Called after user groups are changed.
+$user: User whose groups changed
+$added: Groups added
+$removed: Groups removed
+$performer: User who performed the change, false if via autopromotion
+
 'UserIsBlockedFrom': Check if a user is blocked from a specific page (for
 specific block exemptions).
 $user: User in question
@@ -3217,6 +3242,14 @@ $ip: User's IP address
 false if a UserGetRights hook might remove the named right.
 $right: The user right being checked
 
+'UserIsHidden': Check if the user's name should be hidden. See User::isHidden().
+$user: User in question.
+&$hidden: Set true if the user's name should be hidden.
+
+'UserIsLocked': Check if the user is locked. See User::isLocked().
+$user: User in question.
+&$locked: Set true if the user should be locked.
+
 'UserLoadAfterLoadFromSession': Called to authenticate users on external or
 environmental means; occurs after session is loaded.
 $user: user object being loaded
@@ -3240,6 +3273,9 @@ database.
 $user: User object
 &$options: Options, can be modified.
 
+'UserLoggedIn': Called after a user is logged in
+$user: User object for the logged-in user
+
 'UserLoginComplete': After a user has logged in.
 $user: the user object that was created on login
 $inject_html: Any HTML to inject after the "logged in" message.
@@ -3260,6 +3296,26 @@ when UserMailer sends an email, with a bounce handling extension.
 $to: Array of MailAddress objects for the recipients
 &$returnPath: The return address string
 
+'UserMailerSplitTo': Called in UserMailer::send() to give extensions a chance
+to split up an email with multiple the To: field into separate emails.
+$to: array of MailAddress objects; unset the ones which should be mailed separately
+
+'UserMailerTransformContent': Called in UserMailer::send() to change email contents.
+Extensions can block sending the email by returning false and setting $error.
+$to: array of MailAdresses of the targets
+$from: MailAddress of the sender
+&$body: email body, either a string (for plaintext emails) or an array with 'text' and 'html' keys
+&$error: should be set to an error message string
+
+'UserMailerTransformMessage': Called in UserMailer::send() to change email after it has gone through
+the MIME transform. Extensions can block sending the email by returning false and setting $error.
+$to: array of MailAdresses of the targets
+$from: MailAddress of the sender
+&$subject: email subject (not MIME encoded)
+&$headers: email headers (except To: and Subject:) as an array of header name => value pairs
+&$body: email body (in MIME format) as a string
+&$error: should be set to an error message string
+
 'UserRemoveGroup': Called when removing a group; return false to override stock
 group removal.
 $user: the user object that is to have a group removed
@@ -3285,8 +3341,9 @@ message(s).
 $user: user retrieving new talks messages
 $talks: array of new talks page(s)
 
-'UserRights': After a user's group memberships are changed.
-$user: User object that was changed
+'UserRights': DEPRECATED! Use UserGroupsChanged instead.
+After a user's group memberships are changed.
+&$user: User object that was changed
 $add: Array of strings corresponding to groups added
 $remove: Array of strings corresponding to groups removed