Follow-up to r58633 and r58628 (lqt): Rename Title::getProtectionTypes to Title:...
[lhc/web/wiklou.git] / docs / hooks.txt
index 7ab916d..45757b0 100644 (file)
@@ -282,7 +282,7 @@ fail, returning an error message or an <edit result="Failure"> tag
 if $resultArr was filled.
 $EditPage : the EditPage object
 $text : the new text of the article (has yet to be saved)
-$resultArr : data in this array will be added to the API result
+&$resultArr : data in this array will be added to the API result
 
 'APIGetAllowedParams': use this hook to modify a module's parameters.
 &$module: Module object
@@ -350,6 +350,12 @@ the database
 $article: the article (object) being loaded from the database
 $content: the content (string) of the article
 
+'ArticleConfirmDelete': before writing the confirmation form for article
+       deletion
+$article: the article (object) being deleted
+$output: the OutputPage object ($wgOut)
+&$reason: the reason (string) the article is being deleted
+
 'ArticleDelete': before an article is deleted
 $article: the article (object) being deleted
 $user: the user (object) deleting the article
@@ -547,6 +553,11 @@ $user: the user who did the block (not the one being blocked)
 $isbn: ISBN to show information for
 $output: OutputPage object in use
 
+'CacheHeadersAfterSet': after cache headers have been set in 
+OutputPage::sendCacheControl, so they can be overridden without 
+disabling output method
+$this: OutputPage instance
 'CategoryPageView': before viewing a categorypage in CategoryPage::view
 $catpage: CategoryPage instance
 
@@ -558,6 +569,9 @@ $catpage: CategoryPage instance
 $unpatrolled:  Whether or not we are showing unpatrolled changes.
 $watched:      Whether or not the change is watched by the user.
 
+'ConfirmEmailComplete': Called after a user's email has been confirmed successfully
+$user: user (object) whose email is being confirmed
+
 'ContribsPager::getQueryInfo': Before the contributions query is about to run
 &$pager: Pager object for contributions
 &queryInfo: The query for the contribs Pager
@@ -621,7 +635,7 @@ $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
+&$error: error message to return
 $summary: Edit summary for page
 
 'EditFormPreloadText': Allows population of the edit form when creating
@@ -631,7 +645,7 @@ new pages
 
 'EditPage::attemptSave': called before an article is
 saved, that is before insertNewArticle() is called
-&$editpage_Obj: the current EditPage object
+$editpage_Obj: the current EditPage object
 
 'EditPage::importFormData': allow extensions to read additional data
 posted in the form
@@ -773,6 +787,11 @@ $title: Title object of page
 $url: string value as output (out parameter, can modify)
 $query: query options passed to Title::getLocalURL()
 
+'getOtherBlockLogLink': Get links to the block log from extensions which blocks
+       users and/or IP addresses too
+$otherBlockLink: An array with links to other block logs
+$$this->ip: The requested IP address or username
+
 'GetPreferences': modify user preferences
 $user: User whose preferences are being modified.
 &$preferences: Preferences description array, to be fed to an HTMLForm object
@@ -815,6 +834,11 @@ $title: Title object, pages linked to this title are purged.
 $imagePage: ImagePage object ($this)
 $output: $wgOut
 
+'ImagePageAfterImageLinks': called after the image links section on an image 
+       page is built
+$imagePage: ImagePage object ($this)
+&$html: HTML for the hook to add
+
 'ImagePageFileHistoryLine': called when a file history line is contructed
 $file: the file
 $line: the HTML of the history line
@@ -825,6 +849,24 @@ $page: ImagePage object
 &$file: File object
 &$displayFile: displayed File object
 
+'ImagePageShowTOC': called when the file toc on an image page is generated
+$page: ImagePage object
+&$toc: Array of <li> strings
+
+'ImgAuthBeforeStream': executed before file is streamed to user, but only when
+       using img_auth.php
+&$title: the Title object of the file as it would appear for the upload page
+&$path: the original file and path name when img_auth was invoked by the the web
+       server
+&$name: the name only component of the file
+&$result: The location to pass back results of the hook routine (only used if
+       failed)
+       $result[0]=The index of the header message
+       $result[1]=The index of the body text message
+       $result[2 through n]=Parameters passed to body text message. Please note the
+       header message cannot receive/use parameters.
+
+
 'InitializeArticleMaybeRedirect': MediaWiki check to see if title is a redirect
 $title: Title object ($wgTitle)
 $request: WebRequest
@@ -838,6 +880,9 @@ but after noinclude/includeonly/onlyinclude and other processing.
 &$text: string containing partially parsed text
 &$this->mStripState: Parser's internal StripState object
 
+'InvalidateEmailComplete': Called after a user's email has been invalidated successfully
+$user: user (object) whose email is being invalidated
+
 'IsFileCacheable': Override the result of Article::isFileCacheable() (if true)
 $article: article (object) being checked
 
@@ -852,7 +897,7 @@ $addr: The e-mail address entered by the user
 
 'isValidPassword': Override the result of User::isValidPassword()
 $password: The password entered by the user
-&$result: Set this to either true (passes) or the key for a message error
+&$result: Set this and return false to override the internal checks
 $user: User the password is being validated for
 
 'LanguageGetMagic': DEPRECATED, use $magicWords in a file listed in 
@@ -978,7 +1023,8 @@ DEPRECATED: Use $wgLogActions
 &$actionText: array of strings
 
 'MagicWordMagicWords': When defining new magic word.
-DEPRECATED: Use LanguageGetMagic hook instead
+DEPRECATED: use $magicWords in a file listed in 
+$wgExtensionMessagesFiles instead.
 $magicWords: array of strings
 
 'MagicWordwgVariableIDs': When definig new magic words IDs.
