From cd3efbc8aa19138e742efa6735f0cc28fb02694a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 13 Jan 2009 13:46:02 +0000 Subject: [PATCH] (bug 16969) Add show/hide to Preferences for option on specialpages added by FlaggedRevs --- includes/User.php | 6 +++++- includes/specials/SpecialPreferences.php | 4 +++- includes/specials/SpecialRecentchanges.php | 4 ++-- includes/specials/SpecialWatchlist.php | 2 +- languages/messages/MessagesEn.php | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/includes/User.php b/includes/User.php index 41aaf5bfa4..d1f285893e 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1013,9 +1013,13 @@ class User { * @return \type{\arrayof{\string}} Array of user toggle names */ static function getToggles() { - global $wgContLang; + global $wgContLang, $wgUseRCPatrol; $extraToggles = array(); wfRunHooks( 'UserToggles', array( &$extraToggles ) ); + if( $wgUseRCPatrol ) { + $extraToggles[] = 'hidepatrolled'; + $extraToggles[] = 'watchlisthidepatrolled'; + } return array_merge( self::$mToggles, $extraToggles, $wgContLang->getExtraUserToggles() ); } diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index 04ac7597d5..16adc0948e 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -1093,6 +1093,7 @@ class PreferencesForm { ); $toggles[] = 'hideminor'; + $toggles[] = 'hidepatrolled'; if( $wgRCShowWatchingUsers ) $toggles[] = 'shownumberswatching'; $toggles[] = 'usenewrc'; @@ -1112,7 +1113,8 @@ 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' ) ) + $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', + 'watchlisthideanons', 'watchlisthideliu', 'watchlisthidepatrolled' ) ) ); if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) ) { diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 8c14e1fcb9..6729c91556 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -23,11 +23,11 @@ class SpecialRecentChanges extends SpecialPage { $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) ); $opts->add( 'from', '' ); - $opts->add( 'hideminor', (bool)$wgUser->getOption( 'hideminor' ) ); + $opts->add( 'hideminor', $wgUser->getBoolOption( 'hideminor' ) ); $opts->add( 'hidebots', true ); $opts->add( 'hideanons', false ); $opts->add( 'hideliu', false ); - $opts->add( 'hidepatrolled', false ); + $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'hidepatrolled' ) ); $opts->add( 'hidemyself', false ); $opts->add( 'namespace', '', FormOptions::INTNULL ); diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 61dd6b3eea..6e7fb6ea2c 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -54,7 +54,7 @@ function wfSpecialWatchlist( $par ) { /* bool */ 'hideBots' => (int)$wgUser->getBoolOption( 'watchlisthidebots' ), /* bool */ 'hideAnons' => (int)$wgUser->getBoolOption( 'watchlisthideanons' ), /* bool */ 'hideLiu' => (int)$wgUser->getBoolOption( 'watchlisthideliu' ), - /* bool */ 'hidePatrolled' => (int)$wgUser->getBoolOption( 'watchlisthidepatrolled' ), // TODO + /* bool */ 'hidePatrolled' => (int)$wgUser->getBoolOption( 'watchlisthidepatrolled' ), /* bool */ 'hideOwn' => (int)$wgUser->getBoolOption( 'watchlisthideown' ), /* ? */ 'namespace' => 'all', /* ? */ 'invert' => false, diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e7acf03758..66a26bc587 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -490,6 +490,7 @@ XHTML id names. 'tog-highlightbroken' => 'Format broken links like this (alternative: like this?).', 'tog-justify' => 'Justify paragraphs', 'tog-hideminor' => 'Hide minor edits in recent changes', +'tog-hidepatrolled' => 'Hide patrolled edits in recent changes', 'tog-extendwatchlist' => 'Expand watchlist to show all applicable changes', 'tog-usenewrc' => 'Enhanced recent changes (JavaScript)', 'tog-numberheadings' => 'Auto-number headings', @@ -524,6 +525,7 @@ XHTML id names. 'tog-watchlisthideminor' => 'Hide minor edits from the watchlist', 'tog-watchlisthideliu' => 'Hide edits by logged in users from the watchlist', 'tog-watchlisthideanons' => 'Hide edits by anonymous users from the watchlist', +'tog-watchlisthidepatrolled' => 'Hide patrolled edits from the watchlist', 'tog-nolangconversion' => 'Disable variants conversion', # only translate this message to other languages if you have to change it 'tog-ccmeonemails' => 'Send me copies of e-mails I send to other users', 'tog-diffonly' => 'Do not show page content below diffs', -- 2.20.1