From a7da936d274c2c09d628742077f55a281a40a0fd Mon Sep 17 00:00:00 2001 From: Benny Situ Date: Fri, 23 Dec 2011 18:55:04 +0000 Subject: [PATCH] Bugzilla bug11612 - Make watchlist max days preference setting reflect the max days in Recent Changes --- includes/Preferences.php | 9 ++++++--- languages/messages/MessagesEn.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/Preferences.php b/includes/Preferences.php index 323ef68e45..8fb00e2fec 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -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( diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 15f9d994b5..2900f39c5d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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:', -- 2.20.1