r48682 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48681‎ | r48682 | r48683 >
Date:13:26, 22 March 2009
Author:aaron
Status:ok
Tags:
Comment:
Add convenience links for bug 18068
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -643,6 +643,7 @@
644644 'rev-deleted-text-permission',
645645 'rev-deleted-text-view',
646646 'rev-deleted-no-diff',
 647+ 'rev-deleted-unhide-diff',
647648 'rev-delundel',
648649 'revisiondelete',
649650 'revdelete-nooldid-title',
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -283,15 +283,27 @@
284284 '<div id="mw-diff-ntitle3">' . $newminor . $sk->revComment( $this->mNewRev, !$diffOnly, !$this->unhide ).$rdel."</div>" .
285285 '<div id="mw-diff-ntitle4">' . $nextlink . $patrol . '</div>';
286286
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...
290293 if( $deleted && (!$this->unhide || !$allowed) ) {
291294 $this->showDiffStyle();
292295 $multi = $this->getMultiNotice();
293296 $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+ }
296308 } else if( $wgEnableHtmlDiff && $this->htmldiff ) {
297309 $multi = $this->getMultiNotice();
298310 $wgOut->addHTML('<div class="diff-switchtype">'.$sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'wikicodecomparison' ),
Index: trunk/phase3/includes/Article.php
@@ -792,10 +792,10 @@
793793
794794 # Allow admins to see deleted content if explicitly requested
795795 $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 );
797798 # If we got diff and oldid in the query, we want to see a
798799 # diff page instead of the article.
799 -
800800 if( !is_null( $diff ) ) {
801801 $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
802802
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1293,13 +1293,15 @@
12941294 'rev-deleted-comment' => '(comment removed)',
12951295 'rev-deleted-user' => '(username removed)',
12961296 '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\'\'\'.
12981298 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\'\'\'.
13031302 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.',
13041306 'rev-delundel' => 'show/hide',
13051307 'revisiondelete' => 'Delete/undelete revisions',
13061308 'revdelete-nooldid-title' => 'Invalid target revision',

Follow-up revisions

RevisionCommit summaryAuthorDate
r48902Tweaks for bug 18068:...aaron22:24, 26 March 2009

Status & tagging log