Made UnwatchArticle, UnwatchArticleComplete, WatchArticle and WatchArticleComplete...
[lhc/web/wiklou.git] / docs / hooks.txt
index 2e9e4a7..8302d2e 100644 (file)
@@ -587,9 +587,9 @@ $name: Image name being checked
 Change $bad and return false to override. If an image is "bad", it is not
 rendered inline in wiki pages or galleries in category pages.
 
-'BeforeInitialize': before anything is initialized in performRequestForTitle()
+'BeforeInitialize': before anything is initialized in MediaWiki::performRequest()
 &$title: Title being used for request
-&$article: The associated Article object
+$unused: null
 &$output: OutputPage object
 &$user: User
 $request: WebRequest object
@@ -1221,7 +1221,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 wgMsgExt 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 wfMsgExt and option 'parse'
  - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset
  - wrap String Wrap the message in html (usually something like "<div ...>$1</div>").
  - flags Integer display flags (NO_ACTION_LINK,NO_EXTRA_USER_LINKS)
@@ -1559,6 +1559,11 @@ $out: OutputPage object
 'RecentChange_save': called at the end of RecentChange::save()
 $recentChange: RecentChange object
 
+'RequestContextCreateSkin': Called when RequestContext::getSkin creates a skin instance.
+Can be used by an extension override what skin is used in certain contexts.
+IContextSource $context: The RequestContext the skin is being created for.
+&$skin: A variable reference you may set a Skin instance or string key on to override the skin that will be used for the context.
+
 'ResourceLoaderGetConfigVars': called at the end of
 ResourceLoaderStartUpModule::getConfig(). Use this to export static
 configuration variables to JavaScript. Things that depend on the current
@@ -1574,6 +1579,16 @@ scripts.
 loader request or generating HTML output.
 &$resourceLoader: ResourceLoader object
 
+'ResourceLoaderTestModules': let you add new JavaScript testing modules. This is called after the addition of 'qunit' and MediaWiki testing resources.
+&testModules: array of JavaScript testing modules. The 'qunit' framework, included in core, is fed using tests/qunit/QUnitTestResources.php.
+&ResourceLoader object
+To add a new qunit module named 'myext.tests':
+testModules['qunit']['myext.tests'] = array(
+       'script' => 'extension/myext/tests.js',
+       'dependencies' => <any module dependency you might have>
+);
+For qunit framework, the mediawiki.tests.qunit.testrunner dependency will be added to any module.
+
 'RevisionInsertComplete': called after a revision is inserted into the DB
 &$revision: the Revision
 $data: the data stored in old_text.  The meaning depends on $flags: if external
@@ -1911,6 +1926,13 @@ $user: user who did the move
 $pageid: database ID of the page that's been moved
 $redirid: database ID of the created redirect
 
+'TitleReadWhitelist': called at the end of read permissions checks, just before
+       adding the default error message if nothing allows the user to read the page.
+       If a handler wants a title to *not* be whitelisted, it should also return false.
+$title: Title object being checked against
+$user: Current user object
+&$whitelisted: Boolean value of whether this title is whitelisted
+
 'UndeleteForm::showHistory': called in UndeleteForm::showHistory, after a
 PageArchive object has been created but before any further processing is done.
 &$archive: PageArchive object
@@ -1942,15 +1964,11 @@ $article: article "acted on"
 
 'UnwatchArticle': before a watch is removed from an article
 $user: user watching
-$article: article object to be removed
-
-'UnwatchArticle': after a watch is removed from an article
-$user: user that was watching
-$article: article object removed
+$page: WikiPage object to be removed
 
 'UnwatchArticleComplete': after a watch is removed from an article
 $user: user that watched
-$article: article object that was watched
+$page: WikiPage object that was watched
 
 'UploadForm:initial': before the upload form is generated
 $form: UploadForm object
@@ -2198,11 +2216,11 @@ used to alter the SQL query which gets the list of wanted pages
 
 'WatchArticle': before a watch is added to an article
 $user: user that will watch
-$article: article object to be watched
+$page: WikiPage object to be watched
 
 'WatchArticleComplete': after a watch is added to an article
 $user: user that watched
-$article: article object watched
+$page: WikiPage object watched
 
 'WatchlistEditorBuildRemoveLine': when building remove lines in
        Special:Watchlist/edit