From: Raimond Spekking Date: Thu, 17 Apr 2008 17:26:58 +0000 (+0000) Subject: * Tweaks for sections date/time and search of SpecialPreferences: X-Git-Tag: 1.31.0-rc.0~48236 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=3d80ebb9b8bc8451eedb4386e4029875644e8fd2;p=lhc%2Fweb%2Fwiklou.git * Tweaks for sections date/time and search of SpecialPreferences: ** Fix aligning for RTL wikis: Use existing CSS classes ** Move hardcoded superscript number 1 into 'timezonetext' message. The counterpart is in 'timezoneoffset' since ages. ** Use XML functions for these sections --- diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 293db0efb0..b75047599c 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -474,7 +474,7 @@ class PreferencesForm { } function addRow($td1, $td2) { - return "$td1$td2"; + return "$td1$td2"; } /** @@ -870,40 +870,63 @@ class PreferencesForm { # Date/Time # - $wgOut->addHTML( "
\n" . wfMsg( 'datetime' ) . "\n" ); + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'datetime' ) ) . "\n" + ); if ($dateopts) { - $wgOut->addHTML( "
\n" . wfMsg( 'dateformat' ) . "\n" ); + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'dateformat' ) ) . "\n" + ); $idCnt = 0; $epoch = '20010115161234'; # Wikipedia day foreach( $dateopts as $key ) { if( $key == 'default' ) { - $formatted = wfMsgHtml( 'datedefault' ); + $formatted = wfMsg( 'datedefault' ); } else { - $formatted = htmlspecialchars( $wgLang->timeanddate( $epoch, false, $key ) ); + $formatted = $wgLang->timeanddate( $epoch, false, $key ); } - ($key == $this->mDate) ? $checked = ' checked="checked"' : $checked = ''; - $wgOut->addHTML( "
\n" ); + $checked = ( $key == $this->mDate ) ? true : false; + $wgOut->addHTML( + Xml::tags( 'div', null, + Xml::radioLabel( $formatted, 'wpDate', $key, "wpDate$idCnt", $checked ) + ) . "\n" + ); $idCnt++; } - $wgOut->addHTML( "
\n" ); + $wgOut->addHTML( Xml::closeElement( 'fieldset' ) . "\n" ); } $nowlocal = $wgLang->time( $now = wfTimestampNow(), true ); $nowserver = $wgLang->time( $now, false ); - $wgOut->addHTML( '
' . wfMsg( 'timezonelegend' ). '' . + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'timezonelegend' ) ) . + Xml::openElement( 'table' ) . $this->addRow( wfMsg( 'servertime' ), $nowserver ) . $this->addRow( wfMsg( 'localtime' ), $nowlocal ) . $this->addRow( - '', - "mHourDiff ) . "\" size='6' />" - ) . "
- -
¹" . wfMsg( 'timezonetext' ) . "
-
\n\n" ); + Xml::label( wfMsg( 'timezoneoffset' ), 'wpHourDiff' ), + Xml::input( 'wpHourDiff', 6, $this->mHourDiff, array( 'class' => 'wpHourDiff' ) ) ) . + " + + " . + Xml::element( 'input', + array( 'type' => 'button', + 'value' => wfMsg( 'guesstimezone' ), + 'onclick' => 'javascript:guessTimezone()', + 'id' => 'guesstimezonebutton', + 'style' => 'display:none;' ) ) . + " + " . + Xml::closeElement( 'table' ) . + Xml::element( 'div', array( 'class' => 'prefsectiontip' ), wfMsg( 'timezonetext' ) ). + Xml::closeElement( 'fieldset' ) . + Xml::closeElement( 'fieldset' ) . "\n\n" + ); # Editing # @@ -980,30 +1003,39 @@ class PreferencesForm { # Search $ajaxsearch = $wgAjaxSearch ? $this->addRow( - wfLabel( wfMsg( 'useajaxsearch' ), 'wpUseAjaxSearch' ), - wfCheck( 'wpUseAjaxSearch', $this->mUseAjaxSearch, array( 'id' => 'wpUseAjaxSearch' ) ) + Xml::label( wfMsg( 'useajaxsearch' ), 'wpUseAjaxSearch' ), + Xml::check( 'wpUseAjaxSearch', $this->mUseAjaxSearch, array( 'id' => 'wpUseAjaxSearch' ) ) ) : ''; $mwsuggest = $wgEnableMWSuggest ? $this->addRow( - wfLabel( wfMsg( 'mwsuggest-disable' ), 'wpDisableMWSuggest' ), - wfCheck( 'wpDisableMWSuggest', $this->mDisableMWSuggest, array( 'id' => 'wpDisableMWSuggest' ) ) + Xml::label( wfMsg( 'mwsuggest-disable' ), 'wpDisableMWSuggest' ), + Xml::check( 'wpDisableMWSuggest', $this->mDisableMWSuggest, array( 'id' => 'wpDisableMWSuggest' ) ) ) : ''; - $wgOut->addHTML( '
' . wfMsg( 'searchresultshead' ) . '' . - $ajaxsearch . + $wgOut->addHTML( + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'searchresultshead' ) ) . + Xml::openElement( 'table' ) . + $ajaxsearch . $this->addRow( - wfLabel( wfMsg( 'resultsperpage' ), 'wpSearch' ), - wfInput( 'wpSearch', 4, $this->mSearch, array( 'id' => 'wpSearch' ) ) + Xml::label( wfMsg( 'resultsperpage' ), 'wpSearch' ), + Xml::input( 'wpSearch', 4, $this->mSearch, array( 'id' => 'wpSearch' ) ) ) . $this->addRow( - wfLabel( wfMsg( 'contextlines' ), 'wpSearchLines' ), - wfInput( 'wpSearchLines', 4, $this->mSearchLines, array( 'id' => 'wpSearchLines' ) ) + Xml::label( wfMsg( 'contextlines' ), 'wpSearchLines' ), + Xml::input( 'wpSearchLines', 4, $this->mSearchLines, array( 'id' => 'wpSearchLines' ) ) ) . $this->addRow( - wfLabel( wfMsg( 'contextchars' ), 'wpSearchChars' ), - wfInput( 'wpSearchChars', 4, $this->mSearchChars, array( 'id' => 'wpSearchChars' ) ) + Xml::label( wfMsg( 'contextchars' ), 'wpSearchChars' ), + Xml::input( 'wpSearchChars', 4, $this->mSearchChars, array( 'id' => 'wpSearchChars' ) ) ) . - $mwsuggest. - "
" . wfMsg( 'defaultns' ) . "$ps
" ); + $mwsuggest . + Xml::closeElement( 'table' ) . + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', null, wfMsg( 'defaultns' ) ) . + $ps . + Xml::closeElement( 'fieldset' ) . + Xml::closeElement( 'fieldset' ) + ); # Misc # diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index b8841016af..9124497ebd 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -1021,7 +1021,7 @@ Wenn du dich mit dem Thema auskennst, kannst du selbst die Seite „[[$1]]“ ve 'recentchangescount' => 'Anzahl der Einträge in „Letzte Änderungen“:', 'savedprefs' => 'Deine Einstellungen wurden gespeichert.', 'timezonelegend' => 'Zeitzone', -'timezonetext' => 'Gib die Anzahl der Stunden ein, die zwischen deiner Zeitzone und UTC liegen.', +'timezonetext' => '¹Gib die Anzahl der Stunden ein, die zwischen deiner Zeitzone und UTC liegen.', 'localtime' => 'Ortszeit:', 'timezoneoffset' => 'Unterschied¹:', 'servertime' => 'Aktuelle Zeit auf dem Server:', diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index c3a207d49e..29c5f46861 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1389,7 +1389,7 @@ please see math/README to configure.', 'recentchangescount' => 'Number of edits to show in recent changes:', 'savedprefs' => 'Your preferences have been saved.', 'timezonelegend' => 'Time zone', -'timezonetext' => 'The number of hours your local time differs from server time (UTC).', +'timezonetext' => '¹The number of hours your local time differs from server time (UTC).', 'localtime' => 'Local time', 'timezoneoffset' => 'Offset¹', 'servertime' => 'Server time',