Revision: 43667
Author:   raymond
Date:     2008-11-18 09:36:19 +0000 (Tue, 18 Nov 2008)

Log Message:
-----------
Add hints for maximum values of some user preferences.

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialPreferences.php
    trunk/phase3/languages/messages/MessagesEn.php
    trunk/phase3/maintenance/language/messages.inc

Modified: trunk/phase3/includes/specials/SpecialPreferences.php
===================================================================
--- trunk/phase3/includes/specials/SpecialPreferences.php       2008-11-18 
08:11:58 UTC (rev 43666)
+++ trunk/phase3/includes/specials/SpecialPreferences.php       2008-11-18 
09:36:19 UTC (rev 43667)
@@ -1003,41 +1003,58 @@
                $wgOut->addHTML( '</fieldset>' );
 
                # Recent changes
-               $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'prefs-rc' ) 
. '</legend>' );
+               global $wgRCMaxAge;
+               $wgOut->addHTML(
+                       Xml::fieldset( wfMsg( 'prefs-rc' ) ) .
+                       Xml::openElement( 'table' ) .
+                               '<tr>
+                                       <td class="mw-label">' .
+                                               Xml::label( wfMsg( 
'recentchangesdays' ), 'wpRecentDays' ) .
+                                       '</td>
+                                       <td class="mw-input">' .
+                                               Xml::input( 'wpRecentDays', 3, 
$this->mRecentDays, array( 'id' => 'wpRecentDays' ) ) . ' ' .
+                                               wfMsgExt( 
'recentchangesdays-max', 'parsemag',
+                                                       $wgLang->formatNum( 
ceil( $wgRCMaxAge / ( 3600 * 24 ) ) ) ) .
+                                       '</td>
+                               </tr><tr>
+                                       <td class="mw-label">' .
+                                               Xml::label( wfMsg( 
'recentchangescount' ), 'wpRecent' ) .
+                                       '</td>
+                                       <td class="mw-input">' .
+                                               Xml::input( 'wpRecent', 3, 
$this->mRecent, array( 'id' => 'wpRecent' ) ) .
+                                       '</td>
+                               </tr>' .
+                       Xml::closeElement( 'table' ) .
+                       '<br />'
+               );
 
-               $rc  = '<table><tr>';
-               $rc .= '<td>' . Xml::label( wfMsg( 'recentchangesdays' ), 
'wpRecentDays' ) . '</td>';
-               $rc .= '<td>' . Xml::input( 'wpRecentDays', 3, 
$this->mRecentDays, array( 'id' => 'wpRecentDays' ) ) . '</td>';
-               $rc .= '</tr><tr>';
-               $rc .= '<td>' . Xml::label( wfMsg( 'recentchangescount' ), 
'wpRecent' ) . '</td>';
-               $rc .= '<td>' . Xml::input( 'wpRecent', 3, $this->mRecent, 
array( 'id' => 'wpRecent' ) ) . '</td>';
-               $rc .= '</tr></table>';
-               $wgOut->addHTML( $rc );
-
-               $wgOut->addHTML( '<br />' );
-
                $toggles[] = 'hideminor';
                if( $wgRCShowWatchingUsers )
                        $toggles[] = 'shownumberswatching';
                $toggles[] = 'usenewrc';
-               $wgOut->addHTML( $this->getToggles( $toggles ) );
 
-               $wgOut->addHTML( '</fieldset>' );
+               $wgOut->addHTML(
+                       $this->getToggles( $toggles ) .
+                       Xml::closeElement( 'fieldset' )
+               );
 
                # Watchlist
-               $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 
'prefs-watchlist' ) . '</legend>' );
+               $wgOut->addHTML( 
+                       Xml::fieldset( wfMsg( 'prefs-watchlist' ) ) .
+                       Xml::inputLabel( wfMsg( 'prefs-watchlist-days' ), 
'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) . ' ' .
+                       wfMsgHTML( 'prefs-watchlist-days-max' ) .
+                       '<br /><br />' .
+                       $this->getToggle( 'extendwatchlist' ) .
+                       Xml::inputLabel( wfMsg( 'prefs-watchlist-edits' ), 
'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) . ' ' .
+                       wfMsgHTML( 'prefs-watchlist-edits-max' ) .
+                       '<br /><br />' .
+                       $this->getToggles( array( 'watchlisthideminor', 
'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 
'watchlisthideliu' ) )
+               );
 
-               $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), 
'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) );
-               $wgOut->addHTML( '<br /><br />' );
+               if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 
'createtalk' ) ) {
+                       $wgOut->addHTML( $this->getToggle( 'watchcreations' ) );
+               }
 
