Merge "Genderize Special:Preferences"
[lhc/web/wiklou.git] / docs / hooks.txt
index 94cf08e..c53baef 100644 (file)
@@ -310,6 +310,15 @@ before showing the edit form ( EditPage::edit() ). This is triggered
 on &action=edit.
 $EditPage: the EditPage object
 
+'AlternateEditPreview': before generating the preview of the page when editing
+( EditPage::getPreviewText() ).
+$EditPage: the EditPage object
+&$content: the Content object for the text field from the edit page
+&$previewHTML: Text to be placed into the page for the preview
+&$parserOutput: the ParserOutput object for the preview
+return false and set $previewHTML and $parserOutput to output custom page
+preview HTML.
+
 'AlternateUserMailer': Called before mail is sent so that mail could
 be logged (or something else) instead of using PEAR or PHP's mail().
 Return false to skip the regular method of sending mail.  Return a
@@ -455,7 +464,7 @@ Use this to change the content in this area or how it is loaded.
  $output: the OutputPage object ($wgOut)
 
 'ArticleDelete': before an article is deleted
-$article: the WikiPage (object) being deleted
+$wikiPage: the WikiPage (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
@@ -464,7 +473,7 @@ $status: Status object, modify this to throw an error. Overridden by $error
   (added in 1.20)
 
 'ArticleDeleteComplete': after an article is deleted
-$article: the WikiPage that was deleted
+$wikiPage: the WikiPage that was deleted
 $user: the user that deleted the article
 $reason: the reason the article was deleted
 $id: id of the article that was deleted
@@ -473,18 +482,18 @@ $logEntry: the ManualLogEntry used to record the deletion
 
 'ArticleEditUpdateNewTalk': before updating user_newtalk when a user talk page
 was changed
-$article: WikiPage (object) of the user talk page
+$wikiPage: WikiPage (object) of the user talk page
 
 'ArticleEditUpdates': when edit updates (mainly link tracking) are made when an
 article has been changed
-$article: the WikiPage (object)
+$wikiPage: the WikiPage (object)
 $editInfo: data holder that includes the parser output ($editInfo->output) for
 that page after the change
 $changed: bool for if the page was changed
 
 'ArticleEditUpdatesDeleteFromRecentchanges': before deleting old entries from
 recentchanges table, return false to not delete old entries
-$article: WikiPage (object) being modified
+$wikiPage: WikiPage (object) being modified
 
 'ArticleFromTitle': when creating an article object from a title object using
 Wiki::articleFromTitle()
@@ -492,7 +501,7 @@ $title: title (object) used to create the article object
 $article: article (object) that will be returned
 
 'ArticleInsertComplete': After a new article is created. DEPRECATED, use PageContentInsertComplete
-$article: WikiPage created
+$wikiPage: WikiPage created
 $user: User creating the article
 $text: New content
 $summary: Edit summary/comment
@@ -507,33 +516,33 @@ $targetTitle: target title (object)
 $destTitle: destination title (object)
 
 'ArticlePageDataAfter': after loading data of an article from the database
-$article: WikiPage (object) whose data were loaded
+$wikiPage: WikiPage (object) whose data were loaded
 $row: row (object) returned from the database server
 
 'ArticlePageDataBefore': before loading data of an article from the database
-$article: WikiPage (object) that data will be loaded
+$wikiPage: WikiPage (object) that data will be loaded
 $fields: fileds (array) to load from the database
 
 'ArticlePrepareTextForEdit': called when preparing text to be saved
-$article: the WikiPage being saved
+$wikiPage: the WikiPage being saved
 $popts: parser options to be used for pre-save transformation
 
 'ArticleProtect': before an article is protected
-$article: the WikiPage being protected
+$wikiPage: the WikiPage being protected
 $user: the user doing the protection
 $protect: boolean whether this is a protect or an unprotect
 $reason: Reason for protect
 $moveonly: boolean whether this is for move only or not
 
 'ArticleProtectComplete': after an article is protected
-$article: the WikiPage that was protected
+$wikiPage: the WikiPage that was protected
 $user: the user who did the protection
 $protect: boolean whether it was a protect or an unprotect
 $reason: Reason for protect
 $moveonly: boolean whether it was for move only or not
 
 'ArticlePurge': before executing "&action=purge"
-$article: WikiPage (object) to purge
+$wikiPage: WikiPage (object) to purge
 
 'ArticleRevisionVisibilitySet': called when changing visibility of one or more
 revision of an article
@@ -545,13 +554,13 @@ $revision: the revision
 $oldPageID: the page ID of the revision when archived (may be null)
 
 'ArticleRollbackComplete': after an article rollback is completed
-$article: the WikiPage that was edited
+$wikiPage: the WikiPage that was edited
 $user: the user who did the rollback
 $revision: the revision the page was reverted back to
 $current: the reverted revision
 
 'ArticleSave': before an article is saved. DEPRECATED, use PageContentSave instead
-$article: the WikiPage (object) being saved
+$wikiPage: the WikiPage (object) being saved
 $user: the user (object) saving the article
 $text: the new article text
 $summary: the article summary (comment)
@@ -560,7 +569,7 @@ $iswatch: watch flag
 $section: section #
 
 'ArticleSaveComplete': After an article has been updated. DEPRECATED, use PageContentSaveComplete instead.
-$article: WikiPage modified
+$wikiPage: WikiPage modified
 $user: User performing the modification
 $text: New content
 $summary: Edit summary/comment
@@ -578,6 +587,11 @@ $create: Whether or not the restoration caused the page to be created
 (i.e. it didn't exist before)
 $comment: The comment associated with the undeletion.
 
+'ArticleUndeleteLogEntry': When a log entry is generated but not yet saved.
+$pageArchive: the PageArchive object
+&$logEntry: ManualLogEntry object
+$user: User who is performing the log action
+
 'ArticleUpdateBeforeRedirect': After a page is updated (usually on save),
 before the user is redirected back to the page
 &$article: the article
@@ -748,10 +762,20 @@ $title: the Title in question
 &$model: the model name. Use with CONTENT_MODEL_XXX constants.
 
 'ContentHandlerForModelID': Called when a ContentHandler is requested for a given
-cointent model name, but no entry for that model exists in $wgContentHandlers.
+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.
 
+'ConvertContent': Called by AbstractContent::convert when a conversion to another
+content model is requested.
+$content: The Content object to be converted.
+$toModel: The ID of the content model to convert to.
+$lossy:   boolean indicating whether lossy conversion is allowed.
+&$result: Output parameter, in case the handler function wants to provide a
+converted Content object. Note that $result->getContentModel() must return $toModel.
+Handler functions that modify $result should generally return false to further
+attempts at conversion.
+
 'ContribsPager::getQueryInfo': Before the contributions query is about to run
 &$pager: Pager object for contributions
 &$queryInfo: The query for the contribs Pager
@@ -871,6 +895,13 @@ yourself. Alternatively, modifying $error and returning true will cause the
 contents of $error to be echoed at the top of the edit form as wikitext.
 Return true without altering $error to allow the edit to proceed.
 
+'EditPage::showStandardInputs:options': allows injection of form fields into
+the editOptions area
+$editor: EditPage instance (object)
+$out: an OutputPage instance to write to
+&$tabindex: HTML tabindex of the last edit check/button
+return value is ignored (should always be true)
+
 'EditPageBeforeConflictDiff': allows modifying the EditPage object and output
 when there's an edit conflict.  Return false to halt normal diff output; in
 this case you're responsible for computing and outputting the entire "conflict"
@@ -1471,7 +1502,7 @@ Hooks may change this value to override the return value of MWNamespace::isMovab
 
 'NewRevisionFromEditComplete': called when a revision was inserted
 due to an edit
-$article: the WikiPage edited
+$wikiPage: the WikiPage edited
 $rev: the new revision
 $baseID: the revision ID this was based off, if any
 $user: the editing user
@@ -1533,7 +1564,7 @@ $links: array, intended to hold the result. Must be an associative array with
        category types as keys and arrays of HTML links as values.
 
 'PageContentInsertComplete': After a new article is created
-$article: WikiPage created
+$wikiPage: WikiPage created
 $user: User creating the article
 $content: New content as a Content object
 $summary: Edit summary/comment
@@ -1550,7 +1581,7 @@ $title: Title object
 $wgLang: the user language
 
 'PageContentSave': before an article is saved.
-$article: the WikiPage (object) being saved
+$wikiPage: the WikiPage (object) being saved
 $user: the user (object) saving the article
 $content: the new article content, as a Content object
 $summary: the article summary (comment)
@@ -1559,7 +1590,7 @@ $iswatch: watch flag
 $section: section #
 
 'PageContentSaveComplete': After an article has been updated
-$article: WikiPage modified
+$wikiPage: WikiPage modified
 $user: User performing the modification
 $content: New content, as a Content object
 $summary: Edit summary/comment
@@ -1619,6 +1650,9 @@ $text: actual text
 'ParserClearState': called at the end of Parser::clearState()
 $parser: Parser object being cleared
 
+'ParserCloned': called when the parser is cloned
+$parser: Newly-cloned Parser object
+
 'ParserFirstCallInit': called when the parser initialises for the first time
 &$parser: Parser object being cleared
 
@@ -1791,6 +1825,12 @@ $text : Current text being indexed
 $allSearchTerms : Array of the search terms in all content languages
 &$titleResult : Outparam; the value to return. A Title object or null.
 
+'SearchAfterNoDirectMatch': If there was no match for the exact result. This
+runs before lettercase variants are attempted, whereas 'SearchGetNearMatch'
+runs after.
+$term : Search term string
+&$title : Outparam; set to $title object and return false for a match
+
 'SearchGetNearMatch': An extra chance for exact-title-matches in "go" searches if nothing was found
 $term : Search term string
 &$title : Outparam; set to $title object and return false for a match
@@ -1831,6 +1871,21 @@ $result: The search result
 $terms: The search terms entered
 $page: The SpecialSearch object.
 
+'ShowSearchHit': Customize display of search hit.
+$searchPage: The SpecialSearch instance.
+$result: The SearchResult to show
+$terms: Search terms, for highlighting
+&$link: HTML of link to the matching page. May be modified.
+&$redirect: HTML of redirect info. May be modified.
+&$section: HTML of matching section. May be modified.
+&$extract: HTML of content extract. May be modified.
+&$score: HTML of score. May be modified.
+&$size: HTML of page size. May be modified.
+&$date: HTML of of page modification date. May be modified.
+&$related: HTML of additional info for the matching page. May be modified.
+&$html: May be set to the full HTML that should be used to represent the search hit. Must include
+the <li> ... </li> tags. Will only be used if the hook function returned false.
+
 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
 &$siteNotice: HTML returned as the sitenotice
 $skin: Skin object
@@ -2076,6 +2131,10 @@ $form: The SpecialUpload object
 use this to change the tables headers
 $extTypes: associative array of extensions types
 
+'SpecialVersionVersionUrl': called when building the URL for Special:Version
+$wgVersion: Current $wgVersion for you to use
+&$versionUrl: Raw url to link to (eg: release notes)
+
 'SpecialWatchlistFilters': called after building form options at Watchlist
 $special: the special page object
 &$filters: associative array of filter definitions. The keys are the HTML name/URL parameters.
@@ -2173,6 +2232,9 @@ $page: WikiPage object to be removed
 $user: user that watched
 $page: WikiPage object that was watched
 
+'UpdateUserMailerFormattedPageStatus': before notification email gets sent
+$formattedPageStatus: list of valid page states
+
 'UploadForm:initial': before the upload form is generated
 $form: UploadForm object
 You might set the member-variables $uploadFormTextTop and