http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95753

Revision: 95753
Author:   catrope
Date:     2011-08-30 11:21:24 +0000 (Tue, 30 Aug 2011)
Log Message:
-----------
Add TitleIsMovable hook so extensions can create new namespaces in which pages 
can't be moved. RL2 needs this for the Gadgets_definition namespace

Modified Paths:
--------------
    trunk/phase3/docs/hooks.txt
    trunk/phase3/includes/Title.php

Modified: trunk/phase3/docs/hooks.txt
===================================================================
--- trunk/phase3/docs/hooks.txt 2011-08-30 11:06:59 UTC (rev 95752)
+++ trunk/phase3/docs/hooks.txt 2011-08-30 11:21:24 UTC (rev 95753)
@@ -1800,6 +1800,10 @@
 $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

Modified: trunk/phase3/includes/Title.php
===================================================================
--- trunk/phase3/includes/Title.php     2011-08-30 11:06:59 UTC (rev 95752)
+++ trunk/phase3/includes/Title.php     2011-08-30 11:21:24 UTC (rev 95753)
@@ -1786,7 +1786,9 @@
         * @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;
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to