From: jenkins-bot Date: Mon, 25 Jan 2016 20:30:44 +0000 (+0000) Subject: Merge "SpecialWatchlist: Display actual number of days for the "all" option" X-Git-Tag: 1.31.0-rc.0~8214 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=03328b0d1c2a7194dbfdc65a73e246032e7ab653;hp=01fd8477314c5acbf4711a269e252467e635def4;p=lhc%2Fweb%2Fwiklou.git Merge "SpecialWatchlist: Display actual number of days for the "all" option" --- diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 20dde01fb6..6ebe9a8074 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -532,9 +532,19 @@ class SpecialWatchlist extends ChangesListSpecialPage { $days[] = $userWatchlistOption; } + $maxDays = (string)( $this->getConfig()->get( 'RCMaxAge' ) / ( 3600 * 24 ) ); + // add the maximum possible value, if it isn't available already + if ( !in_array( $maxDays, $days ) ) { + $days[] = $maxDays; + } + $selected = (string)$options['days']; + if ( $selected <= 0 ) { + $selected = $maxDays; + } + // add the currently selected value, if it isn't available already - if ( !in_array( $selected, $days ) && $selected !== '0' ) { + if ( !in_array( $selected, $days ) ) { $days[] = $selected; } @@ -550,11 +560,6 @@ class SpecialWatchlist extends ChangesListSpecialPage { $select->addOption( $name, $value ); } - // 'all' option - $name = $this->msg( 'watchlistall2' )->text(); - $value = '0'; - $select->addOption( $name, $value ); - return $select->getHTML() . "\n
\n"; } diff --git a/languages/i18n/en.json b/languages/i18n/en.json index f875dcb36a..639af0f454 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2023,7 +2023,6 @@ "wlheader-showupdated": "Pages that have been changed since you last visited them are shown in bold.", "wlnote": "Below {{PLURAL:$1|is the last change|are the last $1 changes}} in the last {{PLURAL:$2|hour|$2 hours}}, as of $3, $4.", "wlshowlast": "Show last $1 hours $2 days", - "watchlistall2": "all", "watchlist-hide": "Hide", "watchlist-submit": "Show", "wlshowtime": "Period of time to display:", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 499f4e7c7b..61aaeaa6d3 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2198,10 +2198,9 @@ "wlheader-showupdated": "Message at the top of [[Special:Watchlist]], after {{msg-mw|watchlist-details}}. Has to be a full sentence.", "wlnote": "Used on [[Special:Watchlist]] when a maximum number of hours or days is specified.\n\nParameters:\n* $1 - the number of changes shown\n* $2 - the number of hours for which the changes are shown\n* $3 - a date alone\n* $4 - a time alone", "wlshowlast": "Appears on [[Special:Watchlist]]. Parameters:\n* $1 - a choice of different numbers of hours (\"1 | 2 | 6 | 12\")\n* $2 - a choice of different numbers of days (\"1 | 3 | 7\" and the maximum number of days available)\nClicking on your choice changes the list of changes you see (without changing the default in my preferences).", - "watchlistall2": "Appears on [[Special:Watchlist]], after {{msg-mw|wlshowtime}}, as the option to display all available data regardless of age.\n{{Identical|All}}", "watchlist-hide": "Appears on [[Special:Watchlist]]. It is the first word on a new line with checkboxes to hide/unhide options\n{{Identical|Hide}}", "watchlist-submit": "Label on the submit button in [[Special:Watchlist]]\n{{Identical|Show}}", - "wlshowtime": "Appears on [[Special:Watchlist]]. Label of a drop-down list used to specify the period of time to display in the watchlist. This period can be {{msg-mw|days}}, {{msg-mw|hours}}, or {{msg-mw|watchlistall2}}.", + "wlshowtime": "Appears on [[Special:Watchlist]]. Label of a drop-down list used to specify the period of time to display in the watchlist. This period can be {{msg-mw|days}} or {{msg-mw|hours}}.", "wlshowhideminor": "Option text in [[Special:Watchlist]]. Cf. {{msg-mw|rcshowhideminor}}.\n{{Identical|Minor edit}}", "wlshowhidebots": "Option text in [[Special:Watchlist]]. Cf. {{msg-mw|rcshowhidebots}}.\n{{Identical|Bot}}", "wlshowhideliu": "Option text in [[Special:Watchlist]]. Cf. {{msg-mw|rcshowhideliu}}.\n{{Identical|Registered user}}",