From: Roan Kattouw Date: Tue, 30 Aug 2011 11:21:24 +0000 (+0000) Subject: Add TitleIsMovable hook so extensions can create new namespaces in which pages can... X-Git-Tag: 1.31.0-rc.0~28018 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=89a7657063b1fb6696d08eb283f706eb76300a91;p=lhc%2Fweb%2Fwiklou.git Add TitleIsMovable hook so extensions can create new namespaces in which pages can't be moved. RL2 needs this for the Gadgets_definition namespace --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 0ee7e6f7c4..349a87f319 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/Title.php b/includes/Title.php index 192e9ba64c..81715ca7e3 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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; } /**