From f267f37320c349cb82ba9f82d347d67f1824582d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 19 Mar 2012 12:30:52 +0000 Subject: [PATCH] Change calls from Xml::namespaceSelector() to Html::namespaceSelector() since the former now throws deprecation warnings... --- includes/specials/SpecialDeletedContributions.php | 13 +++++++++++-- includes/specials/SpecialExport.php | 11 ++++++++++- includes/specials/SpecialImport.php | 11 ++++++++++- includes/specials/SpecialLinkSearch.php | 13 +++++++++++-- includes/specials/SpecialNewpages.php | 11 ++++++++++- includes/specials/SpecialProtectedpages.php | 15 +++++++++++++-- includes/specials/SpecialProtectedtitles.php | 14 +++++++++++--- includes/specials/SpecialWatchlist.php | 13 +++++++++++-- includes/specials/SpecialWhatlinkshere.php | 13 +++++++++++-- 9 files changed, 98 insertions(+), 16 deletions(-) diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 0fe631afb5..64455d4c14 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -492,8 +492,17 @@ class DeletedContributionsPage extends SpecialPage { 'size' => '20', 'required' => '' ) + ( $options['target'] ? array() : array( 'autofocus' ) ) ) . ' '. - Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . ' ' . - Xml::namespaceSelector( $options['namespace'], '' ) . ' ' . + Html::namespaceSelector( + array( + 'selected' => $options['namespace'], + 'all' => '', + 'label' => $this->msg( 'namespace' )->text() + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ) . ' ' . Xml::submitButton( $this->msg( 'sp-contributions-submit' )->text() ) . Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ); diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index 3951f06b9f..360d2d2460 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -185,7 +185,16 @@ class SpecialExport extends SpecialPage { $form .= Xml::submitButton( $this->msg( 'export-addcat' )->text(), array( 'name' => 'addcat' ) ) . '
'; if ( $wgExportFromNamespaces ) { - $form .= Xml::namespaceSelector( $nsindex, null, 'nsindex', $this->msg( 'export-addnstext' )->text() ) . ' '; + $form .= Html::namespaceSelector( + array( + 'selected' => $nsindex, + 'label' => $this->msg( 'export-addnstext' )->text() + ), array( + 'name' => 'nsindex', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ) . ' '; $form .= Xml::submitButton( $this->msg( 'export-addns' )->text(), array( 'name' => 'addns' ) ) . '
'; } diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index ed939203ba..2ea030eda5 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -279,7 +279,16 @@ class SpecialImport extends SpecialPage { Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) . " " . - Xml::namespaceSelector( $this->namespace, '' ) . + Html::namespaceSelector( + array( + 'selected' => $this->namespace, + 'all' => '', + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ) . " diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index f28f37db72..06282693f2 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -91,8 +91,17 @@ class LinkSearchPage extends QueryPage { Xml::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . Xml::inputLabel( $this->msg( 'linksearch-pat' )->text(), 'target', 'target', 50, $target ) . ' '; if ( !$wgMiserMode ) { - $s .= Xml::label( $this->msg( 'linksearch-ns' )->text(), 'namespace' ) . ' ' . - Xml::namespaceSelector( $namespace, '' ); + $s .= Html::namespaceSelector( + array( + 'selected' => $namespace, + 'all' => '', + 'label' => $this->msg( 'linksearch-ns' )->text() + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ); } $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) . '' . diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 6256b086d9..3c31ca0cd6 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -237,7 +237,16 @@ class SpecialNewpages extends IncludableSpecialPage { Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . - Xml::namespaceSelector( $namespace, 'all' ) . + Html::namespaceSelector( + array( + 'selected' => $namespace, + 'all' => 'all', + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ) . ' ' . ( $tagFilter ? ( ' diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index c358deee69..57d6841987 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -187,8 +187,19 @@ class SpecialProtectedpages extends SpecialPage { */ protected function getNamespaceMenu( $namespace = null ) { return "" . - Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' - . Xml::namespaceSelector( $namespace, '' ) . ""; + Html::rawElement( 'span', array( 'style' => 'white-space:nowrap' ), + Html::namespaceSelector( + array( + 'selected' => $namespace, + 'all' => '', + 'label' => $this->msg( 'namespace' )->text() + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ) + ); } /** diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index f4232cc9e1..ad5f3f33aa 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -138,9 +138,17 @@ class SpecialProtectedtitles extends SpecialPage { * @return string */ function getNamespaceMenu( $namespace = null ) { - return Xml::label( wfMsg( 'namespace' ), 'namespace' ) - . ' ' - . Xml::namespaceSelector( $namespace, '' ); + return Html::namespaceSelector( + array( + 'selected' => $namespace, + 'all' => '', + 'label' => $this->msg( 'namespace' )->text() + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ); } /** diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 9eb6bdf25b..62358da6bd 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -328,8 +328,17 @@ class SpecialWatchlist extends SpecialPage { $form .= $lang->pipeList( $links ); $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'mw-watchlist-form-namespaceselector' ) ); $form .= '

'; - $form .= Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . ' '; - $form .= Xml::namespaceSelector( $nameSpace, '' ) . ' '; + $form .= Html::namespaceSelector( + array( + 'selected' => $nameSpace, + 'all' => '', + 'label' => $this->msg( 'namespace' )->text() + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ) . ' '; $form .= Xml::checkLabel( $this->msg( 'invert' )->text(), 'invert', 'nsinvert', $invert ) . ' '; $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . '

'; $form .= Html::hidden( 'days', $values['days'] ); diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 7d4768af23..5d6a112685 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -413,8 +413,17 @@ class SpecialWhatLinksHere extends SpecialPage { $f .= ' '; # Namespace selector - $f .= Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . ' ' . - Xml::namespaceSelector( $namespace, '' ); + $f .= Html::namespaceSelector( + array( + 'selected' => $namespace, + 'all' => '', + 'label' => $this->msg( 'namespace' )->text() + ), array( + 'name' => 'namespace', + 'id' => 'namespace', + 'class' => 'namespaceselector', + ) + ); $f .= ' '; -- 2.20.1