r48664 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48663‎ | r48664 | r48665 >
Date:01:07, 22 March 2009
Author:aaron
Status:ok
Tags:
Comment:
Added diff links to revision delete log items
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -39,7 +39,8 @@
4040 // Precache various messages
4141 if( !isset( $this->message ) ) {
4242 $messages = array( 'revertmerge', 'protect_change', 'unblocklink', 'change-blocklink',
43 - 'revertmove', 'undeletelink', 'revdel-restore', 'rev-delundel', 'hist', 'pipe-separator' );
 43+ 'revertmove', 'undeletelink', 'revdel-restore', 'rev-delundel', 'hist', 'diff',
 44+ 'pipe-separator' );
4445 foreach( $messages as $msg ) {
4546 $this->message[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) );
4647 }
@@ -291,8 +292,17 @@
292293 foreach( $Ids as $n => $id ) {
293294 $revParams .= '&' . urlencode($key) . '[]=' . urlencode($id);
294295 }
295 - $revert = '(' . $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'],
296 - 'target=' . $title->getPrefixedUrl() . $revParams ) . ')';
 296+ $revert = array();
 297+ // Diff link for single rev deletions
 298+ if( $key === 'oldid' && count($Ids) == 1 ) {
 299+ $token = urlencode( $wgUser->editToken( intval($Ids[0]) ) );
 300+ $revert[] = $this->skin->makeKnownLinkObj( $title, $this->message['diff'],
 301+ 'diff='.intval($Ids[0])."&unhide=1&token=$token" );
 302+ }
 303+ // View/modify link...
 304+ $revert[] = $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'],
 305+ 'target=' . $title->getPrefixedUrl() . $revParams );
 306+ $revert = '(' . implode(' | ',$revert) . ')';
297307 }
298308 // Hidden log items, give review link
299309 } else if( self::typeAction($row,array('delete','suppress'),'event','deleterevision') ) {
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1335,7 +1335,7 @@
13361336 'logdelete-logentry' => 'changed event visibility of [[$1]]',
13371337 'revdelete-success' => "'''Revision visibility successfully set.'''",
13381338 'logdelete-success' => "'''Log visibility successfully set.'''",
1339 -'revdel-restore' => 'Change visibility',
 1339+'revdel-restore' => 'change visibility',
13401340 'pagehist' => 'Page history',
13411341 'deletedhist' => 'Deleted history',
13421342 'revdelete-content' => 'content',

Status & tagging log