From 94fc70a48c4fd95eb301b230c496624c9dbf8f51 Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Fri, 11 May 2012 16:32:52 +0200 Subject: [PATCH] exclude immovable namespaces from the namespace selector on Special:MovePage Change-Id: Icd5645921e95bfd4b3a04c40d4b9bba3600d2f07 --- includes/specials/SpecialMovepage.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 6b817d2804..a512ee6387 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -246,6 +246,14 @@ class MovePageForm extends UnlistedSpecialPage { // Byte limit (not string length limit) for wpReason and wpNewTitleMain // is enforced in the mediawiki.special.movePage module + $immovableNamespaces = array(); + + foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) { + if ( !MWNamespace::isMovable( $nsId ) ) { + $immovableNamespaces[] = $nsId; + } + } + $out->addHTML( Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) . Xml::openElement( 'fieldset' ) . @@ -265,7 +273,10 @@ class MovePageForm extends UnlistedSpecialPage { " " . Html::namespaceSelector( - array( 'selected' => $newTitle->getNamespace() ), + array( + 'selected' => $newTitle->getNamespace(), + 'exclude' => $immovableNamespaces + ), array( 'name' => 'wpNewTitleNs', 'id' => 'wpNewTitleNs' ) ) . Xml::input( 'wpNewTitleMain', 60, $wgContLang->recodeForEdit( $newTitle->getText() ), array( -- 2.20.1