r43667 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43666‎ | r43667 | r43668 >
Date:09:36, 18 November 2008
Author:raymond
Status:ok
Tags:
Comment:
Add hints for maximum values of some user preferences.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -858,7 +858,9 @@
859859 'prefs-rc',
860860 'prefs-watchlist',
861861 'prefs-watchlist-days',
 862+ 'prefs-watchlist-days-max',
862863 'prefs-watchlist-edits',
 864+ 'prefs-watchlist-edits-max',
863865 'prefs-misc',
864866 'saveprefs',
865867 'resetprefs',
@@ -874,6 +876,7 @@
875877 'contextchars',
876878 'stub-threshold',
877879 'recentchangesdays',
 880+ 'recentchangesdays-max',
878881 'recentchangescount',
879882 'savedprefs',
880883 'timezonelegend',
Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -1003,41 +1003,58 @@
10041004 $wgOut->addHTML( '</fieldset>' );
10051005
10061006 # Recent changes
1007 - $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'prefs-rc' ) . '</legend>' );
 1007+ global $wgRCMaxAge;
 1008+ $wgOut->addHTML(
 1009+ Xml::fieldset( wfMsg( 'prefs-rc' ) ) .
 1010+ Xml::openElement( 'table' ) .
 1011+ '<tr>
 1012+ <td class="mw-label">' .
 1013+ Xml::label( wfMsg( 'recentchangesdays' ), 'wpRecentDays' ) .
 1014+ '</td>
 1015+ <td class="mw-input">' .
 1016+ Xml::input( 'wpRecentDays', 3, $this->mRecentDays, array( 'id' => 'wpRecentDays' ) ) . ' ' .
 1017+ wfMsgExt( 'recentchangesdays-max', 'parsemag',
 1018+ $wgLang->formatNum( ceil( $wgRCMaxAge / ( 3600 * 24 ) ) ) ) .
 1019+ '</td>
 1020+ </tr><tr>
 1021+ <td class="mw-label">' .
 1022+ Xml::label( wfMsg( 'recentchangescount' ), 'wpRecent' ) .
 1023+ '</td>
 1024+ <td class="mw-input">' .
 1025+ Xml::input( 'wpRecent', 3, $this->mRecent, array( 'id' => 'wpRecent' ) ) .
 1026+ '</td>
 1027+ </tr>' .
 1028+ Xml::closeElement( 'table' ) .
 1029+ '<br />'
 1030+ );
10081031
1009 - $rc = '<table><tr>';
1010 - $rc .= '<td>' . Xml::label( wfMsg( 'recentchangesdays' ), 'wpRecentDays' ) . '</td>';
1011 - $rc .= '<td>' . Xml::input( 'wpRecentDays', 3, $this->mRecentDays, array( 'id' => 'wpRecentDays' ) ) . '</td>';
1012 - $rc .= '</tr><tr>';
1013 - $rc .= '<td>' . Xml::label( wfMsg( 'recentchangescount' ), 'wpRecent' ) . '</td>';
1014 - $rc .= '<td>' . Xml::input( 'wpRecent', 3, $this->mRecent, array( 'id' => 'wpRecent' ) ) . '</td>';
1015 - $rc .= '</tr></table>';
1016 - $wgOut->addHTML( $rc );
1017 -
1018 - $wgOut->addHTML( '<br />' );
1019 -
10201032 $toggles[] = 'hideminor';
10211033 if( $wgRCShowWatchingUsers )
10221034 $toggles[] = 'shownumberswatching';
10231035 $toggles[] = 'usenewrc';
1024 - $wgOut->addHTML( $this->getToggles( $toggles ) );
10251036
1026 - $wgOut->addHTML( '</fieldset>' );
 1037+ $wgOut->addHTML(
 1038+ $this->getToggles( $toggles ) .
 1039+ Xml::closeElement( 'fieldset' )
 1040+ );
10271041
10281042 # Watchlist
1029 - $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'prefs-watchlist' ) . '</legend>' );
 1043+ $wgOut->addHTML(
 1044+ Xml::fieldset( wfMsg( 'prefs-watchlist' ) ) .
 1045+ Xml::inputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) . ' ' .
 1046+ wfMsgHTML( 'prefs-watchlist-days-max' ) .
 1047+ '<br /><br />' .
 1048+ $this->getToggle( 'extendwatchlist' ) .
 1049+ Xml::inputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) . ' ' .
 1050+ wfMsgHTML( 'prefs-watchlist-edits-max' ) .
 1051+ '<br /><br />' .
 1052+ $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 'watchlisthideliu' ) )
 1053+ );
10301054
1031 - $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) );
1032 - $wgOut->addHTML( '<br /><br />' );
 1055+ if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) {
 1056+ $wgOut->addHTML( $this->getToggle( 'watchcreations' ) );
 1057+ }
10331058
1034 - $wgOut->addHTML( $this->getToggle( 'extendwatchlist' ) );
1035 - $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) );
1036 - $wgOut->addHTML( '<br /><br />' );
1037 -
1038 - $wgOut->addHTML( $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 'watchlisthideliu' ) ) );
1039 -
1040 - if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) )
1041 - $wgOut->addHTML( $this->getToggle( 'watchcreations' ) );
10421059 foreach( array( 'edit' => 'watchdefault', 'move' => 'watchmoves', 'delete' => 'watchdeletion' ) as $action => $toggle ) {
10431060 if( $wgUser->isAllowed( $action ) )
10441061 $wgOut->addHTML( $this->getToggle( $toggle ) );
@@ -1047,7 +1064,7 @@
10481065 $this->mUsedToggles['watchmoves'] = true;
10491066 $this->mUsedToggles['watchdeletion'] = true;
10501067
1051 - $wgOut->addHTML( '</fieldset>' );
 1068+ $wgOut->addHTML( Xml::closeElement( 'fieldset' ) );
10521069
10531070 # Search
10541071 $mwsuggest = $wgEnableMWSuggest ?
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1539,7 +1539,9 @@
15401540 'prefs-rc' => 'Recent changes',
15411541 'prefs-watchlist' => 'Watchlist',
15421542 'prefs-watchlist-days' => 'Days to show in watchlist:',
 1543+'prefs-watchlist-days-max' => '(maximum 7 days)',
15431544 'prefs-watchlist-edits' => 'Maximum number of changes to show in expanded watchlist:',
 1545+'prefs-watchlist-edits-max'=> '(maximum number: 1000)',
15441546 'prefs-misc' => 'Misc',
15451547 'saveprefs' => 'Save',
15461548 'resetprefs' => 'Clear unsaved changes',
@@ -1555,6 +1557,7 @@
15561558 'contextchars' => 'Context per line:',
15571559 'stub-threshold' => 'Threshold for <a href="#" class="stub">stub link</a> formatting (bytes):',
15581560 'recentchangesdays' => 'Days to show in recent changes:',
 1561+'recentchangesdays-max' => '(maximum $1 {{PLURAL:$1|day|days}})',
15591562 'recentchangescount' => 'Number of edits to show in recent changes, history and log pages:',
15601563 'savedprefs' => 'Your preferences have been saved.',
15611564 'timezonelegend' => 'Time zone',

Status & tagging log