r114131 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114130‎ | r114131 | r114132 >
Date:12:30, 19 March 2012
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
Change calls from Xml::namespaceSelector() to Html::namespaceSelector() since the former now throws deprecation warnings...
Modified paths:
  • /trunk/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialExport.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialImport.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialLinkSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedtitles.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWatchlist.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -237,7 +237,16 @@
238238 Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
239239 '</td>
240240 <td class="mw-input">' .
241 - Xml::namespaceSelector( $namespace, 'all' ) .
 241+ Html::namespaceSelector(
 242+ array(
 243+ 'selected' => $namespace,
 244+ 'all' => 'all',
 245+ ), array(
 246+ 'name' => 'namespace',
 247+ 'id' => 'namespace',
 248+ 'class' => 'namespaceselector',
 249+ )
 250+ ) .
242251 '</td>
243252 </tr>' . ( $tagFilter ? (
244253 '<tr>
Index: trunk/phase3/includes/specials/SpecialImport.php
@@ -279,7 +279,16 @@
280280 Xml::label( $this->msg( 'import-interwiki-namespace' )->text(), 'namespace' ) .
281281 "</td>
282282 <td class='mw-input'>" .
283 - Xml::namespaceSelector( $this->namespace, '' ) .
 283+ Html::namespaceSelector(
 284+ array(
 285+ 'selected' => $this->namespace,
 286+ 'all' => '',
 287+ ), array(
 288+ 'name' => 'namespace',
 289+ 'id' => 'namespace',
 290+ 'class' => 'namespaceselector',
 291+ )
 292+ ) .
284293 "</td>
285294 </tr>
286295 <tr>
Index: trunk/phase3/includes/specials/SpecialExport.php
@@ -185,7 +185,16 @@
186186 $form .= Xml::submitButton( $this->msg( 'export-addcat' )->text(), array( 'name' => 'addcat' ) ) . '<br />';
187187
188188 if ( $wgExportFromNamespaces ) {
189 - $form .= Xml::namespaceSelector( $nsindex, null, 'nsindex', $this->msg( 'export-addnstext' )->text() ) . '&#160;';
 189+ $form .= Html::namespaceSelector(
 190+ array(
 191+ 'selected' => $nsindex,
 192+ 'label' => $this->msg( 'export-addnstext' )->text()
 193+ ), array(
 194+ 'name' => 'nsindex',
 195+ 'id' => 'namespace',
 196+ 'class' => 'namespaceselector',
 197+ )
 198+ ) . '&#160;';
190199 $form .= Xml::submitButton( $this->msg( 'export-addns' )->text(), array( 'name' => 'addns' ) ) . '<br />';
191200 }
192201
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -413,8 +413,17 @@
414414 $f .= ' ';
415415
416416 # Namespace selector
417 - $f .= Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . '&#160;' .
418 - Xml::namespaceSelector( $namespace, '' );
 417+ $f .= Html::namespaceSelector(
 418+ array(
 419+ 'selected' => $namespace,
 420+ 'all' => '',
 421+ 'label' => $this->msg( 'namespace' )->text()
 422+ ), array(
 423+ 'name' => 'namespace',
 424+ 'id' => 'namespace',
 425+ 'class' => 'namespaceselector',
 426+ )
 427+ );
