Follow-up to r45698 "(bug 16969) Add show/hide to Preferences for option on specialpa...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 14 Jan 2009 22:31:25 +0000 (22:31 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 14 Jan 2009 22:31:25 +0000 (22:31 +0000)
That also added toggles in core for showing/hiding patrolled edits by default in watchlist & RC, but they were being shown regardless of whether patrolling was enabled.
Now hiding them if patrolling is disabled.

includes/specials/SpecialPreferences.php

index c4aaedd..2647736 100644 (file)
@@ -1067,7 +1067,7 @@ class PreferencesForm {
                $wgOut->addHTML( Xml::closeElement( 'fieldset' ) );
 
                # Recent changes
-               global $wgRCMaxAge;
+               global $wgRCMaxAge, $wgUseRCPatrol;
                $wgOut->addHTML(
                        Xml::fieldset( wfMsg( 'prefs-rc' ) ) .
                        Xml::openElement( 'table' ) .
@@ -1093,7 +1093,8 @@ class PreferencesForm {
                );
 
                $toggles[] = 'hideminor';
-               $toggles[] = 'hidepatrolled';
+               if( $wgUseRCPatrol )
+                       $toggles[] = 'hidepatrolled';
                if( $wgRCShowWatchingUsers )
                        $toggles[] = 'shownumberswatching';
                $toggles[] = 'usenewrc';
@@ -1104,6 +1105,12 @@ class PreferencesForm {
                );
 
                # Watchlist
+               $watchlistToggles = array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown',
+                               'watchlisthideanons', 'watchlisthideliu' );
+               if( $wgUseRCPatrol ) {
+                       $watchlistToggles[] = 'watchlisthidepatrolled';
+               }
+
                $wgOut->addHTML( 
                        Xml::fieldset( wfMsg( 'prefs-watchlist' ) ) .
                        Xml::inputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) . ' ' .
@@ -1113,8 +1120,7 @@ class PreferencesForm {
                        Xml::inputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) . ' ' .
                        wfMsgHTML( 'prefs-watchlist-edits-max' ) .
                        '<br /><br />' .
-                       $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown',
-                               'watchlisthideanons', 'watchlisthideliu', 'watchlisthidepatrolled' ) )
+                       $this->getToggles( $watchlistToggles )
                );
 
                if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) {