Two new hooks and one new global function from Wikia codebase
[lhc/web/wiklou.git] / docs / hooks.txt
index 6a6cadd..5da995e 100644 (file)
@@ -254,6 +254,7 @@ $old: old title
 $nt: new title
 $user: user who is doing the move
 $err: error message
+$reason: the reason for the move (added in 1.13)
 
 'AbortNewAccount': Return false to cancel account creation.
 $user: the User object about to be created (read-only, incomplete)
@@ -288,6 +289,8 @@ $content: the content (string) of the article
 $article: the article (object) being deleted
 $user: the user (object) deleting the article
 $reason: the reason (string) the article is being deleted
+$error: if the deletion was prohibited, the (raw HTML) error message to display
+  (added in 1.13)
 
 'ArticleDeleteComplete': after an article is deleted
 $article: the article that was deleted
@@ -305,7 +308,7 @@ $article: article (object) being modified
 $title: title (object) used to create the article object
 $article: article (object) that will be returned
 
-'ArticleInsertComplete': After an article is created
+'ArticleInsertComplete': After a new article is created
 $article: Article created
 $user: User creating the article
 $text: New content
@@ -523,11 +526,13 @@ $editor: Edit form (see includes/EditPage.php)
 $text: Contents of the edit box
 $section: Section being edited
 &$error: Error message to return
+$summary: Edit summary for page
 
 'EditFilterMerged': Post-section-merge edit filter
 $editor: EditPage instance (object)
 $text: content of the edit box
 $error: error message to return
+$summary: Edit summary for page
 
 'EditFormPreloadText': Allows population of the edit form when creating new pages
 &$text: Text to preload with
@@ -595,6 +600,10 @@ $from: address of sending user
 $subject: subject of the mail
 $text: text of the mail
 
+'ExtendJSGlobalVars': called right before Skin::makeVariablesScript is executed
+&$vars: variable (or multiple variables) to be added into the output
+               of Skin::makeVariablesScript
+
 'FetchChangesList': When fetching the ChangesList derivative for a particular user
 &$user: User the list is being fetched for
 &$skin: Skin object to be used with the list
@@ -618,6 +627,10 @@ $fileVersions: array of undeleted versions. Empty if all versions were restored
 $user: user who performed the undeletion
 $reason: reason
 
+'GetAutoPromoteGroups': When determining which autopromote groups a user is entitled to be in.
+&$user: user to promote.
+&$promote: groups that will be added.
+
 'GetBlockedStatus': after loading blocking status of an user from the database
 $user: user (object) being checked
 
@@ -724,6 +737,16 @@ $lang: laguage code (string)
 $specialPageAliases: associative array of magic words synonyms
 $lang: laguage code (string)
 
+'LinkerMakeExternalImage': At the end of Linker::makeExternalImage() just before the return
+&$url: the image url
+&alt: the image's alt text
+&$img: the new image HTML (if returning false)
+
+'LinkerMakeExternalLink': At the end of Linker::makeExternalLink() just before the return
+&$url: the link url
+&$text: the link text
+&$link: the new link HTML (if returning false)
+
 'LinksUpdate': At the beginning of LinksUpdate::doUpdate() just before the actual update
 &$linksUpdate: the LinkUpdate object
 
@@ -737,6 +760,14 @@ $lang: laguage code (string)
 
 'LoadExtensionSchemaUpdates': called by maintenance/updaters.inc when upgrading database schema
 
+'LocalFile::getHistory': called before file history query performed
+$file: the file
+$tables: tables
+$fields: select fields
+$conds: conditions
+$opts: query options
+$join_conds: JOIN conditions
+
 'LoginAuthenticateAudit': a login attempt for a valid user account either succeeded or failed.
                           No return data is accepted; this hook is for auditing only.
 $user: the User object being authenticated against
@@ -1082,13 +1113,23 @@ $funct: function called to execute the special page
 'SpecialPage_initList': called when setting up SpecialPage::$mList, use this hook to remove a core special page
 $list: list (array) of core special pages
 
+'SpecialRecentChangesPanel': called when building form options in SpecialRecentChanges
+&$extraOpts: array of added items, to which can be added
+$opts: FormOptions for this request
+
+'SpecialRecentChangesQuery': called when building sql query for SpecialRecentChanges
+&$conds: array of where conditionals for query
+&$tables: array of tables to be queried
+&$join_conds: join conditions for the tables
+$opts: FormOptions for this request
+
 'SpecialSearchNogomatch': called when user clicked the "Go" button but the target doesn't exist
 $title: title object generated from the text entred by the user
 
 'SpecialSearchResults': called before search result display when there are matches
 $term: string of search term
-$titleMatches: empty or SearchResultSet object
-$textMatches: empty or SearchResultSet object
+&$titleMatches: empty or SearchResultSet object
+&$textMatches: empty or SearchResultSet object
 
 'SpecialSearchNoResults': called before search result display when there are no matches
 $term: string of search term
@@ -1188,6 +1229,10 @@ $user: User object
 $user: User to get rights for
 &$rights: Current rights
 
+'UserLoadDefaults': called when loading a default user
+$user: user object
+$name: user name
+
 'UserLoadFromSession': called to authenticate users on external/environmental means
 $user: user object being loaded
 &$result: set this to a boolean value to abort the normal authentification process
@@ -1205,6 +1250,7 @@ $user: the user object that is about to be logged out
 'UserLogoutComplete': after a user has logged out
 $user: the user object _after_ logout (won't have name, ID, etc.)
 $inject_html: Any HTML to inject after the "logged out" message.
+$oldName: name of the user before logout (string)
 
 'UserRights': After a user's group memberships are changed
 $user  : User object that was changed
@@ -1218,6 +1264,11 @@ $talks: array of new talks page(s)
 'UserSaveSettings': called when saving user settings
 $user: User object
 
+'UserSetCookies': called when setting user cookies
+$user: User object
+&$session: session array, will be added to $_SESSION
+&$cookies: cookies array mapping cookie name to its value
+
 'UserSetEmail': called when changing user email address
 $user: User object
 &$email: new email, change this to override new email address
@@ -1240,5 +1291,9 @@ $article: article object watched
 'wgQueryPages': called when initialising $wgQueryPages, use this to add new query pages to be updated with maintenance/updateSpecialPages.php
 $query: $wgQueryPages itself
 
+'wfMessageCacheReplace': called after sidebar memcached key has been deleted, use this to replace core messages by using an extension
+$title: title of the MediaWiki: message page
+$text: text of the MediaWiki: message page
+
 More hooks might be available but undocumented, you can execute
 ./maintenance/findhooks.php to find hidden one.