Bugzilla bug11612 - Make watchlist max days preference setting reflect the max days...
authorBenny Situ <bsitu@users.mediawiki.org>
Fri, 23 Dec 2011 18:55:04 +0000 (18:55 +0000)
committerBenny Situ <bsitu@users.mediawiki.org>
Fri, 23 Dec 2011 18:55:04 +0000 (18:55 +0000)
includes/Preferences.php
languages/messages/MessagesEn.php

index 323ef68..8fb00e2 100644 (file)
@@ -849,15 +849,18 @@ class Preferences {
         * @param $defaultPreferences
         */
        static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) {
-               global $wgUseRCPatrol, $wgEnableAPI;
+               global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge;
 
+               $watchlistdaysMax = ceil( $wgRCMaxAge / ( 3600 * 24 ) );
+               
                ## Watchlist #####################################
                $defaultPreferences['watchlistdays'] = array(
                        'type' => 'float',
                        'min' => 0,
-                       'max' => 7,
+                       'max' => $watchlistdaysMax,
                        'section' => 'watchlist/displaywatchlist',
-                       'help' => $context->msg( 'prefs-watchlist-days-max' )->escaped(),
+                       'help' => $context->msg( 'prefs-watchlist-days-max' )->numParams(
+                                                $watchlistdaysMax )->text(),
                        'label-message' => 'prefs-watchlist-days',
                );
                $defaultPreferences['wllimit'] = array(
index 15f9d99..2900f39 100644 (file)
@@ -1767,7 +1767,7 @@ Note that their indexes of {{SITENAME}} content may be out of date.',
 'prefs-rc'                      => 'Recent changes',
 'prefs-watchlist'               => 'Watchlist',
 'prefs-watchlist-days'          => 'Days to show in watchlist:',
-'prefs-watchlist-days-max'      => 'Maximum 7 days',
+'prefs-watchlist-days-max'      => 'Maximum $1 {{PLURAL:$1|day|days}}',
 'prefs-watchlist-edits'         => 'Maximum number of changes to show in expanded watchlist:',
 'prefs-watchlist-edits-max'     => 'Maximum number: 1000',
 'prefs-watchlist-token'         => 'Watchlist token:',