Merge "SpecialWatchlist: Display actual number of days for the "all" option"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 25 Jan 2016 20:30:44 +0000 (20:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 25 Jan 2016 20:30:44 +0000 (20:30 +0000)
includes/specials/SpecialWatchlist.php
languages/i18n/en.json
languages/i18n/qqq.json

index 20dde01..6ebe9a8 100644 (file)
@@ -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<br />\n";
        }
 
index f875dcb..639af0f 100644 (file)
        "wlheader-showupdated": "Pages that have been changed since you last visited them are shown in <strong>bold</strong>.",
        "wlnote": "Below {{PLURAL:$1|is the last change|are the last <strong>$1</strong> changes}} in the last {{PLURAL:$2|hour|<strong>$2</strong> 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:",
index 499f4e7..61aaeaa 100644 (file)
        "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}}",