Merge "Removed useless begin()/commit() calls as DBO_TRX is not on in cli mode."
[lhc/web/wiklou.git] / docs / hooks.txt
index 2862d1b..96757cd 100644 (file)
@@ -290,6 +290,12 @@ $revCount: Number of revisions in the XML file
 $sRevCount: Number of sucessfully imported revisions
 $pageInfo: associative array of page information
 
+'AfterFinalPageOutput': Nearly at the end of OutputPage::output() but
+before OutputPage::sendCacheControl() and 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 ob_get_clean().
+$output: The OutputPage object where output() was called
+
 'AjaxAddScript': Called in output page just before the initialisation
 of the javascript ajax engine. The hook is only called when ajax
 is enabled ( $wgUseAjax = true; ).
@@ -314,6 +320,14 @@ $body: Body of the message
 Use this to extend core API modules.
 &$module: Module object
 
+'ApiCheckCanExecute': Called during ApiMain::checkCanExecute. Use to
+further authenticate and authorize API clients before executing the
+module. Return false and set a message to cancel the request.
+$module: Module object
+$user: Current user
+&$message: API usage message to die with, as a message key or array
+as accepted by ApiBase::dieUsageMsg.
+
 'APIEditBeforeSave': before saving a page with api.php?action=edit,
 after processing request parameters. Return false to let the request
 fail, returning an error message or an <edit result="Failure"> tag
@@ -397,6 +411,11 @@ is the User object. In the hook, just add your callback to the
 $tokenFunctions array and return true (returning false makes no sense)
 $tokenFunctions: array(action => callback)
 
+'ApiMain::onException': Called by ApiMain::executeActionWithErrorHandling()
+when an exception is thrown during API action execution.
+$apiMain: Calling ApiMain instance.
+$e: Exception object.
+
 'ApiRsdServiceApis': Add or remove APIs from the RSD services list.
 Each service should have its own entry in the $apis array and have a
 unique name, passed as key for the array that represents the service data.
@@ -468,7 +487,7 @@ $summary: Edit summary/comment
 $isMinor: Whether or not the edit was marked as minor
 $isWatch: (No longer used)
 $section: (No longer used)
-$flags: Flags passed to Article::doEdit()
+$flags: Flags passed to WikiPage::doEdit()
 $revision: New Revision of the article
 
 'ArticleMergeComplete': after merging to article using Special:Mergehistory
@@ -536,7 +555,7 @@ $summary: Edit summary/comment
 $isMinor: Whether or not the edit was marked as minor
 $isWatch: (No longer used)
 $section: (No longer used)
-$flags: Flags passed to Article::doEdit()
+$flags: Flags passed to WikiPage::doEdit()
 $revision: New Revision of the article
 $status: Status object about to be returned by doEdit()
 $baseRevId: the rev ID (or false) this edit was based on
@@ -763,11 +782,11 @@ $title: Title object for the title being linked to (may not be the same as
   $wgTitle, if the section is included from a template)
 $section: The designation of the section being pointed to, to be included in
   the link, like "&section=$section"
-$tooltip: The default tooltip.  Escape with htmlspecialchars() before using.
+$tooltip: The default tooltip.  Escape before using.
   By default, this is wrapped in the 'editsectionhint' message.
 &$result: The HTML to return, prefilled with the default plus whatever other
   changes earlier hooks have made
-$lang: The language code to use for the link in the wfMsg* functions
+$lang: The language code to use for the link in the wfMessage function
 
 'EditFilter': Perform checks on an edit
 $editor: Edit form (see includes/EditPage.php)
@@ -792,7 +811,7 @@ pages
 $editPage: EditPage    object
 
 'EditPage::attemptSave': called before an article is
-saved, that is before Article::doEdit() is called
+saved, that is before WikiPage::doEdit() is called
 $editpage_Obj: the current EditPage object
 
 'EditPage::importFormData': allow extensions to read additional data
@@ -868,7 +887,7 @@ $title: Title being linked to
 $section: Section to link to
 $link: Default link
 &$result: Result (alter this to override the generated links)
-$lang: The language code to use for the link in the wfMsg* functions
+$lang: The language code to use for the link in the wfMessage function
 
 'EmailConfirmed': When checking that the user's email address is "confirmed"
 $user: User being checked
@@ -1283,7 +1302,7 @@ $param: Associative Array with the following additional options:
  - lim Integer Limit of items to show, default is 50
  - conds Array Extra conditions for the query (e.g. "log_action != 'revision'")
  - showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty if set to true (default), "No matching items in log" is displayed if loglist is empty
- - msgKey Array If you want a nice box with a message, set this to the key of the message. First element is the message key, additional optional elements are parameters for the key that are processed with wfMsgExt and option 'parse'
+ - msgKey Array If you want a nice box with a message, set this to the key of the message. First element is the message key, additional optional elements are parameters for the key that are processed with wfMessage()->params()->parseAsBlock()
  - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset
  - wrap String Wrap the message in html (usually something like "&lt;div ...>$1&lt;/div>").
  - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
@@ -1592,7 +1611,7 @@ Return false and put the merged text into $text to override the default behavior
 'PreferencesGetLegend': Override the text used for the <legend> of a preferences section
 $form: the PreferencesForm object. This is a ContextSource as well
 $key: the section name
-&$legend: the legend text. Defaults to wfMsg( "prefs-$key" ) but may be overridden
+&$legend: the legend text. Defaults to wfMessage( "prefs-$key" )->text() but may be overridden
 
 'PrefixSearchBackend': Override the title prefix search used for OpenSearch and
 AJAX search suggestions. Put results into &$results outparam and return false.
@@ -1698,6 +1717,11 @@ in the $searchEngine->namespaces array.
 $query : Original query.
 &$parsed : Resultant query with the prefixes stripped.
 
+'SearchResultInitFromTitle': Set the revision used when displaying a page in
+search results.
+$title : Current Title object being displayed in search results.
+&$id: Revision ID (default is false, for latest)
+
 'SearchableNamespaces': An option to modify which namespaces are searchable.
 &$arr : Array of namespaces ($nsId => $name) which will be used.