Hide category changes if feature is disabled
[lhc/web/wiklou.git] / includes / specials / SpecialWatchlist.php
index 20dde01..cc5c150 100644 (file)
@@ -118,10 +118,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
                $opts->add( 'hideliu', $user->getBoolOption( 'watchlisthideliu' ) );
                $opts->add( 'hidepatrolled', $user->getBoolOption( 'watchlisthidepatrolled' ) );
                $opts->add( 'hidemyself', $user->getBoolOption( 'watchlisthideown' ) );
-
-               if ( $this->getConfig()->get( 'RCWatchCategoryMembership' ) ) {
-                       $opts->add( 'hidecategorization', $user->getBoolOption( 'watchlisthidecategorization' ) );
-               }
+               $opts->add( 'hidecategorization', $user->getBoolOption( 'watchlisthidecategorization' ) );
 
                return $opts;
        }
@@ -532,9 +529,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 +557,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";
        }