r47335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47334‎ | r47335 | r47336 >
Date:19:19, 16 February 2009
Author:raymond
Status:ok (Comments)
Tags:
Comment:
Prettify code of Special:Preferences#Misc. Use Xml::functions.
This maybe fixes bug 17482 (Formatting error in "preferences") but I cannot see the effect in my installations.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -1246,25 +1246,34 @@
12471247
12481248 # Misc
12491249 #
1250 - $wgOut->addHTML('<fieldset><legend>' . wfMsg('prefs-misc') . '</legend>');
1251 - $wgOut->addHTML( '<label for="wpStubs">' . wfMsg( 'stub-threshold' ) . '</label>&nbsp;' );
1252 - $wgOut->addHTML( Xml::input( 'wpStubs', 6, $this->mStubs, array( 'id' => 'wpStubs' ) ) );
1253 - $msgUnderline = htmlspecialchars( wfMsg ( 'tog-underline' ) );
1254 - $msgUnderlinenever = htmlspecialchars( wfMsg ( 'underline-never' ) );
1255 - $msgUnderlinealways = htmlspecialchars( wfMsg ( 'underline-always' ) );
1256 - $msgUnderlinedefault = htmlspecialchars( wfMsg ( 'underline-default' ) );
1257 - $uopt = $wgUser->getOption("underline");
1258 - $s0 = $uopt == 0 ? ' selected="selected"' : '';
1259 - $s1 = $uopt == 1 ? ' selected="selected"' : '';
1260 - $s2 = $uopt == 2 ? ' selected="selected"' : '';
1261 - $wgOut->addHTML("
1262 -<div class='toggle'><p><label for='wpOpunderline'>$msgUnderline</label>
1263 -<select name='wpOpunderline' id='wpOpunderline'>
1264 -<option value=\"0\"$s0>$msgUnderlinenever</option>
1265 -<option value=\"1\"$s1>$msgUnderlinealways</option>
1266 -<option value=\"2\"$s2>$msgUnderlinedefault</option>
1267 -</select></p></div>");
 1250+ $uopt = $wgUser->getOption( 'underline' );
 1251+ $wgOut->addHTML(
 1252+ Xml::fieldset( wfMsg( 'prefs-misc' ) ) .
 1253+ Xml::openElement( 'table' ) .
 1254+ '<tr>
 1255+ <td class="mw-label">' .
 1256+ // Xml::label() cannot be used because 'stub-threshold' contains plain HTML
 1257+ Xml::tags( 'label', array( 'for' => 'wpStubs' ), wfMsg( 'stub-threshold' ) ) .
 1258+ '</td>
 1259+ <td class="mw-input">' .
 1260+ Xml::input( 'wpStubs', 6, $this->mStubs, array( 'id' => 'wpStubs' ) ) .
 1261+ '</td>
 1262+ </tr><tr>
 1263+ <td class="mw-label">' .
 1264+ Xml::label( wfMsg( 'tog-underline' ), 'wpOpunderline' ) .
 1265+ '</td>
 1266+ <td class="mw-input">' .
 1267+ Xml::openElement( 'select', array( 'id' => 'wpOpunderline', 'name' => 'wpOpunderline' ) ) .
 1268+ Xml::option( wfMsg ( 'underline-never' ), '0', $uopt == 0 ) .
 1269+ Xml::option( wfMsg ( 'underline-always' ), '1', $uopt == 1 ) .
 1270+ Xml::option( wfMsg ( 'underline-default' ), '2', $uopt == 2 ) .
 1271+ Xml::closeElement( 'select' ) .
 1272+ '</td>
 1273+ </tr>' .
 1274+ Xml::closeElement( 'table' )
 1275+ );
12681276
 1277+ # And now the rest = Misc.
12691278 foreach ( $togs as $tname ) {
12701279 if( !array_key_exists( $tname, $this->mUsedToggles ) ) {
12711280 if( $tname == 'norollbackdiff' && $wgUser->isAllowed( 'rollback' ) )

Follow-up revisions

RevisionCommit summaryAuthorDate
r47357Follow up r47335: Adding to RELEASE NOTES as the bug reporter confirmed that ...raymond10:19, 17 February 2009

Comments

#Comment by Raymond (talk | contribs)   10:20, 17 February 2009

Added to RELEASE NOTES with r47357

Status & tagging log