Add TitleIsMovable hook so extensions can create new namespaces in which pages can...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 30 Aug 2011 11:21:24 +0000 (11:21 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 30 Aug 2011 11:21:24 +0000 (11:21 +0000)
docs/hooks.txt
includes/Title.php

index 0ee7e6f..349a87f 100644 (file)
@@ -1800,6 +1800,10 @@ $title: The title in question.
 $title: Title object that is being checked
 $result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page. Hooks may change this value to override the return value of Title::isCssOrJsPage()
 
+'TitleIsMovable': Called when determining if it is possible to move a page
+$title: Title object that is being checked
+$result: Boolean; whether MediaWiki currently thinks this page is movable. Hooks may change this value to override the return value of Title::isMovable()
+
 'TitleIsWikitextPage': Called when determining if a page is a wikitext or should
 be handled by seperate handler (via ArticleViewCustom)
 $title: Title object that is being checked
index 192e9ba..81715ca 100644 (file)
@@ -1786,7 +1786,9 @@ class Title {
         * @return Bool TRUE or FALSE
         */
        public function isMovable() {
-               return MWNamespace::isMovable( $this->getNamespace() ) && $this->getInterwiki() == '';
+               $result = MWNamespace::isMovable( $this->getNamespace() ) && $this->getInterwiki() == '';
+               wfRunHooks( 'TitleIsMovable', array( $this, &$result ) );
+               return $result;
        }
 
        /**