'previewontop' => 1,
'rcdays' => 7,
'rcenhancedfilters' => 0,
+ 'rcenhancedfilters-disable' => 0,
'rclimit' => 50,
'rows' => 25, // @deprecated since 1.29 No longer used in core
'showhiddencats' => 0,
*/
$wgUseRCPatrol = true;
+/**
+ * Whether a preference is displayed for structured change filters.
+ * If false, no preference is displayed and structured change filters are disabled.
+ * If true, structured change filters are *enabled* by default, and a preference is displayed
+ * that lets users disable them.
+ *
+ * Temporary variable during development and will be removed.
+ *
+ * @since 1.30
+ */
+$wgStructuredChangeFiltersShowPreference = false;
+
/**
* Whether to show the new experimental views (like namespaces, tags, and users) in
* RecentChanges filters
+ *
+ * Temporary variable during development and will be removed.
*/
$wgStructuredChangeFiltersEnableExperimentalViews = false;
/**
* Whether to allow users to use the experimental live update feature in the new RecentChanges UI
+ *
+ * Temporary variable during development and will be removed.
*/
$wgStructuredChangeFiltersEnableLiveUpdate = false;
/**
* Whether to enable RCFilters app on Special:Watchlist
+ *
+ * Temporary variable during development and will be removed.
*/
$wgStructuredChangeFiltersOnWatchlist = false;
'label-message' => 'tog-shownumberswatching',
];
}
+
+ if ( $config->get( 'StructuredChangeFiltersShowPreference' ) ) {
+ $defaultPreferences['rcenhancedfilters-disable'] = [
+ 'type' => 'toggle',
+ 'section' => 'rc/advancedrc',
+ 'label-message' => 'rcfilters-preference-label',
+ 'help-message' => 'rcfilters-preference-help',
+ ];
+ }
}
/**
* @return bool
*/
public function isStructuredFilterUiEnabled() {
- return $this->getUser()->getOption( 'rcenhancedfilters' );
+ if ( $this->getRequest()->getBool( 'rcfilters' ) ) {
+ return true;
+ }
+
+ if ( $this->getConfig()->get( 'StructuredChangeFiltersShowPreference' ) ) {
+ return !$this->getUser()->getOption( 'rcenhancedfilters-disable' );
+ } else {
+ return $this->getUser()->getOption( 'rcenhancedfilters' );
+ }
+ }
+
+ /**
+ * Check whether the structured filter UI is enabled by default (regardless of
+ * this particular user's setting)
+ *
+ * @return bool
+ */
+ public function isStructuredFilterUiEnabledByDefault() {
+ if ( $this->getConfig()->get( 'StructuredChangeFiltersShowPreference' ) ) {
+ return !$this->getUser()->getDefaultOption( 'rcenhancedfilters-disable' );
+ } else {
+ return $this->getUser()->getDefaultOption( 'rcenhancedfilters' );
+ }
}
abstract function getDefaultLimit();
}
public function isStructuredFilterUiEnabled() {
- return parent::isStructuredFilterUiEnabled()
- && ( $this->getConfig()->get( 'StructuredChangeFiltersOnWatchlist' )
- || $this->getRequest()->getBool( 'rcfilters' ) );
+ return $this->getRequest()->getBool( 'rcfilters' ) || (
+ $this->getConfig()->get( 'StructuredChangeFiltersOnWatchlist' ) &&
+ $this->getUser()->getOption( 'rcenhancedfilters' )
+ );
+ }
+
+ public function isStructuredFilterUiEnabledByDefault() {
+ return $this->getConfig()->get( 'StructuredChangeFiltersOnWatchlist' ) &&
+ $this->getUser()->getDefaultOption( 'rcenhancedfilters' );
}
/**
"rcfilters-watchlist-markseen-button": "Mark all changes as seen",
"rcfilters-watchlist-edit-watchlist-button": "Edit your list of watched pages",
"rcfilters-watchlist-showupdated": "Changes to pages you haven't visited since the changes occurred are in <strong>bold</strong>, with solid markers.",
+ "rcfilters-preference-label": "Hide the improved version of Recent Changes",
+ "rcfilters-preference-help": "Rolls back the 2017 interface redesign and all tools added then and since.",
"rcnotefrom": "Below {{PLURAL:$5|is the change|are the changes}} since <strong>$3, $4</strong> (up to <strong>$1</strong> shown).",
"rclistfromreset": "Reset date selection",
"rclistfrom": "Show new changes starting from $2, $3",
"rcfilters-watchlist-markseen-button": "Label for the button to mark all changes as seen on [[Special:Watchlist]] when using the structured filters interface.",
"rcfilters-watchlist-edit-watchlist-button": "Label for the button to edit the watched pages on [[Special:Watchlist]] when using the structured filters interface.\n\nCf. {{msg-mw|watchlisttools-edit}}.",
"rcfilters-watchlist-showupdated": "Message at the top of [[Special:Watchlist]] when the Structured filters are enabled that describes what unseen changes look like.\n\nCf. {{msg-mw|wlheader-showupdated}}",
+ "rcfilters-preference-label": "Option in RecentChanges tab of [[Special:Preferences]].",
+ "rcfilters-preference-help": "Explanation for the option in the RecentChanges tab of [[Special:Preferences]].",
"rcnotefrom": "This message is displayed at [[Special:RecentChanges]] when viewing recentchanges from some specific time.\n\nThe corresponding message is {{msg-mw|Rclistfrom}}.\n\nParameters:\n* $1 - the maximum number of changes that are displayed\n* $2 - (Optional) a date and time\n* $3 - a date\n* $4 - a time\n* $5 - Number of changes are displayed, for use with PLURAL",
"rclistfromreset": "Used on [[Special:RecentChanges]] to reset a selection of a certain date range.",
"rclistfrom": "Used on [[Special:RecentChanges]]. Parameters:\n* $1 - (Currently not use) date and time. The date and the time adds to the rclistfrom description.\n* $2 - time. The time adds to the rclistfrom link description (with split of date and time).\n* $3 - date. The date adds to the rclistfrom link description (with split of date and time).\n\nThe corresponding message is {{msg-mw|Rcnotefrom}}.",