r50178 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50177‎ | r50178 | r50179 >
Date:13:40, 4 May 2009
Author:aaron
Status:ok
Tags:
Comment:
(bug 18666) Add show/hide links to deletedcontribs
Modified paths:
  • /trunk/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php
@@ -106,10 +106,9 @@
107107 * @todo This would probably look a lot nicer in a table.
108108 */
109109 function formatRow( $row ) {
 110+ global $wgUser, $wgLang;
110111 wfProfileIn( __METHOD__ );
111112
112 - global $wgLang;
113 -
114113 $sk = $this->getSkin();
115114
116115 $rev = new Revision( array(
@@ -164,8 +163,23 @@
165164 $mflag = '';
166165 }
167166
 167+ if( $wgUser->isAllowed( 'deleterevision' ) ) {
 168+ // If revision was hidden from sysops
 169+ if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
 170+ $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ),
 171+ '(' . $this->message['rev-delundel'] . ')' ) . ' ';
 172+ // Otherwise, show the link...
 173+ } else {
 174+ $query = array( 'target' => $page->getPrefixedDbkey(),
 175+ 'artimestamp' => $rev->getTimestamp() );
 176+ $del = $this->mSkin->revDeleteLink( $query,
 177+ $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' ';
 178+ }
 179+ } else {
 180+ $del = '';
 181+ }
168182
169 - $ret = "{$link} ($last) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}";
 183+ $ret = "{$del}{$link} ({$last}) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}";
170184 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
171185 $ret .= ' ' . wfMsgHtml( 'deletedrev' );
172186 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r50187(bug 18666) Add show/hide to deleted diffsaaron17:45, 4 May 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r50177(bug 18666) Add show/hide to contribsaaron13:32, 4 May 2009

Status & tagging log