From bf30705a1ccaf88d38ed5a2a3986f8cdc2d60f76 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 14 Jan 2009 22:31:25 +0000 Subject: [PATCH] Follow-up to r45698 "(bug 16969) Add show/hide to Preferences for option on specialpages added by FlaggedRevs" 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index c4aaeddbc1..26477362de 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -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' ) . '

' . - $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', - 'watchlisthideanons', 'watchlisthideliu', 'watchlisthidepatrolled' ) ) + $this->getToggles( $watchlistToggles ) ); if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) { -- 2.20.1