* (bug 8018) Allow hiding minor edits from the watchlist
authorRob Church <robchurch@users.mediawiki.org>
Fri, 29 Dec 2006 13:48:36 +0000 (13:48 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 29 Dec 2006 13:48:36 +0000 (13:48 +0000)
RELEASE-NOTES
includes/SpecialPreferences.php
includes/SpecialWatchlist.php
includes/User.php
languages/messages/MessagesEn.php

index 9d62ef8..39586f2 100644 (file)
@@ -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 ==
 
index a796527..c1137ce 100644 (file)
@@ -881,7 +881,7 @@ class PreferencesForm {
                $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) );
                $wgOut->addHtml( '<br /><br />' );
 
-               $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( '</fieldset>' );
index 0a3cb9e..ab77980 100644 (file)
@@ -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 );
 
index 05d6be7..8f0ce27 100644 (file)
@@ -68,6 +68,7 @@ class User {
                'forceeditsummary',
                'watchlisthideown',
                'watchlisthidebots',
+               'watchlisthideminor',
                'ccmeonemails',
        );
 
index 5b3732e..517b37c 100644 (file)
@@ -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...',