@@ -1140,6 +1186,7 @@ $varCache: array to store the value in case of multiples calls of the
        same magic word
 $index: index (string) of the magic
 $ret: value of the magic word (the hook should set it)
+$frame: PPFrame object to use for expanding any template variables
 
 'ParserGetVariableValueTs': use this to change the value of the time for the
 {{LOCAL...}} magic word
@@ -1201,6 +1248,18 @@ $user: User (object) changing his passoword
 $newPass: new password
 $error: error (string) 'badretype', 'wrongpassword', 'error' or 'success'
 
+'ProtectionForm::buildForm': called after all protection type fieldsets are made in the form
+$article: the title being (un)protected
+$output: a string of the form HTML so far
+
+'ProtectionForm::save': called when a protection form is submitted
+$article: the title being (un)protected
+$errorMsg: an html message string of an error
+
+'ProtectionForm::showLogExtract': called after the protection log extract is shown
+$article: the page the form is shown for
+$out: OutputPage object
+
 'RawPageViewBeforeOutput': Right before the text is blown out in action=raw
 &$obj: RawPage object
 &$text: The text that's going to be the output
@@ -1229,11 +1288,21 @@ $term : Search term string
 
 'SetupAfterCache': Called in Setup.php, after cache objects are set
 
+'ShowMissingArticle': Called when generating the output for a non-existent page
+$article: The article object corresponding to the page
+
 'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
 $text: Text being shown
 $title: Title of the custom script/stylesheet page
 $output: Current OutputPage object
 
+'ShowSearchHitTitle': Customise display of search hit title/link.
+&$title: Title to link to
+&$text: Text to use for the link
+$result: The search result
+$terms: The search terms entered
+$page: The SpecialSearch object.
+
 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
 &$siteNotice: HTML returned as the sitenotice
 Return true to allow the normal method of notice selection/rendering to work,
@@ -1368,6 +1437,15 @@ $newTitle: new title (object)
 hook to remove a core special page
 $list: list (array) of core special pages
 
+'SpecialRandomGetRandomTitle': called during the execution of Special:Random,
+use this to change some selection criteria or substitute a different title
+&$randstr: The random number from wfRandom()
+&$isRedir: Boolean, whether to select a redirect or non-redirect 
+&$namespaces: An array of namespace indexes to get the title from
+&$extra: An array of extra SQL statements 
+&$title: If the hook returns false, a Title object to use instead of the
+result from the normal query
+
 'SpecialRecentChangesPanel': called when building form options in
 SpecialRecentChanges
 &$extraOpts: array of added items, to which can be added
@@ -1384,6 +1462,9 @@ $opts: FormOptions for this request
 target doesn't exist
 $title: title object generated from the text entred by the user
 
+'SpecialSearchProfiles': allows modification of search profiles
+&$profiles: profiles, which can be modified.
+
 'SpecialSearchResults': called before search result display when there
 are matches
 $term: string of search term
@@ -1394,9 +1475,13 @@ $term: string of search term
 no matches
 $term: string of search term
 
+'SpecialStatsAddExtra': add extra statistic at the end of Special:Statistics
+&$extraStats: Array to save the new stats 
+              ( $extraStats['<name of statistic>'] => <value>; )
+
 'SpecialUploadComplete': Called after successfully uploading a file from 
 Special:Upload
-$form: The UploadForm object
+$form: The SpecialUpload object
 
 'SpecialVersionExtensionTypes': called when generating the extensions credits,
 use this to change the tables headers
@@ -1413,6 +1498,11 @@ database result
 &$titleArray: set this to an object to override the default object returned
 $res: database result used to create the object
 
+'TitleGetRestrictionTypes': Allows extensions to modify the types of protection
+  that can be applied.
+$title: The title in question.
+&$types: The types of protection available.
+
 'TitleMoveComplete': after moving an article (title)
 $old: old title
 $nt: new title
@@ -1441,16 +1531,20 @@ $article: article object removed
 $user: user that watched
 $article: article object that was watched
 
-'UploadForm:initial': before the upload form is generated
-$form: UploadForm object
-You might set the member-variables $uploadFormTextTop and
-$uploadFormTextAfterSummary to inject text (HTML) either before
-or after the editform.
+'UploadCreateFromRequest': when UploadBase::createFromRequest has been called
+string $type: the requested upload type
+&$className: the class name of the Upload instance to be created
 
-'UploadForm:BeforeProcessing': at the beginning of processUpload()
-$form: UploadForm object
-Lets you poke at member variables like $mUploadDescription before the
-file is saved.
+'UploadComplete': when Upload completes an upload
+&$upload: an UploadBase child instance
+
+'UploadFormInitDescriptor': after the descriptor for the upload form as been 
+assembled
+array $descriptor: the HTMLForm descriptor
+
+'UploadFormSourceDescriptors': after the standard source inputs have been 
+added to the descriptor
+array $descriptor: the HTMLForm descriptor
 
 'UploadVerification': additional chances to reject an uploaded file
 string $saveName: destination file name
@@ -1535,6 +1629,14 @@ $user: User object
 $user: User to get rights for
 &$rights: Current rights
 
+'UserIsBlockedFrom': Check if a user is blocked from a specific page (for specific block
+       exemptions).
+$user: User in question
+$title: Title of the page in question
+&$blocked: Out-param, whether or not the user is blocked from that page.
+&$allowUsertalk: If the user is blocked, whether or not the block allows users to edit their
+                  own user talk pages.
+
 'UserIsBlockedGlobally': Check if user is blocked on all wikis.
 &$user: User object
 $ip: User's IP address