3 * Special page which uses a ChangesList to show query results.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 * @ingroup SpecialPage
23 use MediaWiki\Logger\LoggerFactory
;
24 use Wikimedia\Rdbms\ResultWrapper
;
25 use Wikimedia\Rdbms\FakeResultWrapper
;
26 use Wikimedia\Rdbms\IDatabase
;
29 * Special page which uses a ChangesList to show query results.
30 * @todo Way too many public functions, most of them should be protected
32 * @ingroup SpecialPage
34 abstract class ChangesListSpecialPage
extends SpecialPage
{
36 * Preference name for saved queries. Subclasses that use saved queries should override this.
39 protected static $savedQueriesPreferenceName;
44 /** @var FormOptions */
48 protected $customFilters;
50 // Order of both groups and filters is significant; first is top-most priority,
51 // descending from there.
52 // 'showHideSuffix' is a shortcut to and avoid spelling out
53 // details specific to subclasses here.
55 * Definition information for the filters and their groups
57 * The value is $groupDefinition, a parameter to the ChangesListFilterGroup constructor.
58 * However, priority is dynamically added for the core groups, to ease maintenance.
60 * Groups are displayed to the user in the structured UI. However, if necessary,
61 * all of the filters in a group can be configured to only display on the
62 * unstuctured UI, in which case you don't need a group title. This is done in
63 * getFilterGroupDefinitionFromLegacyCustomFilters, for example.
65 * @var array $filterGroupDefinitions
67 private $filterGroupDefinitions;
69 // Same format as filterGroupDefinitions, but for a single group (reviewStatus)
70 // that is registered conditionally.
71 private $reviewStatusFilterGroupDefinition;
73 // Single filter registered conditionally
74 private $hideCategorizationFilterDefinition;
77 * Filter groups, and their contained filters
78 * This is an associative array (with group name as key) of ChangesListFilterGroup objects.
80 * @var array $filterGroups
82 protected $filterGroups = [];
84 public function __construct( $name, $restriction ) {
85 parent
::__construct( $name, $restriction );
87 $this->filterGroupDefinitions
= [
89 'name' => 'registration',
90 'title' => 'rcfilters-filtergroup-registration',
91 'class' => ChangesListBooleanFilterGroup
::class,
95 // rcshowhideliu-show, rcshowhideliu-hide,
97 'showHideSuffix' => 'showhideliu',
99 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
100 &$query_options, &$join_conds
102 $conds[] = 'rc_user = 0';
104 'isReplacedInStructuredUi' => true,
108 'name' => 'hideanons',
109 // rcshowhideanons-show, rcshowhideanons-hide,
111 'showHideSuffix' => 'showhideanons',
113 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
114 &$query_options, &$join_conds
116 $conds[] = 'rc_user != 0';
118 'isReplacedInStructuredUi' => true,
124 'name' => 'userExpLevel',
125 'title' => 'rcfilters-filtergroup-userExpLevel',
126 'class' => ChangesListStringOptionsFilterGroup
::class,
127 'isFullCoverage' => true,
130 'name' => 'unregistered',
131 'label' => 'rcfilters-filter-user-experience-level-unregistered-label',
132 'description' => 'rcfilters-filter-user-experience-level-unregistered-description',
133 'cssClassSuffix' => 'user-unregistered',
134 'isRowApplicableCallable' => function ( $ctx, $rc ) {
135 return !$rc->getAttribute( 'rc_user' );
139 'name' => 'registered',
140 'label' => 'rcfilters-filter-user-experience-level-registered-label',
141 'description' => 'rcfilters-filter-user-experience-level-registered-description',
142 'cssClassSuffix' => 'user-registered',
143 'isRowApplicableCallable' => function ( $ctx, $rc ) {
144 return $rc->getAttribute( 'rc_user' );
148 'name' => 'newcomer',
149 'label' => 'rcfilters-filter-user-experience-level-newcomer-label',
150 'description' => 'rcfilters-filter-user-experience-level-newcomer-description',
151 'cssClassSuffix' => 'user-newcomer',
152 'isRowApplicableCallable' => function ( $ctx, $rc ) {
153 $performer = $rc->getPerformer();
154 return $performer && $performer->isLoggedIn() &&
155 $performer->getExperienceLevel() === 'newcomer';
160 'label' => 'rcfilters-filter-user-experience-level-learner-label',
161 'description' => 'rcfilters-filter-user-experience-level-learner-description',
162 'cssClassSuffix' => 'user-learner',
163 'isRowApplicableCallable' => function ( $ctx, $rc ) {
164 $performer = $rc->getPerformer();
165 return $performer && $performer->isLoggedIn() &&
166 $performer->getExperienceLevel() === 'learner';
170 'name' => 'experienced',
171 'label' => 'rcfilters-filter-user-experience-level-experienced-label',
172 'description' => 'rcfilters-filter-user-experience-level-experienced-description',
173 'cssClassSuffix' => 'user-experienced',
174 'isRowApplicableCallable' => function ( $ctx, $rc ) {
175 $performer = $rc->getPerformer();
176 return $performer && $performer->isLoggedIn() &&
177 $performer->getExperienceLevel() === 'experienced';
181 'default' => ChangesListStringOptionsFilterGroup
::NONE
,
182 'queryCallable' => [ $this, 'filterOnUserExperienceLevel' ],
186 'name' => 'authorship',
187 'title' => 'rcfilters-filtergroup-authorship',
188 'class' => ChangesListBooleanFilterGroup
::class,
191 'name' => 'hidemyself',
192 'label' => 'rcfilters-filter-editsbyself-label',
193 'description' => 'rcfilters-filter-editsbyself-description',
194 // rcshowhidemine-show, rcshowhidemine-hide,
196 'showHideSuffix' => 'showhidemine',
198 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
199 &$query_options, &$join_conds
201 $user = $ctx->getUser();
202 $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $user->getName() );
204 'cssClassSuffix' => 'self',
205 'isRowApplicableCallable' => function ( $ctx, $rc ) {
206 return $ctx->getUser()->equals( $rc->getPerformer() );
210 'name' => 'hidebyothers',
211 'label' => 'rcfilters-filter-editsbyother-label',
212 'description' => 'rcfilters-filter-editsbyother-description',
214 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
215 &$query_options, &$join_conds
217 $user = $ctx->getUser();
218 $conds[] = 'rc_user_text = ' . $dbr->addQuotes( $user->getName() );
220 'cssClassSuffix' => 'others',
221 'isRowApplicableCallable' => function ( $ctx, $rc ) {
222 return !$ctx->getUser()->equals( $rc->getPerformer() );
229 'name' => 'automated',
230 'title' => 'rcfilters-filtergroup-automated',
231 'class' => ChangesListBooleanFilterGroup
::class,
234 'name' => 'hidebots',
235 'label' => 'rcfilters-filter-bots-label',
236 'description' => 'rcfilters-filter-bots-description',
237 // rcshowhidebots-show, rcshowhidebots-hide,
239 'showHideSuffix' => 'showhidebots',
241 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
242 &$query_options, &$join_conds
244 $conds[] = 'rc_bot = 0';
246 'cssClassSuffix' => 'bot',
247 'isRowApplicableCallable' => function ( $ctx, $rc ) {
248 return $rc->getAttribute( 'rc_bot' );
252 'name' => 'hidehumans',
253 'label' => 'rcfilters-filter-humans-label',
254 'description' => 'rcfilters-filter-humans-description',
256 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
257 &$query_options, &$join_conds
259 $conds[] = 'rc_bot = 1';
261 'cssClassSuffix' => 'human',
262 'isRowApplicableCallable' => function ( $ctx, $rc ) {
263 return !$rc->getAttribute( 'rc_bot' );
269 // reviewStatus (conditional)
272 'name' => 'significance',
273 'title' => 'rcfilters-filtergroup-significance',
274 'class' => ChangesListBooleanFilterGroup
::class,
278 'name' => 'hideminor',
279 'label' => 'rcfilters-filter-minor-label',
280 'description' => 'rcfilters-filter-minor-description',
281 // rcshowhideminor-show, rcshowhideminor-hide,
283 'showHideSuffix' => 'showhideminor',
285 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
286 &$query_options, &$join_conds
288 $conds[] = 'rc_minor = 0';
290 'cssClassSuffix' => 'minor',
291 'isRowApplicableCallable' => function ( $ctx, $rc ) {
292 return $rc->getAttribute( 'rc_minor' );
296 'name' => 'hidemajor',
297 'label' => 'rcfilters-filter-major-label',
298 'description' => 'rcfilters-filter-major-description',
300 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
301 &$query_options, &$join_conds
303 $conds[] = 'rc_minor = 1';
305 'cssClassSuffix' => 'major',
306 'isRowApplicableCallable' => function ( $ctx, $rc ) {
307 return !$rc->getAttribute( 'rc_minor' );
314 'name' => 'lastRevision',
315 'title' => 'rcfilters-filtergroup-lastRevision',
316 'class' => ChangesListBooleanFilterGroup
::class,
320 'name' => 'hidelastrevision',
321 'label' => 'rcfilters-filter-lastrevision-label',
322 'description' => 'rcfilters-filter-lastrevision-description',
324 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
325 &$query_options, &$join_conds ) {
326 $conds[] = 'rc_this_oldid <> page_latest';
328 'cssClassSuffix' => 'last',
329 'isRowApplicableCallable' => function ( $ctx, $rc ) {
330 return $rc->getAttribute( 'rc_this_oldid' ) === $rc->getAttribute( 'page_latest' );
334 'name' => 'hidepreviousrevisions',
335 'label' => 'rcfilters-filter-previousrevision-label',
336 'description' => 'rcfilters-filter-previousrevision-description',
338 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
339 &$query_options, &$join_conds ) {
340 $conds[] = 'rc_this_oldid = page_latest';
342 'cssClassSuffix' => 'previous',
343 'isRowApplicableCallable' => function ( $ctx, $rc ) {
344 return $rc->getAttribute( 'rc_this_oldid' ) !== $rc->getAttribute( 'page_latest' );
350 // With extensions, there can be change types that will not be hidden by any of these.
352 'name' => 'changeType',
353 'title' => 'rcfilters-filtergroup-changetype',
354 'class' => ChangesListBooleanFilterGroup
::class,
358 'name' => 'hidepageedits',
359 'label' => 'rcfilters-filter-pageedits-label',
360 'description' => 'rcfilters-filter-pageedits-description',
363 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
364 &$query_options, &$join_conds
366 $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_EDIT
);
368 'cssClassSuffix' => 'src-mw-edit',
369 'isRowApplicableCallable' => function ( $ctx, $rc ) {
370 return $rc->getAttribute( 'rc_source' ) === RecentChange
::SRC_EDIT
;
374 'name' => 'hidenewpages',
375 'label' => 'rcfilters-filter-newpages-label',
376 'description' => 'rcfilters-filter-newpages-description',
379 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
380 &$query_options, &$join_conds
382 $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_NEW
);
384 'cssClassSuffix' => 'src-mw-new',
385 'isRowApplicableCallable' => function ( $ctx, $rc ) {
386 return $rc->getAttribute( 'rc_source' ) === RecentChange
::SRC_NEW
;
390 // hidecategorization
394 'label' => 'rcfilters-filter-logactions-label',
395 'description' => 'rcfilters-filter-logactions-description',
398 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
399 &$query_options, &$join_conds
401 $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_LOG
);
403 'cssClassSuffix' => 'src-mw-log',
404 'isRowApplicableCallable' => function ( $ctx, $rc ) {
405 return $rc->getAttribute( 'rc_source' ) === RecentChange
::SRC_LOG
;
413 $this->reviewStatusFilterGroupDefinition
= [
415 'name' => 'reviewStatus',
416 'title' => 'rcfilters-filtergroup-reviewstatus',
417 'class' => ChangesListBooleanFilterGroup
::class,
421 'name' => 'hidepatrolled',
422 'label' => 'rcfilters-filter-patrolled-label',
423 'description' => 'rcfilters-filter-patrolled-description',
424 // rcshowhidepatr-show, rcshowhidepatr-hide
426 'showHideSuffix' => 'showhidepatr',
428 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
429 &$query_options, &$join_conds
431 $conds[] = 'rc_patrolled = 0';
433 'cssClassSuffix' => 'patrolled',
434 'isRowApplicableCallable' => function ( $ctx, $rc ) {
435 return $rc->getAttribute( 'rc_patrolled' );
439 'name' => 'hideunpatrolled',
440 'label' => 'rcfilters-filter-unpatrolled-label',
441 'description' => 'rcfilters-filter-unpatrolled-description',
443 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
444 &$query_options, &$join_conds
446 $conds[] = 'rc_patrolled = 1';
448 'cssClassSuffix' => 'unpatrolled',
449 'isRowApplicableCallable' => function ( $ctx, $rc ) {
450 return !$rc->getAttribute( 'rc_patrolled' );
457 $this->hideCategorizationFilterDefinition
= [
458 'name' => 'hidecategorization',
459 'label' => 'rcfilters-filter-categorization-label',
460 'description' => 'rcfilters-filter-categorization-description',
461 // rcshowhidecategorization-show, rcshowhidecategorization-hide.
462 // wlshowhidecategorization
463 'showHideSuffix' => 'showhidecategorization',
466 'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
467 &$query_options, &$join_conds
469 $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_CATEGORIZE
);
471 'cssClassSuffix' => 'src-mw-categorize',
472 'isRowApplicableCallable' => function ( $ctx, $rc ) {
473 return $rc->getAttribute( 'rc_source' ) === RecentChange
::SRC_CATEGORIZE
;
479 * Check if filters are in conflict and guaranteed to return no results.
483 protected function areFiltersInConflict() {
484 $opts = $this->getOptions();
485 /** @var ChangesListFilterGroup $group */
486 foreach ( $this->getFilterGroups() as $group ) {
487 if ( $group->getConflictingGroups() ) {
490 " specifies conflicts with other groups but these are not supported yet."
494 /** @var ChangesListFilter $conflictingFilter */
495 foreach ( $group->getConflictingFilters() as $conflictingFilter ) {
496 if ( $conflictingFilter->activelyInConflictWithGroup( $group, $opts ) ) {
501 /** @var ChangesListFilter $filter */
502 foreach ( $group->getFilters() as $filter ) {
503 /** @var ChangesListFilter $conflictingFilter */
504 foreach ( $filter->getConflictingFilters() as $conflictingFilter ) {
506 $conflictingFilter->activelyInConflictWithFilter( $filter, $opts ) &&
507 $filter->activelyInConflictWithFilter( $conflictingFilter, $opts )
521 * Main execution point
523 * @param string $subpage
525 public function execute( $subpage ) {
526 $this->rcSubpage
= $subpage;
528 $rows = $this->getRows();
529 $opts = $this->getOptions();
530 if ( $rows === false ) {
531 $rows = new FakeResultWrapper( [] );
534 // Used by Structured UI app to get results without MW chrome
535 if ( $this->getRequest()->getVal( 'action' ) === 'render' ) {
536 $this->getOutput()->setArticleBodyOnly( true );
539 // Used by "live update" and "view newest" to check
540 // if there's new changes with minimal data transfer
541 if ( $this->getRequest()->getBool( 'peek' ) ) {
542 $code = $rows->numRows() > 0 ?
200 : 204;
543 $this->getOutput()->setStatusCode( $code );
547 $batch = new LinkBatch
;
548 foreach ( $rows as $row ) {
549 $batch->add( NS_USER
, $row->rc_user_text
);
550 $batch->add( NS_USER_TALK
, $row->rc_user_text
);
551 $batch->add( $row->rc_namespace
, $row->rc_title
);
552 if ( $row->rc_source
=== RecentChange
::SRC_LOG
) {
553 $formatter = LogFormatter
::newFromRow( $row );
554 foreach ( $formatter->getPreloadTitles() as $title ) {
555 $batch->addObj( $title );
562 $this->outputHeader();
564 $this->webOutput( $rows, $opts );
568 if ( $this->getConfig()->get( 'EnableWANCacheReaper' ) ) {
569 // Clean up any bad page entries for titles showing up in RC
570 DeferredUpdates
::addUpdate( new WANCacheReapUpdate(
572 LoggerFactory
::getInstance( 'objectcache' )
576 $this->includeRcFiltersApp();
580 * Include the modules and configuration for the RCFilters app.
581 * Conditional on the user having the feature enabled.
583 * If it is disabled, add a <body> class marking that
585 protected function includeRcFiltersApp() {
586 $out = $this->getOutput();
587 if ( $this->isStructuredFilterUiEnabled() ) {
588 $jsData = $this->getStructuredFilterJsData();
591 foreach ( $jsData['messageKeys'] as $key ) {
592 $messages[$key] = $this->msg( $key )->plain();
595 $out->addBodyClasses( 'mw-rcfilters-enabled' );
598 ResourceLoader
::makeInlineScript(
599 ResourceLoader
::makeMessageSetScript( $messages )
603 $out->addJsConfigVars( 'wgStructuredChangeFilters', $jsData['groups'] );
605 $out->addJsConfigVars(
606 'wgRCFiltersChangeTags',
607 $this->buildChangeTagList()
609 $out->addJsConfigVars(
610 'StructuredChangeFiltersDisplayConfig',
612 'maxDays' => (int)$this->getConfig()->get( 'RCMaxAge' ) / ( 24 * 3600 ), // Translate to days
613 'limitArray' => $this->getConfig()->get( 'RCLinkLimits' ),
614 'limitDefault' => $this->getDefaultLimit(),
615 'daysArray' => $this->getConfig()->get( 'RCLinkDays' ),
616 'daysDefault' => $this->getDefaultDays(),
620 $out->addJsConfigVars(
621 'StructuredChangeFiltersLiveUpdatePollingRate',
622 $this->getConfig()->get( 'StructuredChangeFiltersLiveUpdatePollingRate' )
625 if ( static::$savedQueriesPreferenceName ) {
626 $savedQueries = FormatJson
::decode(
627 $this->getUser()->getOption( static::$savedQueriesPreferenceName )
629 if ( $savedQueries && isset( $savedQueries->default ) ) {
630 // If there is a default saved query, show a loading spinner,
631 // since the frontend is going to reload the results
632 $out->addBodyClasses( 'mw-rcfilters-ui-loading' );
634 $out->addJsConfigVars(
635 'wgStructuredChangeFiltersSavedQueriesPreferenceName',
636 static::$savedQueriesPreferenceName
640 $out->addBodyClasses( 'mw-rcfilters-disabled' );
645 * Fetch the change tags list for the front end
647 * @return Array Tag data
649 protected function buildChangeTagList() {
650 $explicitlyDefinedTags = array_fill_keys( ChangeTags
::listExplicitlyDefinedTags(), 0 );
651 $softwareActivatedTags = array_fill_keys( ChangeTags
::listSoftwareActivatedTags(), 0 );
653 // Hit counts disabled for perf reasons, see T169997
655 $tagStats = ChangeTags::tagUsageStatistics();
656 $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags, $tagStats );
659 arsort( $tagHitCounts );
661 $tagHitCounts = array_merge( $explicitlyDefinedTags, $softwareActivatedTags );
663 // Build the list and data
665 foreach ( $tagHitCounts as $tagName => $hits ) {
667 // Only get active tags
668 isset( $explicitlyDefinedTags[ $tagName ] ) ||
669 isset( $softwareActivatedTags[ $tagName ] )
672 $desc = ChangeTags
::tagLongDescriptionMessage( $tagName, $this->getContext() );
676 'label' => Sanitizer
::stripAllTags(
677 ChangeTags
::tagDescription( $tagName, $this->getContext() )
679 'description' => $desc ? Sanitizer
::stripAllTags( $desc->parse() ) : '',
680 'cssClass' => Sanitizer
::escapeClass( 'mw-tag-' . $tagName ),
686 // Instead of sorting by hit count (disabled, see above), sort by display name
687 usort( $result, function ( $a, $b ) {
688 return strcasecmp( $a['label'], $b['label'] );
695 * Add the "no results" message to the output
697 protected function outputNoResults() {
698 $this->getOutput()->addHTML(
699 '<div class="mw-changeslist-empty">' .
700 $this->msg( 'recentchanges-noresult' )->parse() .
706 * Get the database result for this special page instance. Used by ApiFeedRecentChanges.
708 * @return bool|ResultWrapper Result or false
710 public function getRows() {
711 $opts = $this->getOptions();
718 $this->buildQuery( $tables, $fields, $conds, $query_options, $join_conds, $opts );
720 return $this->doMainQuery( $tables, $fields, $conds, $query_options, $join_conds, $opts );
724 * Get the current FormOptions for this request
726 * @return FormOptions
728 public function getOptions() {
729 if ( $this->rcOptions
=== null ) {
730 $this->rcOptions
= $this->setup( $this->rcSubpage
);
733 return $this->rcOptions
;
737 * Register all filters and their groups (including those from hooks), plus handle
738 * conflicts and defaults.
740 * You might want to customize these in the same method, in subclasses. You can
741 * call getFilterGroup to access a group, and (on the group) getFilter to access a
742 * filter, then make necessary modfications to the filter or group (e.g. with
745 protected function registerFilters() {
746 $this->registerFiltersFromDefinitions( $this->filterGroupDefinitions
);
748 // Make sure this is not being transcluded (we don't want to show this
749 // information to all users just because the user that saves the edit can
750 // patrol or is logged in)
751 if ( !$this->including() && $this->getUser()->useRCPatrol() ) {
752 $this->registerFiltersFromDefinitions( $this->reviewStatusFilterGroupDefinition
);
755 $changeTypeGroup = $this->getFilterGroup( 'changeType' );
757 if ( $this->getConfig()->get( 'RCWatchCategoryMembership' ) ) {
758 $transformedHideCategorizationDef = $this->transformFilterDefinition(
759 $this->hideCategorizationFilterDefinition
762 $transformedHideCategorizationDef['group'] = $changeTypeGroup;
764 $hideCategorization = new ChangesListBooleanFilter(
765 $transformedHideCategorizationDef
769 Hooks
::run( 'ChangesListSpecialPageStructuredFilters', [ $this ] );
771 $unstructuredGroupDefinition =
772 $this->getFilterGroupDefinitionFromLegacyCustomFilters(
773 $this->getCustomFilters()
775 $this->registerFiltersFromDefinitions( [ $unstructuredGroupDefinition ] );
777 $userExperienceLevel = $this->getFilterGroup( 'userExpLevel' );
778 $registered = $userExperienceLevel->getFilter( 'registered' );
779 $registered->setAsSupersetOf( $userExperienceLevel->getFilter( 'newcomer' ) );
780 $registered->setAsSupersetOf( $userExperienceLevel->getFilter( 'learner' ) );
781 $registered->setAsSupersetOf( $userExperienceLevel->getFilter( 'experienced' ) );
783 $categoryFilter = $changeTypeGroup->getFilter( 'hidecategorization' );
784 $logactionsFilter = $changeTypeGroup->getFilter( 'hidelog' );
785 $pagecreationFilter = $changeTypeGroup->getFilter( 'hidenewpages' );
787 $significanceTypeGroup = $this->getFilterGroup( 'significance' );
788 $hideMinorFilter = $significanceTypeGroup->getFilter( 'hideminor' );
790 // categoryFilter is conditional; see registerFilters
791 if ( $categoryFilter !== null ) {
792 $hideMinorFilter->conflictsWith(
794 'rcfilters-hideminor-conflicts-typeofchange-global',
795 'rcfilters-hideminor-conflicts-typeofchange',
796 'rcfilters-typeofchange-conflicts-hideminor'
799 $hideMinorFilter->conflictsWith(
801 'rcfilters-hideminor-conflicts-typeofchange-global',
802 'rcfilters-hideminor-conflicts-typeofchange',
803 'rcfilters-typeofchange-conflicts-hideminor'
805 $hideMinorFilter->conflictsWith(
807 'rcfilters-hideminor-conflicts-typeofchange-global',
808 'rcfilters-hideminor-conflicts-typeofchange',
809 'rcfilters-typeofchange-conflicts-hideminor'
814 * Transforms filter definition to prepare it for constructor.
816 * See overrides of this method as well.
818 * @param array $filterDefinition Original filter definition
820 * @return array Transformed definition
822 protected function transformFilterDefinition( array $filterDefinition ) {
823 return $filterDefinition;
827 * Register filters from a definition object
829 * Array specifying groups and their filters; see Filter and
830 * ChangesListFilterGroup constructors.
832 * There is light processing to simplify core maintenance.
833 * @param array $definition
835 protected function registerFiltersFromDefinitions( array $definition ) {
836 $autoFillPriority = -1;
837 foreach ( $definition as $groupDefinition ) {
838 if ( !isset( $groupDefinition['priority'] ) ) {
839 $groupDefinition['priority'] = $autoFillPriority;
841 // If it's explicitly specified, start over the auto-fill
842 $autoFillPriority = $groupDefinition['priority'];
847 $className = $groupDefinition['class'];
848 unset( $groupDefinition['class'] );
850 foreach ( $groupDefinition['filters'] as &$filterDefinition ) {
851 $filterDefinition = $this->transformFilterDefinition( $filterDefinition );
854 $this->registerFilterGroup( new $className( $groupDefinition ) );
859 * Get filter group definition from legacy custom filters
861 * @param array $customFilters Custom filters from legacy hooks
862 * @return array Group definition
864 protected function getFilterGroupDefinitionFromLegacyCustomFilters( array $customFilters ) {
865 // Special internal unstructured group
866 $unstructuredGroupDefinition = [
867 'name' => 'unstructured',
868 'class' => ChangesListBooleanFilterGroup
::class,
869 'priority' => -1, // Won't display in structured
873 foreach ( $customFilters as $name => $params ) {
874 $unstructuredGroupDefinition['filters'][] = [
876 'showHide' => $params['msg'],
877 'default' => $params['default'],
881 return $unstructuredGroupDefinition;
885 * Register all the filters, including legacy hook-driven ones.
886 * Then create a FormOptions object with options as specified by the user
888 * @param array $parameters
890 * @return FormOptions
892 public function setup( $parameters ) {
893 $this->registerFilters();
895 $opts = $this->getDefaultOptions();
897 $opts = $this->fetchOptionsFromRequest( $opts );
899 // Give precedence to subpage syntax
900 if ( $parameters !== null ) {
901 $this->parseParameters( $parameters, $opts );
904 $this->validateOptions( $opts );
910 * Get a FormOptions object containing the default options. By default, returns
911 * some basic options. The filters listed explicitly here are overriden in this
912 * method, in subclasses, but most filters (e.g. hideminor, userExpLevel filters,
913 * and more) are structured. Structured filters are overriden in registerFilters.
916 * @return FormOptions
918 public function getDefaultOptions() {
919 $opts = new FormOptions();
920 $structuredUI = $this->isStructuredFilterUiEnabled();
921 // If urlversion=2 is set, ignore the filter defaults and set them all to false/empty
922 $useDefaults = $this->getRequest()->getInt( 'urlversion' ) !== 2;
925 /** @var ChangesListFilterGroup $filterGroup */
926 foreach ( $this->filterGroups
as $filterGroup ) {
927 // URL parameters can be per-group, like 'userExpLevel',
928 // or per-filter, like 'hideminor'.
929 if ( $filterGroup->isPerGroupRequestParameter() ) {
930 $opts->add( $filterGroup->getName(), $useDefaults ?
$filterGroup->getDefault() : '' );
932 /** @var ChangesListBooleanFilter $filter */
933 foreach ( $filterGroup->getFilters() as $filter ) {
934 $opts->add( $filter->getName(), $useDefaults ?
$filter->getDefault( $structuredUI ) : false );
939 $opts->add( 'namespace', '', FormOptions
::STRING );
940 $opts->add( 'invert', false );
941 $opts->add( 'associated', false );
942 $opts->add( 'urlversion', 1 );
943 $opts->add( 'tagfilter', '' );
949 * Register a structured changes list filter group
951 * @param ChangesListFilterGroup $group
953 public function registerFilterGroup( ChangesListFilterGroup
$group ) {
954 $groupName = $group->getName();
956 $this->filterGroups
[$groupName] = $group;
960 * Gets the currently registered filters groups
962 * @return array Associative array of ChangesListFilterGroup objects, with group name as key
964 protected function getFilterGroups() {
965 return $this->filterGroups
;
969 * Gets a specified ChangesListFilterGroup by name
971 * @param string $groupName Name of group
973 * @return ChangesListFilterGroup|null Group, or null if not registered
975 public function getFilterGroup( $groupName ) {
976 return isset( $this->filterGroups
[$groupName] ) ?
977 $this->filterGroups
[$groupName] :
981 // Currently, this intentionally only includes filters that display
982 // in the structured UI. This can be changed easily, though, if we want
983 // to include data on filters that use the unstructured UI. messageKeys is a
984 // special top-level value, with the value being an array of the message keys to
985 // send to the client.
987 * Gets structured filter information needed by JS
989 * @return array Associative array
990 * * array $return['groups'] Group data
991 * * array $return['messageKeys'] Array of message keys
993 public function getStructuredFilterJsData() {
999 usort( $this->filterGroups
, function ( $a, $b ) {
1000 return $b->getPriority() - $a->getPriority();
1003 foreach ( $this->filterGroups
as $groupName => $group ) {
1004 $groupOutput = $group->getJsData( $this );
1005 if ( $groupOutput !== null ) {
1006 $output['messageKeys'] = array_merge(
1007 $output['messageKeys'],
1008 $groupOutput['messageKeys']
1011 unset( $groupOutput['messageKeys'] );
1012 $output['groups'][] = $groupOutput;
1020 * Get custom show/hide filters using deprecated ChangesListSpecialPageFilters
1023 * @return array Map of filter URL param names to properties (msg/default)
1025 protected function getCustomFilters() {
1026 if ( $this->customFilters
=== null ) {
1027 $this->customFilters
= [];
1028 Hooks
::run( 'ChangesListSpecialPageFilters', [ $this, &$this->customFilters
], '1.29' );
1031 return $this->customFilters
;
1035 * Fetch values for a FormOptions object from the WebRequest associated with this instance.
1037 * Intended for subclassing, e.g. to add a backwards-compatibility layer.
1039 * @param FormOptions $opts
1040 * @return FormOptions
1042 protected function fetchOptionsFromRequest( $opts ) {
1043 $opts->fetchValuesFromRequest( $this->getRequest() );
1049 * Process $par and put options found in $opts. Used when including the page.
1051 * @param string $par
1052 * @param FormOptions $opts
1054 public function parseParameters( $par, FormOptions
$opts ) {
1055 $stringParameterNameSet = [];
1056 $hideParameterNameSet = [];
1058 // URL parameters can be per-group, like 'userExpLevel',
1059 // or per-filter, like 'hideminor'.
1061 foreach ( $this->filterGroups
as $filterGroup ) {
1062 if ( $filterGroup->isPerGroupRequestParameter() ) {
1063 $stringParameterNameSet[$filterGroup->getName()] = true;
1064 } elseif ( $filterGroup->getType() === ChangesListBooleanFilterGroup
::TYPE
) {
1065 foreach ( $filterGroup->getFilters() as $filter ) {
1066 $hideParameterNameSet[$filter->getName()] = true;
1071 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
1072 foreach ( $bits as $bit ) {
1074 if ( isset( $hideParameterNameSet[$bit] ) ) {
1075 // hidefoo => hidefoo=true
1077 } elseif ( isset( $hideParameterNameSet["hide$bit"] ) ) {
1078 // foo => hidefoo=false
1079 $opts["hide$bit"] = false;
1080 } elseif ( preg_match( '/^(.*)=(.*)$/', $bit, $m ) ) {
1081 if ( isset( $stringParameterNameSet[$m[1]] ) ) {
1082 $opts[$m[1]] = $m[2];
1089 * Validate a FormOptions object generated by getDefaultOptions() with values already populated.
1091 * @param FormOptions $opts
1093 public function validateOptions( FormOptions
$opts ) {
1094 if ( $this->fixContradictoryOptions( $opts ) ) {
1095 $query = wfArrayToCgi( $this->convertParamsForLink( $opts->getChangedValues() ) );
1096 $this->getOutput()->redirect( $this->getPageTitle()->getCanonicalURL( $query ) );
1101 * Fix invalid options by resetting pairs that should never appear together.
1103 * @param FormOptions $opts
1104 * @return bool True if any option was reset
1106 private function fixContradictoryOptions( FormOptions
$opts ) {
1107 $fixed = $this->fixBackwardsCompatibilityOptions( $opts );
1109 foreach ( $this->filterGroups
as $filterGroup ) {
1110 if ( $filterGroup instanceof ChangesListBooleanFilterGroup
) {
1111 $filters = $filterGroup->getFilters();
1113 if ( count( $filters ) === 1 ) {
1114 // legacy boolean filters should not be considered
1118 $allInGroupEnabled = array_reduce(
1120 function ( $carry, $filter ) use ( $opts ) {
1121 return $carry && $opts[ $filter->getName() ];
1123 /* initialValue */ count( $filters ) > 0
1126 if ( $allInGroupEnabled ) {
1127 foreach ( $filters as $filter ) {
1128 $opts[ $filter->getName() ] = false;
1140 * Fix a special case (hideanons=1 and hideliu=1) in a special way, for backwards
1143 * This is deprecated and may be removed.
1145 * @param FormOptions $opts
1146 * @return bool True if this change was mode
1148 private function fixBackwardsCompatibilityOptions( FormOptions
$opts ) {
1149 if ( $opts['hideanons'] && $opts['hideliu'] ) {
1150 $opts->reset( 'hideanons' );
1151 if ( !$opts['hidebots'] ) {
1152 $opts->reset( 'hideliu' );
1153 $opts['hidehumans'] = 1;
1163 * Convert parameters values from true/false to 1/0
1164 * so they are not omitted by wfArrayToCgi()
1167 * @param array $params
1170 protected function convertParamsForLink( $params ) {
1171 foreach ( $params as &$value ) {
1172 if ( $value === false ) {
1181 * Sets appropriate tables, fields, conditions, etc. depending on which filters
1182 * the user requested.
1184 * @param array &$tables Array of tables; see IDatabase::select $table
1185 * @param array &$fields Array of fields; see IDatabase::select $vars
1186 * @param array &$conds Array of conditions; see IDatabase::select $conds
1187 * @param array &$query_options Array of query options; see IDatabase::select $options
1188 * @param array &$join_conds Array of join conditions; see IDatabase::select $join_conds
1189 * @param FormOptions $opts
1191 protected function buildQuery( &$tables, &$fields, &$conds, &$query_options,
1192 &$join_conds, FormOptions
$opts
1194 $dbr = $this->getDB();
1195 $isStructuredUI = $this->isStructuredFilterUiEnabled();
1197 foreach ( $this->filterGroups
as $filterGroup ) {
1198 // URL parameters can be per-group, like 'userExpLevel',
1199 // or per-filter, like 'hideminor'.
1200 if ( $filterGroup->isPerGroupRequestParameter() ) {
1201 $filterGroup->modifyQuery( $dbr, $this, $tables, $fields, $conds,
1202 $query_options, $join_conds, $opts[$filterGroup->getName()] );
1204 foreach ( $filterGroup->getFilters() as $filter ) {
1205 if ( $filter->isActive( $opts, $isStructuredUI ) ) {
1206 $filter->modifyQuery( $dbr, $this, $tables, $fields, $conds,
1207 $query_options, $join_conds );
1213 // Namespace filtering
1214 if ( $opts[ 'namespace' ] !== '' ) {
1215 $namespaces = explode( ';', $opts[ 'namespace' ] );
1217 if ( $opts[ 'associated' ] ) {
1218 $associatedNamespaces = array_map(
1220 return MWNamespace
::getAssociated( $ns );
1224 $namespaces = array_unique( array_merge( $namespaces, $associatedNamespaces ) );
1227 if ( count( $namespaces ) === 1 ) {
1228 $operator = $opts[ 'invert' ] ?
'!=' : '=';
1229 $value = $dbr->addQuotes( reset( $namespaces ) );
1231 $operator = $opts[ 'invert' ] ?
'NOT IN' : 'IN';
1232 sort( $namespaces );
1233 $value = '(' . $dbr->makeList( $namespaces ) . ')';
1235 $conds[] = "rc_namespace $operator $value";
1242 * @param array $tables Array of tables; see IDatabase::select $table
1243 * @param array $fields Array of fields; see IDatabase::select $vars
1244 * @param array $conds Array of conditions; see IDatabase::select $conds
1245 * @param array $query_options Array of query options; see IDatabase::select $options
1246 * @param array $join_conds Array of join conditions; see IDatabase::select $join_conds
1247 * @param FormOptions $opts
1248 * @return bool|ResultWrapper Result or false
1250 protected function doMainQuery( $tables, $fields, $conds,
1251 $query_options, $join_conds, FormOptions
$opts
1253 $tables[] = 'recentchanges';
1254 $fields = array_merge( RecentChange
::selectFields(), $fields );
1256 ChangeTags
::modifyDisplayQuery(
1265 if ( !$this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds,
1271 $dbr = $this->getDB();
1273 return $dbr->select(
1283 protected function runMainQueryHook( &$tables, &$fields, &$conds,
1284 &$query_options, &$join_conds, $opts
1287 'ChangesListSpecialPageQuery',
1288 [ $this->getName(), &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ]
1293 * Return a IDatabase object for reading
1297 protected function getDB() {
1298 return wfGetDB( DB_REPLICA
);
1302 * Send output to the OutputPage object, only called if not used feeds
1304 * @param ResultWrapper $rows Database rows
1305 * @param FormOptions $opts
1307 public function webOutput( $rows, $opts ) {
1308 if ( !$this->including() ) {
1309 $this->outputFeedLinks();
1310 $this->doHeader( $opts, $rows->numRows() );
1313 $this->outputChangesList( $rows, $opts );
1317 * Output feed links.
1319 public function outputFeedLinks() {
1320 // nothing by default
1324 * Build and output the actual changes list.
1326 * @param ResultWrapper $rows Database rows
1327 * @param FormOptions $opts
1329 abstract public function outputChangesList( $rows, $opts );
1332 * Set the text to be displayed above the changes
1334 * @param FormOptions $opts
1335 * @param int $numRows Number of rows in the result to show after this header
1337 public function doHeader( $opts, $numRows ) {
1338 $this->setTopText( $opts );
1340 // @todo Lots of stuff should be done here.
1342 $this->setBottomText( $opts );
1346 * Send the text to be displayed before the options. Should use $this->getOutput()->addWikiText()
1347 * or similar methods to print the text.
1349 * @param FormOptions $opts
1351 public function setTopText( FormOptions
$opts ) {
1352 // nothing by default
1356 * Send the text to be displayed after the options. Should use $this->getOutput()->addWikiText()
1357 * or similar methods to print the text.
1359 * @param FormOptions $opts
1361 public function setBottomText( FormOptions
$opts ) {
1362 // nothing by default
1366 * Get options to be displayed in a form
1367 * @todo This should handle options returned by getDefaultOptions().
1368 * @todo Not called by anything in this class (but is in subclasses), should be
1369 * called by something… doHeader() maybe?
1371 * @param FormOptions $opts
1374 public function getExtraOptions( $opts ) {
1379 * Return the legend displayed within the fieldset
1383 public function makeLegend() {
1384 $context = $this->getContext();
1385 $user = $context->getUser();
1386 # The legend showing what the letters and stuff mean
1387 $legend = Html
::openElement( 'dl' ) . "\n";
1388 # Iterates through them and gets the messages for both letter and tooltip
1389 $legendItems = $context->getConfig()->get( 'RecentChangesFlags' );
1390 if ( !( $user->useRCPatrol() ||
$user->useNPPatrol() ) ) {
1391 unset( $legendItems['unpatrolled'] );
1393 foreach ( $legendItems as $key => $item ) { # generate items of the legend
1394 $label = isset( $item['legend'] ) ?
$item['legend'] : $item['title'];
1395 $letter = $item['letter'];
1396 $cssClass = isset( $item['class'] ) ?
$item['class'] : $key;
1398 $legend .= Html
::element( 'dt',
1399 [ 'class' => $cssClass ], $context->msg( $letter )->text()
1401 Html
::rawElement( 'dd',
1402 [ 'class' => Sanitizer
::escapeClass( 'mw-changeslist-legend-' . $key ) ],
1403 $context->msg( $label )->parse()
1407 $legend .= Html
::rawElement( 'dt',
1408 [ 'class' => 'mw-plusminus-pos' ],
1409 $context->msg( 'recentchanges-legend-plusminus' )->parse()
1411 $legend .= Html
::element(
1413 [ 'class' => 'mw-changeslist-legend-plusminus' ],
1414 $context->msg( 'recentchanges-label-plusminus' )->text()
1416 $legend .= Html
::closeElement( 'dl' ) . "\n";
1418 $legendHeading = $this->isStructuredFilterUiEnabled() ?
1419 $context->msg( 'rcfilters-legend-heading' )->parse() :
1420 $context->msg( 'recentchanges-legend-heading' )->parse();
1424 '<div class="mw-changeslist-legend">' .
1426 '<div class="mw-collapsible-content">' . $legend . '</div>' .
1433 * Add page-specific modules.
1435 protected function addModules() {
1436 $out = $this->getOutput();
1437 // Styles and behavior for the legend box (see makeLegend())
1438 $out->addModuleStyles( [
1439 'mediawiki.special.changeslist.legend',
1440 'mediawiki.special.changeslist',
1442 $out->addModules( 'mediawiki.special.changeslist.legend.js' );
1444 if ( $this->isStructuredFilterUiEnabled() ) {
1445 $out->addModules( 'mediawiki.rcfilters.filters.ui' );
1446 $out->addModuleStyles( 'mediawiki.rcfilters.filters.base.styles' );
1450 protected function getGroupName() {
1455 * Filter on users' experience levels; this will not be called if nothing is
1458 * @param string $specialPageClassName Class name of current special page
1459 * @param IContextSource $context Context, for e.g. user
1460 * @param IDatabase $dbr Database, for addQuotes, makeList, and similar
1461 * @param array &$tables Array of tables; see IDatabase::select $table
1462 * @param array &$fields Array of fields; see IDatabase::select $vars
1463 * @param array &$conds Array of conditions; see IDatabase::select $conds
1464 * @param array &$query_options Array of query options; see IDatabase::select $options
1465 * @param array &$join_conds Array of join conditions; see IDatabase::select $join_conds
1466 * @param array $selectedExpLevels The allowed active values, sorted
1467 * @param int $now Number of seconds since the UNIX epoch, or 0 if not given
1470 public function filterOnUserExperienceLevel( $specialPageClassName, $context, $dbr,
1471 &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedExpLevels, $now = 0
1473 global $wgLearnerEdits,
1474 $wgExperiencedUserEdits,
1475 $wgLearnerMemberSince,
1476 $wgExperiencedUserMemberSince;
1480 // If all levels are selected, don't filter
1481 if ( count( $selectedExpLevels ) === $LEVEL_COUNT ) {
1485 // both 'registered' and 'unregistered', experience levels, if any, are included in 'registered'
1487 in_array( 'registered', $selectedExpLevels ) &&
1488 in_array( 'unregistered', $selectedExpLevels )
1493 // 'registered' but not 'unregistered', experience levels, if any, are included in 'registered'
1495 in_array( 'registered', $selectedExpLevels ) &&
1496 !in_array( 'unregistered', $selectedExpLevels )
1498 $conds[] = 'rc_user != 0';
1502 if ( $selectedExpLevels === [ 'unregistered' ] ) {
1503 $conds[] = 'rc_user = 0';
1508 $join_conds['user'] = [ 'LEFT JOIN', 'rc_user = user_id' ];
1513 $secondsPerDay = 86400;
1514 $learnerCutoff = $now - $wgLearnerMemberSince * $secondsPerDay;
1515 $experiencedUserCutoff = $now - $wgExperiencedUserMemberSince * $secondsPerDay;
1517 $aboveNewcomer = $dbr->makeList(
1519 'user_editcount >= ' . intval( $wgLearnerEdits ),
1520 'user_registration <= ' . $dbr->addQuotes( $dbr->timestamp( $learnerCutoff ) ),
1525 $aboveLearner = $dbr->makeList(
1527 'user_editcount >= ' . intval( $wgExperiencedUserEdits ),
1528 'user_registration <= ' .
1529 $dbr->addQuotes( $dbr->timestamp( $experiencedUserCutoff ) ),
1536 if ( in_array( 'unregistered', $selectedExpLevels ) ) {
1537 $selectedExpLevels = array_diff( $selectedExpLevels, [ 'unregistered' ] );
1538 $conditions[] = 'rc_user = 0';
1541 if ( $selectedExpLevels === [ 'newcomer' ] ) {
1542 $conditions[] = "NOT ( $aboveNewcomer )";
1543 } elseif ( $selectedExpLevels === [ 'learner' ] ) {
1544 $conditions[] = $dbr->makeList(
1545 [ $aboveNewcomer, "NOT ( $aboveLearner )" ],
1548 } elseif ( $selectedExpLevels === [ 'experienced' ] ) {
1549 $conditions[] = $aboveLearner;
1550 } elseif ( $selectedExpLevels === [ 'learner', 'newcomer' ] ) {
1551 $conditions[] = "NOT ( $aboveLearner )";
1552 } elseif ( $selectedExpLevels === [ 'experienced', 'newcomer' ] ) {
1553 $conditions[] = $dbr->makeList(
1554 [ "NOT ( $aboveNewcomer )", $aboveLearner ],
1557 } elseif ( $selectedExpLevels === [ 'experienced', 'learner' ] ) {
1558 $conditions[] = $aboveNewcomer;
1559 } elseif ( $selectedExpLevels === [ 'experienced', 'learner', 'newcomer' ] ) {
1560 $conditions[] = 'rc_user != 0';
1563 if ( count( $conditions ) > 1 ) {
1564 $conds[] = $dbr->makeList( $conditions, IDatabase
::LIST_OR
);
1565 } elseif ( count( $conditions ) === 1 ) {
1566 $conds[] = reset( $conditions );
1571 * Check whether the structured filter UI is enabled
1575 public function isStructuredFilterUiEnabled() {
1576 if ( $this->getRequest()->getBool( 'rcfilters' ) ) {
1580 if ( $this->getConfig()->get( 'StructuredChangeFiltersShowPreference' ) ) {
1581 return !$this->getUser()->getOption( 'rcenhancedfilters-disable' );
1583 return $this->getUser()->getOption( 'rcenhancedfilters' );
1588 * Check whether the structured filter UI is enabled by default (regardless of
1589 * this particular user's setting)
1593 public function isStructuredFilterUiEnabledByDefault() {
1594 if ( $this->getConfig()->get( 'StructuredChangeFiltersShowPreference' ) ) {
1595 return !$this->getUser()->getDefaultOption( 'rcenhancedfilters-disable' );
1597 return $this->getUser()->getDefaultOption( 'rcenhancedfilters' );
1601 abstract function getDefaultLimit();
1604 * Get the default value of the number of days to display when loading
1606 * Supports fractional values, and should be cast to a float.
1610 abstract function getDefaultDays();