r13000 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12999‎ | r13000 | r13001 >
Date:11:57, 11 February 2006
Author:timstarling
Status:old
Tags:
Comment:
Hide own edits from RC, mostly by Jason. No show/hide link by default, you need to add it in if you want it.
Modified paths:
  • /branches/REL1_5/phase3/includes/SpecialRecentchanges.php (modified) (history)

Diff [purge]

Index: branches/REL1_5/phase3/includes/SpecialRecentchanges.php
@@ -33,6 +33,7 @@
3434 /* bool */ 'hidebots' => true,
3535 /* bool */ 'hideliu' => false,
3636 /* bool */ 'hidepatrolled' => false,
 37+ /* bool */ 'hidemyself' => false,
3738 /* text */ 'from' => '',
3839 /* text */ 'namespace' => null,
3940 /* bool */ 'invert' => false,
@@ -52,8 +53,7 @@
5354 $limit = $wgRequest->getInt( 'limit', $limit );
5455
5556 /* order of selection: url > preferences > default */
56 - $hideminor = $wgRequest->getBool( 'hideminor', $wgUser->getOption( 'hideminor') ? true : $defaults['hideminor'] );
57 -
 57+ $hideminor = $wgRequest->getBool( 'hideminor', $wgUser->getOption( 'hideminor') ? true : $defaults['hideminor'] );
5858
5959 # As a feed, use limited settings only
6060 if( $feedFormat ) {
@@ -69,6 +69,7 @@
7070 $hidebots = $wgRequest->getBool( 'hidebots', $defaults['hidebots'] );
7171 $hideliu = $wgRequest->getBool( 'hideliu', $defaults['hideliu'] );
7272 $hidepatrolled = $wgRequest->getBool( 'hidepatrolled', $defaults['hidepatrolled'] );
 73+ $hidemyself = $wgRequest->getBool ( 'hidemyself', $defaults['hidemyself'] );
7374 $from = $wgRequest->getVal( 'from', $defaults['from'] );
7475
7576 # Get query parameters from path
@@ -81,6 +82,7 @@
8283 if ( 'minor' == $bit ) $hideminor = 0;
8384 if ( 'hideliu' == $bit ) $hideliu = 1;
8485 if ( 'hidepatrolled' == $bit ) $hidepatrolled = 1;
 86+ if ( 'hidemyself' == $bit ) $hidemyself = 1;
8587
8688 if ( is_numeric( $bit ) ) {
8789 $limit = $bit;
@@ -129,8 +131,9 @@
130132
131133 $hidem = $hideminor ? 'AND rc_minor=0' : '';
132134 $hidem .= $hidebots ? ' AND rc_bot=0' : '';
133 - $hidem .= $hideliu ? ' AND rc_user=0' : '';
 135+ $hidem .= ( $hideliu && !$hidemyself ) ? ' AND rc_user=0' : '';
134136 $hidem .= $hidepatrolled ? ' AND rc_patrolled=0' : '';
 137+ $hidem .= $hidemyself ? ' AND rc_user <> '.$wgUser->getID() : '';
135138 $hidem .= is_null( $namespace ) ? '' : ' AND rc_namespace' . ($invert ? '!=' : '=') . $namespace;
136139
137140 // This is the big thing!
@@ -183,6 +186,7 @@
184187 wfAppendToArrayIfNotDefault( 'hidebots', $hidebots, $defaults, $nondefaults);
185188 wfAppendToArrayIfNotDefault( 'hideliu', $hideliu, $defaults, $nondefaults);
186189 wfAppendToArrayIfNotDefault( 'hidepatrolled', $hidepatrolled, $defaults, $nondefaults);
 190+ wfAppendToArrayIfNotDefault( 'hidemyself', $hidemyself, $defaults, $nondefaults);
187191 wfAppendToArrayIfNotDefault( 'from', $from, $defaults, $nondefaults);
188192 wfAppendToArrayIfNotDefault( 'namespace', $namespace, $defaults, $nondefaults);
189193 wfAppendToArrayIfNotDefault( 'invert', $invert, $defaults, $nondefaults);
@@ -358,7 +362,7 @@
359363 * Used by Recentchangeslinked
360364 */
361365 function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall = false, $minorLink = '',
362 - $botLink = '', $liuLink = '', $patrLink = '' ) {
 366+ $botLink = '', $liuLink = '', $patrLink = '', $myselfLink = '' ) {
363367 if ($more != '') $more .= '&';
364368 $cl = rcCountLink( 50, $days, $page, $more ) . ' | ' .
365369 rcCountLink( 100, $days, $page, $more ) . ' | ' .
@@ -371,7 +375,7 @@
372376 rcDaysLink( $limit, 14, $page, $more ) . ' | ' .
373377 rcDaysLink( $limit, 30, $page, $more ) .
374378 ( $doall ? ( ' | ' . rcDaysLink( $limit, 0, $page, $more ) ) : '' );
375 - $shm = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink );
 379+ $shm = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink );
376380 $note = wfMsg( 'rclinks', $cl, $dl, $shm );
377381 return $note;
378382 }
@@ -430,8 +434,9 @@
431435 array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults);
432436 $patrLink = makeOptionsLink( $showhide[1-$options['hidepatrolled']],
433437 array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
434 -
435 - $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink );
 438+ $myselfLink = makeOptionsLink( $showhide[1-$options['hidemyself']],
 439+ array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults);
 440+ $hl = wfMsg( 'showhideminor', $minorLink, $botLink, $liuLink, $patrLink, $myselfLink );
436441
437442 // show from this onward link
438443 $now = $wgLang->timeanddate( wfTimestampNow(), true );

Status & tagging log