-               $wgOut->addHTML( $this->getToggle( 'extendwatchlist' ) );
-               $wgOut->addHTML( wfInputLabel( wfMsg( 'prefs-watchlist-edits' 
), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) );
-               $wgOut->addHTML( '<br /><br />' );
-
-               $wgOut->addHTML( $this->getToggles( array( 
'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 
'watchlisthideanons', 'watchlisthideliu' ) ) );
-
-               if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 
'createtalk' ) )
-                       $wgOut->addHTML( $this->getToggle( 'watchcreations' ) );
                foreach( array( 'edit' => 'watchdefault', 'move' => 
'watchmoves', 'delete' => 'watchdeletion' ) as $action => $toggle ) {
                        if( $wgUser->isAllowed( $action ) )
                                $wgOut->addHTML( $this->getToggle( $toggle ) );
@@ -1047,7 +1064,7 @@
                $this->mUsedToggles['watchmoves'] = true;
                $this->mUsedToggles['watchdeletion'] = true;
 
-               $wgOut->addHTML( '</fieldset>' );
+               $wgOut->addHTML( Xml::closeElement( 'fieldset' ) );
 
                # Search
                $mwsuggest = $wgEnableMWSuggest ?

Modified: trunk/phase3/languages/messages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/messages/MessagesEn.php      2008-11-18 08:11:58 UTC 
(rev 43666)
+++ trunk/phase3/languages/messages/MessagesEn.php      2008-11-18 09:36:19 UTC 
(rev 43667)
@@ -1539,7 +1539,9 @@
 'prefs-rc'                 => 'Recent changes',
 'prefs-watchlist'          => 'Watchlist',
 'prefs-watchlist-days'     => 'Days to show in watchlist:',
+'prefs-watchlist-days-max' => '(maximum 7 days)',
 'prefs-watchlist-edits'    => 'Maximum number of changes to show in expanded 
watchlist:',
+'prefs-watchlist-edits-max'=> '(maximum number: 1000)',
 'prefs-misc'               => 'Misc',
 'saveprefs'                => 'Save',
 'resetprefs'               => 'Clear unsaved changes',
@@ -1555,6 +1557,7 @@
 'contextchars'             => 'Context per line:',
 'stub-threshold'           => 'Threshold for <a href="#" class="stub">stub 
link</a> formatting (bytes):',
 'recentchangesdays'        => 'Days to show in recent changes:',
+'recentchangesdays-max'    => '(maximum $1 {{PLURAL:$1|day|days}})',
 'recentchangescount'       => 'Number of edits to show in recent changes, 
history and log pages:',
 'savedprefs'               => 'Your preferences have been saved.',
 'timezonelegend'           => 'Time zone',

Modified: trunk/phase3/maintenance/language/messages.inc
===================================================================
--- trunk/phase3/maintenance/language/messages.inc      2008-11-18 08:11:58 UTC 
(rev 43666)
+++ trunk/phase3/maintenance/language/messages.inc      2008-11-18 09:36:19 UTC 
(rev 43667)
@@ -858,7 +858,9 @@
                'prefs-rc',
                'prefs-watchlist',
                'prefs-watchlist-days',
+               'prefs-watchlist-days-max',
                'prefs-watchlist-edits',
+               'prefs-watchlist-edits-max',
                'prefs-misc',
                'saveprefs',
                'resetprefs',
@@ -874,6 +876,7 @@
                'contextchars',
                'stub-threshold',
                'recentchangesdays',
+               'recentchangesdays-max',
                'recentchangescount',
                'savedprefs',
                'timezonelegend',



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to