From c437ea2cd4ac7bf4397765c3812536fd7151d8ee Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 19 Jul 2009 00:33:30 +0000 Subject: [PATCH] bug 18725 add revision suppression UI on deleted revision page --- includes/specials/SpecialUndelete.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index f713fe437d..f7b62cda26 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -753,8 +753,25 @@ class UndeleteForm { } else { $openDiv = '
'; } + + $revdlink = ''; + if( $wgUser->isAllowed( 'deleterevision' ) ) { + if( !$rev->userCan(Revision::DELETED_RESTRICTED ) ) { + // If revision was hidden from sysops + $revdlink = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), + '('.wfMsgHtml('rev-delundel').')' ); + } else { + $query = array( + 'type' => 'archive', + 'target' => $this->mTargetObj->getPrefixedDBkey(), + 'ids' => $rev->getTimestamp() + ); + $revdlink = $skin->revDeleteLink( $query, $rev->isDeleted( File::DELETED_RESTRICTED ) ); + } + } - $wgOut->addHTML( $openDiv . wfMsgWikiHtml( 'undelete-revision', $link, $time, $user, $d, $t ) . '
' ); + $wgOut->addHTML( $openDiv . wfMsgWikiHtml( 'undelete-revision', $link, $time, $user, $d, $t ) . + $revdlink . '' ); wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) ); if( $this->mPreview ) { -- 2.20.1