Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -643,6 +643,7 @@ |
644 | 644 | 'rev-deleted-text-permission', |
645 | 645 | 'rev-deleted-text-view', |
646 | 646 | 'rev-deleted-no-diff', |
| 647 | + 'rev-deleted-unhide-diff', |
647 | 648 | 'rev-delundel', |
648 | 649 | 'revisiondelete', |
649 | 650 | 'revdelete-nooldid-title', |
Index: trunk/phase3/includes/diff/DifferenceEngine.php |
— | — | @@ -283,15 +283,27 @@ |
284 | 284 | '<div id="mw-diff-ntitle3">' . $newminor . $sk->revComment( $this->mNewRev, !$diffOnly, !$this->unhide ).$rdel."</div>" . |
285 | 285 | '<div id="mw-diff-ntitle4">' . $nextlink . $patrol . '</div>'; |
286 | 286 | |
287 | | - # Output the diff if allowed |
288 | | - $allowed = $this->mOldRev->userCan(Revision::DELETED_TEXT) && $this->mNewRev->userCan(Revision::DELETED_TEXT); |
289 | | - $deleted = $this->mOldRev->isDeleted(Revision::DELETED_TEXT) || $this->mNewRev->isDeleted(Revision::DELETED_TEXT); |
| 287 | + # Check if this user can see the revisions |
| 288 | + $allowed = $this->mOldRev->userCan(Revision::DELETED_TEXT) |
| 289 | + && $this->mNewRev->userCan(Revision::DELETED_TEXT); |
| 290 | + $deleted = $this->mOldRev->isDeleted(Revision::DELETED_TEXT) |
| 291 | + || $this->mNewRev->isDeleted(Revision::DELETED_TEXT); |
| 292 | + # Output the diff if allowed... |
290 | 293 | if( $deleted && (!$this->unhide || !$allowed) ) { |
291 | 294 | $this->showDiffStyle(); |
292 | 295 | $multi = $this->getMultiNotice(); |
293 | 296 | $wgOut->addHTML( $this->addHeader( '', $oldHeader, $newHeader, $multi ) ); |
294 | | - $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", |
295 | | - array( 'rev-deleted-no-diff' ) ); |
| 297 | + if( !$allowed ) { |
| 298 | + # Give explanation for why revision is not visible |
| 299 | + $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", |
| 300 | + array( 'rev-deleted-no-diff' ) ); |
| 301 | + } else { |
| 302 | + # Give explanation and add a link to view the diff... |
| 303 | + $link = $this->mTitle->getFullUrl( "diff={$this->mNewid}&oldid={$this->mOldid}". |
| 304 | + '&unhide=1&token='.urlencode( $wgUser->editToken($this->mNewid) ) ); |
| 305 | + $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", |
| 306 | + array( 'rev-deleted-unhide-diff', $link ) ); |
| 307 | + } |
296 | 308 | } else if( $wgEnableHtmlDiff && $this->htmldiff ) { |
297 | 309 | $multi = $this->getMultiNotice(); |
298 | 310 | $wgOut->addHTML('<div class="diff-switchtype">'.$sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'wikicodecomparison' ), |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -792,10 +792,10 @@ |
793 | 793 | |
794 | 794 | # Allow admins to see deleted content if explicitly requested |
795 | 795 | $delId = $diff ? $diff : $oldid; |
796 | | - $unhide = $wgRequest->getInt('unhide') == 1 && $wgUser->matchEditToken( $wgRequest->getVal('token'), $delId ); |
| 796 | + $unhide = $wgRequest->getInt('unhide') == 1 |
| 797 | + && $wgUser->matchEditToken( $wgRequest->getVal('token'), $delId ); |
797 | 798 | # If we got diff and oldid in the query, we want to see a |
798 | 799 | # diff page instead of the article. |
799 | | - |
800 | 800 | if( !is_null( $diff ) ) { |
801 | 801 | $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
802 | 802 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1293,13 +1293,15 @@ |
1294 | 1294 | 'rev-deleted-comment' => '(comment removed)', |
1295 | 1295 | 'rev-deleted-user' => '(username removed)', |
1296 | 1296 | 'rev-deleted-event' => '(log action removed)', |
1297 | | -'rev-deleted-text-permission' => 'This page revision has been removed from the public archives. |
| 1297 | +'rev-deleted-text-permission' => 'This page revision has been \'\'\'removed from the public archives\'\'\'. |
1298 | 1298 | There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].', |
1299 | | -'rev-deleted-text-view' => 'This page revision has been removed from the public archives. |
1300 | | -As an administrator on {{SITENAME}} you can view it; |
1301 | | -there may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].', |
1302 | | -'rev-deleted-no-diff' => 'You cannot view this diff because one of the revisions has been removed from the public archives. |
| 1299 | +'rev-deleted-text-view' => 'This page revision has been \'\'\'removed from the public archives\'\'\'. |
| 1300 | +As an administrator on {{SITENAME}} you can view it; there may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].', |
| 1301 | +'rev-deleted-no-diff' => 'You cannot view this diff because one of the revisions has been \'\'\'removed from the public archives\'\'\'. |
1303 | 1302 | There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].', |
| 1303 | +'rev-deleted-unhide-diff' => 'One of the revisions of this diff has been \'\'\'removed from the public archives\'\'\'. |
| 1304 | +There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log]. |
| 1305 | +As an administrator on {{SITENAME}} you can still [$1 view this diff] if you wish to proceed.', |
1304 | 1306 | 'rev-delundel' => 'show/hide', |
1305 | 1307 | 'revisiondelete' => 'Delete/undelete revisions', |
1306 | 1308 | 'revdelete-nooldid-title' => 'Invalid target revision', |