r58245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58244‎ | r58245 | r58246 >
Date:06:37, 28 October 2009
Author:aaron
Status:ok
Tags:
Comment:
bug 21282 &unhide=1 on next/prev diff links if already viewing the diff
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceInterface.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceInterface.php
@@ -273,7 +273,10 @@
274274 # Make "previous revision link"
275275 $query['diff'] = 'prev';
276276 $query['oldid'] = $this->mOldid;
277 -
 277+ # Cascade unhide param in links for easy deletion browsing
 278+ if( $this->unhide ) {
 279+ $query['unhide'] = 1;
 280+ }
278281 $prevlink = $sk->link(
279282 $this->mTitle,
280283 wfMsgHtml( 'previousdiff' ),
@@ -286,10 +289,11 @@
287290 'noclasses'
288291 )
289292 );
 293+
290294 # Make "next revision link"
291295 $query['diff'] = 'next';
292296 $query['oldid'] = $this->mNewid;
293 -
 297+ # Skip next link on the top revision
294298 if( $this->mNewRev->isCurrent() ) {
295299 $nextlink = ' ';
296300 } else {
Index: trunk/phase3/includes/Article.php
@@ -3370,6 +3370,11 @@
33713371 return;
33723372 }
33733373
 3374+ # Cascade unhide param in links for easy deletion browsing
 3375+ $extraParams = array();
 3376+ if( $wgRequest->getVal('unhide') ) {
 3377+ $extraParams['unhide'] = 1;
 3378+ }
33743379 $revision = Revision::newFromId( $oldid );
33753380
33763381 $current = ( $oldid == $this->mLatest );
@@ -3383,7 +3388,7 @@
33843389 $this->mTitle,
33853390 wfMsgHtml( 'currentrevisionlink' ),
33863391 array(),
3387 - array(),
 3392+ $extraParams,
33883393 array( 'known', 'noclasses' )
33893394 );
33903395 $curdiff = $current
@@ -3395,7 +3400,7 @@
33963401 array(
33973402 'diff' => 'cur',
33983403 'oldid' => $oldid
3399 - ),
 3404+ ) + $extraParams,
34003405 array( 'known', 'noclasses' )
34013406 );
34023407 $prev = $this->mTitle->getPreviousRevisionID( $oldid ) ;
@@ -3407,7 +3412,7 @@
34083413 array(
34093414 'direction' => 'prev',
34103415 'oldid' => $oldid
3411 - ),
 3416+ ) + $extraParams,
34123417 array( 'known', 'noclasses' )
34133418 )
34143419 : wfMsgHtml( 'previousrevision' );
@@ -3419,7 +3424,7 @@
34203425 array(
34213426 'diff' => 'prev',
34223427 'oldid' => $oldid
3423 - ),
 3428+ ) + $extraParams,
34243429 array( 'known', 'noclasses' )
34253430 )
34263431 : wfMsgHtml( 'diff' );
@@ -3432,7 +3437,7 @@
34333438 array(
34343439 'direction' => 'next',
34353440 'oldid' => $oldid
3436 - ),
 3441+ ) + $extraParams,
34373442 array( 'known', 'noclasses' )
34383443 );
34393444 $nextdiff = $current
@@ -3444,7 +3449,7 @@
34453450 array(
34463451 'diff' => 'next',
34473452 'oldid' => $oldid
3448 - ),
 3453+ ) + $extraParams,
34493454 array( 'known', 'noclasses' )
34503455 );
34513456

Status & tagging log