From ab2d02966f0aa6d175cf1c62f44ded31367c8c02 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Mon, 16 Feb 2009 19:19:45 +0000 Subject: [PATCH] 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. --- includes/specials/SpecialPreferences.php | 45 ++++++++++++++---------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index 84654e1437..f4a42ef48d 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -1246,25 +1246,34 @@ class PreferencesForm { # Misc # - $wgOut->addHTML('
' . wfMsg('prefs-misc') . ''); - $wgOut->addHTML( ' ' ); - $wgOut->addHTML( Xml::input( 'wpStubs', 6, $this->mStubs, array( 'id' => 'wpStubs' ) ) ); - $msgUnderline = htmlspecialchars( wfMsg ( 'tog-underline' ) ); - $msgUnderlinenever = htmlspecialchars( wfMsg ( 'underline-never' ) ); - $msgUnderlinealways = htmlspecialchars( wfMsg ( 'underline-always' ) ); - $msgUnderlinedefault = htmlspecialchars( wfMsg ( 'underline-default' ) ); - $uopt = $wgUser->getOption("underline"); - $s0 = $uopt == 0 ? ' selected="selected"' : ''; - $s1 = $uopt == 1 ? ' selected="selected"' : ''; - $s2 = $uopt == 2 ? ' selected="selected"' : ''; - $wgOut->addHTML(" -

-

"); + $uopt = $wgUser->getOption( 'underline' ); + $wgOut->addHTML( + Xml::fieldset( wfMsg( 'prefs-misc' ) ) . + Xml::openElement( 'table' ) . + ' + ' . + // Xml::label() cannot be used because 'stub-threshold' contains plain HTML + Xml::tags( 'label', array( 'for' => 'wpStubs' ), wfMsg( 'stub-threshold' ) ) . + ' + ' . + Xml::input( 'wpStubs', 6, $this->mStubs, array( 'id' => 'wpStubs' ) ) . + ' + + ' . + Xml::label( wfMsg( 'tog-underline' ), 'wpOpunderline' ) . + ' + ' . + Xml::openElement( 'select', array( 'id' => 'wpOpunderline', 'name' => 'wpOpunderline' ) ) . + Xml::option( wfMsg ( 'underline-never' ), '0', $uopt == 0 ) . + Xml::option( wfMsg ( 'underline-always' ), '1', $uopt == 1 ) . + Xml::option( wfMsg ( 'underline-default' ), '2', $uopt == 2 ) . + Xml::closeElement( 'select' ) . + ' + ' . + Xml::closeElement( 'table' ) + ); + # And now the rest = Misc. foreach ( $togs as $tname ) { if( !array_key_exists( $tname, $this->mUsedToggles ) ) { if( $tname == 'norollbackdiff' && $wgUser->isAllowed( 'rollback' ) ) -- 2.20.1