From: Aaron Schulz Date: Mon, 4 May 2009 13:40:09 +0000 (+0000) Subject: (bug 18666) Add show/hide links to deletedcontribs X-Git-Tag: 1.31.0-rc.0~41889 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=43c908d4e9db099518131aa71929da39a2b823b3;p=lhc%2Fweb%2Fwiklou.git (bug 18666) Add show/hide links to deletedcontribs --- diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 78828513b7..97517362c8 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -106,10 +106,9 @@ class DeletedContribsPager extends IndexPager { * @todo This would probably look a lot nicer in a table. */ function formatRow( $row ) { + global $wgUser, $wgLang; wfProfileIn( __METHOD__ ); - global $wgLang; - $sk = $this->getSkin(); $rev = new Revision( array( @@ -164,8 +163,23 @@ class DeletedContribsPager extends IndexPager { $mflag = ''; } + if( $wgUser->isAllowed( 'deleterevision' ) ) { + // If revision was hidden from sysops + if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { + $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), + '(' . $this->message['rev-delundel'] . ')' ) . ' '; + // Otherwise, show the link... + } else { + $query = array( 'target' => $page->getPrefixedDbkey(), + 'artimestamp' => $rev->getTimestamp() ); + $del = $this->mSkin->revDeleteLink( $query, + $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' '; + } + } else { + $del = ''; + } - $ret = "{$link} ($last) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}"; + $ret = "{$del}{$link} ({$last}) ({$dellog}) ({$reviewlink}) . . {$mflag} {$pagelink} {$comment}"; if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $ret .= ' ' . wfMsgHtml( 'deletedrev' ); }