Merge "Move around "ا" to after "آ" and not before"
[lhc/web/wiklou.git] / includes / specialpage / ChangesListSpecialPage.php
index 52db51a..5f54404 100644 (file)
@@ -598,7 +598,9 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                [
                                        'maxDays' => (int)$this->getConfig()->get( 'RCMaxAge' ) / ( 24 * 3600 ), // Translate to days
                                        'limitArray' => $this->getConfig()->get( 'RCLinkLimits' ),
+                                       'limitDefault' => $this->getDefaultLimit(),
                                        'daysArray' => $this->getConfig()->get( 'RCLinkDays' ),
+                                       'daysDefault' => $this->getDefaultDays(),
                                ]
                        );
                }
@@ -902,6 +904,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                $opts->add( 'invert', false );
                $opts->add( 'associated', false );
                $opts->add( 'urlversion', 1 );
+               $opts->add( 'tagfilter', '' );
 
                return $opts;
        }
@@ -1153,6 +1156,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                &$join_conds, FormOptions $opts
        ) {
                $dbr = $this->getDB();
+               $isStructuredUI = $this->isStructuredFilterUiEnabled();
 
                foreach ( $this->filterGroups as $filterGroup ) {
                        // URL parameters can be per-group, like 'userExpLevel',
@@ -1162,7 +1166,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                        $query_options, $join_conds, $opts[$filterGroup->getName()] );
                        } else {
                                foreach ( $filterGroup->getFilters() as $filter ) {
-                                       if ( $opts[$filter->getName()] ) {
+                                       if ( $filter->isActive( $opts, $isStructuredUI ) ) {
                                                $filter->modifyQuery( $dbr, $this, $tables, $fields, $conds,
                                                        $query_options, $join_conds );
                                        }
@@ -1532,7 +1536,11 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         *
         * @return bool
         */
-       protected function isStructuredFilterUiEnabled() {
+       public function isStructuredFilterUiEnabled() {
                return $this->getUser()->getOption( 'rcenhancedfilters' );
        }
+
+       abstract function getDefaultLimit();
+
+       abstract function getDefaultDays();
 }