From: Aaron Schulz Date: Mon, 4 May 2009 13:32:50 +0000 (+0000) Subject: (bug 18666) Add show/hide to contribs X-Git-Tag: 1.31.0-rc.0~41890 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=0ed239362c54656b95d4d602fcc33d6f5ace8932;p=lhc%2Fweb%2Fwiklou.git (bug 18666) Add show/hide to contribs --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 835cce6258..a4037cb7f0 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -473,7 +473,7 @@ class ContribsPager extends ReverseChronologicalPager { * @todo This would probably look a lot nicer in a table. */ function formatRow( $row ) { - global $wgLang, $wgContLang; + global $wgUser, $wgLang, $wgContLang; wfProfileIn( __METHOD__ ); $sk = $this->getSkin(); @@ -532,8 +532,23 @@ class ContribsPager extends ReverseChronologicalPager { } else { $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(), 'oldid' => $rev->getId() ); + $del = $this->mSkin->revDeleteLink( $query, + $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' '; + } + } else { + $del = ''; + } - $ret = "{$d} {$histlink} {$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; + $ret = "{$del}{$d} {$histlink} {$difftext} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { $ret .= ' ' . wfMsgHtml( 'deletedrev' ); }