r72577 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72576‎ | r72577 | r72578 >
Date:11:21, 8 September 2010
Author:raymond
Status:ok
Tags:
Comment:
Add a CSS class to the input form
And while I am at it: Use more nice Xml/Html functions
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -331,7 +331,7 @@
332332 $this->opts['topOnly'] = false;
333333 }
334334
335 - $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
 335+ $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'class' => 'mw-contributions-form' ) );
336336
337337 # Add hidden params for tracking except for parameters in $skipParameters
338338 $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly' );
@@ -344,8 +344,7 @@
345345
346346 $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagFilter'] );
347347
348 - $f .= '<fieldset>' .
349 - Xml::element( 'legend', array(), wfMsg( 'sp-contributions-search' ) ) .
 348+ $f .= Xml::fieldset( wfMsg( 'sp-contributions-search' ) ) .
350349 Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ),
351350 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ? true : false ) . '<br />' .
352351 Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ),
@@ -354,27 +353,24 @@
355354 'size' => '20',
356355 'required' => ''
357356 ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) ) ) . ' '.
358 - '<span style="white-space: nowrap">' .
359 - Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
360 - Xml::namespaceSelector( $this->opts['namespace'], '' ) .
361 - '</span>' .
 357+ Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ),
 358+ Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' .
 359+ Xml::namespaceSelector( $this->opts['namespace'], '' )
 360+ ) .
362361 Xml::checkLabel( wfMsg( 'history-show-deleted' ),
363362 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . '<br />' .
364363 Xml::tags( 'p', null, Xml::checkLabel( wfMsg( 'sp-contributions-toponly' ),
365364 'topOnly', 'mw-show-top-only', $this->opts['topOnly'] ) ) .
366365 ( $tagFilter ? Xml::tags( 'p', null, implode( '&#160;', $tagFilter ) ) : '' ) .
367 - Xml::openElement( 'p' ) .
368 - '<span style="white-space: nowrap">' .
369 - Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) .
370 - '</span>' . ' ' .
371 - Xml::submitButton( wfMsg( 'sp-contributions-submit' ) ) .
372 - Xml::closeElement( 'p' );
373 -
 366+ Html::rawElement( 'p', array( 'style' => 'white-space: nowrap' ),
 367+ Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) . ' ' .
 368+ Xml::submitButton( wfMsg( 'sp-contributions-submit' ) )
 369+ ) . ' ';
374370 $explain = wfMsgExt( 'sp-contributions-explain', 'parseinline' );
375 - if( !wfEmptyMsg( 'sp-contributions-explain', $explain ) )
 371+ if( !wfEmptyMsg( 'sp-contributions-explain', $explain ) ) {
376372 $f .= "<p id='mw-sp-contributions-explain'>{$explain}</p>";
377 -
378 - $f .= '</fieldset>' .
 373+ }
 374+ $f .= Xml::closeElement('fieldset' ) .
379375 Xml::closeElement( 'form' );
380376 return $f;
381377 }

Status & tagging log