Remove mediawiki.special.javaScriptTest module
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index 4b2d2d4..4848d01 100644 (file)
@@ -50,7 +50,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                }
 
                // 10 seconds server-side caching max
-               $this->getOutput()->setSquidMaxage( 10 );
+               $this->getOutput()->setCdnMaxage( 10 );
                // Check if the client has a cached version
                $lastmod = $this->checkLastModified();
                if ( $lastmod === false ) {
@@ -72,6 +72,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
        public function getDefaultOptions() {
                $opts = parent::getDefaultOptions();
                $user = $this->getUser();
+               $config = $this->getConfig();
 
                $opts->add( 'days', $user->getIntOption( 'rcdays' ) );
                $opts->add( 'limit', $user->getIntOption( 'rclimit' ) );
@@ -83,7 +84,10 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                $opts->add( 'hideliu', false );
                $opts->add( 'hidepatrolled', $user->getBoolOption( 'hidepatrolled' ) );
                $opts->add( 'hidemyself', false );
-               $opts->add( 'hidecategorization', $user->getBoolOption( 'hidecategorization' ) );
+
+               if ( $config->get( 'RCWatchCategoryMembership' ) ) {
+                       $opts->add( 'hidecategorization', $user->getBoolOption( 'hidecategorization' ) );
+               }
 
                $opts->add( 'categories', '' );
                $opts->add( 'categories_any', false );
@@ -291,7 +295,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
         *
         * @return array
         */
-       private function getFeedQuery() {
+       protected function getFeedQuery() {
                $query = array_filter( $this->getOptions()->getAllValues(), function ( $value ) {
                        // API handles empty parameters in a different way
                        return $value !== '';
@@ -399,7 +403,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                $extraOpts = $this->getExtraOptions( $opts );
                $extraOptsCount = count( $extraOpts );
                $count = 0;
-               $submit = ' ' . Xml::submitbutton( $this->msg( 'allpagessubmit' )->text() );
+               $submit = ' ' . Xml::submitbutton( $this->msg( 'recentchanges-submit' )->text() );
 
                $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
                foreach ( $extraOpts as $name => $optionRow ) {
@@ -681,6 +685,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                $lang = $this->getLanguage();
                $user = $this->getUser();
+               $config = $this->getConfig();
                if ( $options['from'] ) {
                        $note .= $this->msg( 'rcnotefrom' )
                                ->numParams( $options['limit'] )
@@ -694,12 +699,12 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                }
 
                # Sort data for display and make sure it's unique after we've added user data.
-               $linkLimits = $this->getConfig()->get( 'RCLinkLimits' );
+               $linkLimits = $config->get( 'RCLinkLimits' );
                $linkLimits[] = $options['limit'];
                sort( $linkLimits );
                $linkLimits = array_unique( $linkLimits );
 
-               $linkDays = $this->getConfig()->get( 'RCLinkDays' );
+               $linkDays = $config->get( 'RCLinkDays' );
                $linkDays[] = $options['days'];
                sort( $linkDays );
                $linkDays = array_unique( $linkDays );
@@ -727,10 +732,13 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                        'hideanons' => 'rcshowhideanons',
                        'hideliu' => 'rcshowhideliu',
                        'hidepatrolled' => 'rcshowhidepatr',
-                       'hidemyself' => 'rcshowhidemine',
-                       'hidecategorization' => 'rcshowhidecategorization'
+                       'hidemyself' => 'rcshowhidemine'
                );
 
+               if ( $config->get( 'RCWatchCategoryMembership' ) ) {
+                       $filters['hidecategorization'] = 'rcshowhidecategorization';
+               }
+
                $showhide = array( 'show', 'hide' );
 
                foreach ( $this->getCustomFilters() as $key => $params ) {