From 727a9fb2ceb7e46d634072ab06d17f9506d87519 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 29 Dec 2006 13:48:36 +0000 Subject: [PATCH] * (bug 8018) Allow hiding minor edits from the watchlist --- RELEASE-NOTES | 1 + includes/SpecialPreferences.php | 2 +- includes/SpecialWatchlist.php | 13 +++++++++++++ includes/User.php | 1 + languages/messages/MessagesEn.php | 3 +++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9d62ef8809..39586f20fd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -428,6 +428,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 6449) Throw a more definitive error message when installation fails due to an invalid database name * (bug 5827) Use full text for option link labels on Special:Watchlist +* (bug 8018) Allow hiding minor edits from the watchlist == Languages updated == diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index a796527e85..c1137cea2c 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -881,7 +881,7 @@ class PreferencesForm { $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) ); $wgOut->addHtml( '

' ); - $wgOut->addHtml( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots' ) ) ); + $wgOut->addHtml( $this->getToggles( array( 'watchlisthideown', 'watchlisthidebots', 'watchlisthideminor' ) ) ); $wgOut->addHtml( $this->getToggles( array( 'watchdefault', 'watchcreations', 'watchdeletion' ) ) ); $wgOut->addHtml( '' ); diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 0a3cb9e337..ab77980698 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -44,6 +44,7 @@ function wfSpecialWatchlist( $par ) { /* float */ 'days' => floatval( $wgUser->getOption( 'watchlistdays' ) ), /* 3.0 or 0.5, watch further below */ /* bool */ 'hideOwn' => (int)$wgUser->getBoolOption( 'watchlisthideown' ), /* bool */ 'hideBots' => (int)$wgUser->getBoolOption( 'watchlisthidebots' ), + /* bool */ 'hideMinor' => (int)$wgUser->getBoolOption( 'watchlisthideminor' ), /* ? */ 'namespace' => 'all', ); @@ -54,11 +55,13 @@ function wfSpecialWatchlist( $par ) { $prefs['days' ] = floatval( $wgUser->getOption( 'watchlistdays' ) ); $prefs['hideown' ] = $wgUser->getBoolOption( 'watchlisthideown' ); $prefs['hidebots'] = $wgUser->getBoolOption( 'watchlisthidebots' ); + $prefs['hideminor'] = $wgUser->getBoolOption( 'watchlisthideminor' ); # Get query variables $days = $wgRequest->getVal( 'days', $prefs['days'] ); $hideOwn = $wgRequest->getBool( 'hideOwn', $prefs['hideown'] ); $hideBots = $wgRequest->getBool( 'hideBots', $prefs['hidebots'] ); + $hideMinor = $wgRequest->getBool( 'hideMinor', $prefs['hideminor'] ); # Get namespace value, if supplied, and prepare a WHERE fragment $nameSpace = $wgRequest->getIntOrNull( 'namespace' ); @@ -136,6 +139,7 @@ function wfSpecialWatchlist( $par ) { wfAppendToArrayIfNotDefault('days' , $days , $defaults, $nondefaults); wfAppendToArrayIfNotDefault('hideOwn' , (int)$hideOwn , $defaults, $nondefaults); wfAppendToArrayIfNotDefault('hideBots' , (int)$hideBots, $defaults, $nondefaults); + wfAppendToArrayIfNotDefault( 'hideMinor', (int)$hideMinor, $defaults, $nondefaults ); wfAppendToArrayIfNotDefault('namespace', $nameSpace , $defaults, $nondefaults); if ( $days <= 0 ) { @@ -238,6 +242,7 @@ function wfSpecialWatchlist( $par ) { # Toggles $andHideOwn = $hideOwn ? "AND (rc_user <> $uid)" : ''; $andHideBots = $hideBots ? "AND (rc_bot = 0)" : ''; + $andHideMinor = $hideMinor ? 'AND rc_minor = 0' : ''; # Show watchlist header $header = ''; @@ -282,6 +287,7 @@ function wfSpecialWatchlist( $par ) { $andLatest $andHideOwn $andHideBots + $andHideMinor $nameSpaceClause ORDER BY rc_timestamp DESC $limitWatchlist"; @@ -316,6 +322,11 @@ function wfSpecialWatchlist( $par ) { $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults ); $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + # Hide/show minor edits + $label = $hideMinor ? wfMsgHtml( 'watchlist-show-minor' ) : wfMsgHtml( 'watchlist-hide-minor' ); + $linkBits = wfArrayToCGI( array( 'hideMinor' => 1 - (int)$hideMinor ), $nondefaults ); + $links[] = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); + $wgOut->addHTML( implode( ' | ', $links ) ); # Form for namespace filtering @@ -329,6 +340,8 @@ function wfSpecialWatchlist( $par ) { $form .= Xml::hidden( 'hideOwn', 1 ); if( $hideBots ) $form .= Xml::hidden( 'hideBots', 1 ); + if( $hideMinor ) + $form .= Xml::hidden( 'hideMinor', 1 ); $form .= Xml::closeElement( 'form' ); $wgOut->addHtml( $form ); diff --git a/includes/User.php b/includes/User.php index 05d6be74ca..8f0ce2716b 100644 --- a/includes/User.php +++ b/includes/User.php @@ -68,6 +68,7 @@ class User { 'forceeditsummary', 'watchlisthideown', 'watchlisthidebots', + 'watchlisthideminor', 'ccmeonemails', ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 5b3732e160..517b37c2fd 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -484,6 +484,7 @@ parent class in order maintain consistency across languages. 'tog-forceeditsummary' => 'Prompt me when entering a blank edit summary', 'tog-watchlisthideown' => 'Hide my edits from the watchlist', 'tog-watchlisthidebots' => 'Hide bot edits from the watchlist', +'tog-watchlisthideminor' => 'Hide minor edits from the watchlist', 'tog-nolangconversion' => 'Disable variants conversion', 'tog-ccmeonemails' => 'Send me copies of emails I send to other users', @@ -1635,6 +1636,8 @@ at the bottom of the screen (deleting a content page also deletes the accompanyi 'watchlist-hide-bots' => 'Hide bot edits', 'watchlist-show-own' => 'Show my edits', 'watchlist-hide-own' => 'Hide my edits', +'watchlist-show-minor' => 'Show minor edits', +'watchlist-hide-minor' => 'Hide minor edits', 'wldone' => 'Done.', # Displayed when you click the "watch" button and it's in the process of watching 'watching' => 'Watching...', -- 2.20.1