Add hints for maximum values of some user preferences.
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 18 Nov 2008 09:36:19 +0000 (09:36 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 18 Nov 2008 09:36:19 +0000 (09:36 +0000)
includes/specials/SpecialPreferences.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index ef45939..36ddacd 100644 (file)
@@ -1003,41 +1003,58 @@ class PreferencesForm {
                $wgOut->addHTML( '</fieldset>' );
 
                # Recent changes
-               $wgOut->addHTML( '<fieldset><legend>' . wfMsgHtml( 'prefs-rc' ) . '</legend>' );
-
-               $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 />' );
+               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 />'
+               );
 
                $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( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) );
-               $wgOut->addHTML( '<br /><br />' );
-
-               $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' ) ) );
+               $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' ) )
+               );
 
-               if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) )
+               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 @@ class PreferencesForm {
                $this->mUsedToggles['watchmoves'] = true;
                $this->mUsedToggles['watchdeletion'] = true;
 
-               $wgOut->addHTML( '</fieldset>' );
+               $wgOut->addHTML( Xml::closeElement( 'fieldset' ) );
 
                # Search
                $mwsuggest = $wgEnableMWSuggest ?
index ac851f0..7416515 100644 (file)
@@ -1539,7 +1539,9 @@ please see math/README to configure.',
 '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 @@ please see math/README to configure.',
 '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',
index cff5467..9d037bf 100644 (file)
@@ -858,7 +858,9 @@ $wgMessageStructure = array(
                '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 @@ $wgMessageStructure = array(
                'contextchars',
                'stub-threshold',
                'recentchangesdays',
+               'recentchangesdays-max',
                'recentchangescount',
                'savedprefs',
                'timezonelegend',