419428
420429 $f .= ' ';
421430
Index: trunk/phase3/includes/specials/SpecialProtectedtitles.php
@@ -138,9 +138,17 @@
139139 * @return string
140140 */
141141 function getNamespaceMenu( $namespace = null ) {
142 - return Xml::label( wfMsg( 'namespace' ), 'namespace' )
143 - . '&#160;'
144 - . Xml::namespaceSelector( $namespace, '' );
 142+ return Html::namespaceSelector(
 143+ array(
 144+ 'selected' => $namespace,
 145+ 'all' => '',
 146+ 'label' => $this->msg( 'namespace' )->text()
 147+ ), array(
 148+ 'name' => 'namespace',
 149+ 'id' => 'namespace',
 150+ 'class' => 'namespaceselector',
 151+ )
 152+ );
145153 }
146154
147155 /**
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php
@@ -492,8 +492,17 @@
493493 'size' => '20',
494494 'required' => ''
495495 ) + ( $options['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
496 - Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . ' ' .
497 - Xml::namespaceSelector( $options['namespace'], '' ) . ' ' .
 496+ Html::namespaceSelector(
 497+ array(
 498+ 'selected' => $options['namespace'],
 499+ 'all' => '',
 500+ 'label' => $this->msg( 'namespace' )->text()
 501+ ), array(
 502+ 'name' => 'namespace',
 503+ 'id' => 'namespace',
 504+ 'class' => 'namespaceselector',
 505+ )
 506+ ) . ' ' .
498507 Xml::submitButton( $this->msg( 'sp-contributions-submit' )->text() ) .
499508 Xml::closeElement( 'fieldset' ) .
500509 Xml::closeElement( 'form' );
Index: trunk/phase3/includes/specials/SpecialWatchlist.php
@@ -328,8 +328,17 @@
329329 $form .= $lang->pipeList( $links );
330330 $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl(), 'id' => 'mw-watchlist-form-namespaceselector' ) );
331331 $form .= '<hr /><p>';
332 - $form .= Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . '&#160;';
333 - $form .= Xml::namespaceSelector( $nameSpace, '' ) . '&#160;';
 332+ $form .= Html::namespaceSelector(
 333+ array(
 334+ 'selected' => $nameSpace,
 335+ 'all' => '',
 336+ 'label' => $this->msg( 'namespace' )->text()
 337+ ), array(
 338+ 'name' => 'namespace',
 339+ 'id' => 'namespace',
 340+ 'class' => 'namespaceselector',
 341+ )
 342+ ) . '&#160;';
334343 $form .= Xml::checkLabel( $this->msg( 'invert' )->text(), 'invert', 'nsinvert', $invert ) . '&#160;';
335344 $form .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) . '</p>';
336345 $form .= Html::hidden( 'days', $values['days'] );
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
@@ -187,8 +187,19 @@
188188 */
189189 protected function getNamespaceMenu( $namespace = null ) {
190190 return "<span style='white-space: nowrap'>" .
191 - Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '&#160;'
192 - . Xml::namespaceSelector( $namespace, '' ) . "</span>";
 191+ Html::rawElement( 'span', array( 'style' => 'white-space:nowrap' ),
 192+ Html::namespaceSelector(
 193+ array(
 194+ 'selected' => $namespace,
 195+ 'all' => '',
 196+ 'label' => $this->msg( 'namespace' )->text()
 197+ ), array(
 198+ 'name' => 'namespace',
 199+ 'id' => 'namespace',
 200+ 'class' => 'namespaceselector',
 201+ )
 202+ )
 203+ );
193204 }
194205
195206 /**
Index: trunk/phase3/includes/specials/SpecialLinkSearch.php
@@ -91,8 +91,17 @@
9292 Xml::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) .
9393 Xml::inputLabel( $this->msg( 'linksearch-pat' )->text(), 'target', 'target', 50, $target ) . ' ';
9494 if ( !$wgMiserMode ) {
95 - $s .= Xml::label( $this->msg( 'linksearch-ns' )->text(), 'namespace' ) . ' ' .
96 - Xml::namespaceSelector( $namespace, '' );
 95+ $s .= Html::namespaceSelector(
 96+ array(
 97+ 'selected' => $namespace,
 98+ 'all' => '',
 99+ 'label' => $this->msg( 'linksearch-ns' )->text()
 100+ ), array(
 101+ 'name' => 'namespace',
 102+ 'id' => 'namespace',
 103+ 'class' => 'namespaceselector',
 104+ )
 105+ );
97106 }
98107 $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) .
99108 '</fieldset>' .

Follow-up revisions

RevisionCommit summaryAuthorDate
r114140[Html::namespaceSelector clean up] fix broken html from r114131krinkle14:34, 19 March 2012

Comments

#Comment by Krinkle (talk | contribs)   14:32, 19 March 2012
----------
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
----------
@@ -187,8 +187,19 @@
 		return "<span style='white-space: nowrap'>" .
-			Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' '
-			. Xml::namespaceSelector( $namespace, '' ) . "</span>";
+		Html::rawElement( 'span', array( 'style' => 'white-space:nowrap' ),
+			Html::namespaceSelector(

The original opening tag is still there, that doesn't look right:

<span style='white-space: nowrap'><span style="white-space:nowrap"><label  .. /label> <select  .../select></span> 

<span style='white-space: nowrap'><label ../label> <select  .. /select></span>

Rest looks OK. Marking FIXME for the above.

#Comment by Krinkle (talk | contribs)   14:36, 19 March 2012

Fixed in r114140

Status & tagging log