r53776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53775‎ | r53776 | r53777 >
Date:10:05, 26 July 2009
Author:aaron
Status:ok
Tags:
Comment:
Add diff links to suppress log for deleted revs too
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -345,7 +345,6 @@
346346 // If an edit was hidden from a page give a review link to the history
347347 } else if( self::typeAction($row,array('delete','suppress'),'revision','deleterevision') ) {
348348 if( count($paramArray) >= 2 ) {
349 - $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
350349 // Different revision types use different URL params...
351350 $key = $paramArray[0];
352351 // $paramArray[1] is a CSV of the IDs
@@ -353,21 +352,37 @@
354353 $query = $paramArray[1];
355354 $revert = array();
356355 // Diff link for single rev deletions
357 - if( ( $key === 'oldid' || $key == 'revision' ) && count($Ids) == 1 ) {
358 - $revert[] = $this->skin->link(
359 - $title,
360 - $this->message['diff'],
361 - array(),
362 - array(
363 - 'diff' => intval( $Ids[0] ),
364 - 'unhide' => 1
365 - ),
366 - array( 'known', 'noclasses' )
367 - );
 356+ if( count($Ids) == 1 ) {
 357+ // Live revision diffs...
 358+ if( in_array($key, array('oldid','revision')) ) {
 359+ $revert[] = $this->skin->link(
 360+ $title,
 361+ $this->message['diff'],
 362+ array(),
 363+ array(
 364+ 'diff' => intval( $Ids[0] ),
 365+ 'unhide' => 1
 366+ ),
 367+ array( 'known', 'noclasses' )
 368+ );
 369+ // Deleted revision diffs...
 370+ } else if( in_array($key, array('artimestamp','archive')) ) {
 371+ $revert[] = $this->skin->link(
 372+ SpecialPage::getTitleFor( 'Undelete' ),
 373+ $this->message['diff'],
 374+ array(),
 375+ array(
 376+ 'target' => $title->getPrefixedDBKey(),
 377+ 'diff' => 'prev',
 378+ 'timestamp' => $Ids[0]
 379+ ),
 380+ array( 'known', 'noclasses' )
 381+ );
 382+ }
368383 }
369384 // View/modify link...
370385 $revert[] = $this->skin->link(
371 - $revdel,
 386+ SpecialPage::getTitleFor( 'Revisiondelete' ),
372387 $this->message['revdel-restore'],
373388 array(),
374389 array(
@@ -377,7 +392,6 @@
378393 ),
379394 array( 'known', 'noclasses' )
380395 );
381 -
382396 // Pipe links
383397 $revert = wfMsg( 'parentheses', $wgLang->pipeList( $revert ) );
384398 }

Status & tagging log