r57172 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57171‎ | r57172 | r57173 >
Date:23:12, 30 September 2009
Author:aaron
Status:ok
Tags:
Comment:
added 'rev-suppressed-unhide-diff'
Modified paths:
  • /trunk/phase3/includes/diff/DifferenceInterface.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
@@ -663,6 +663,7 @@
664664 'rev-suppressed-text-view',
665665 'rev-deleted-no-diff',
666666 'rev-deleted-unhide-diff',
 667+ 'rev-suppressed-unhide-diff',
667668 'rev-delundel',
668669 'revisiondelete',
669670 'revdelete-nooldid-title',
Index: trunk/phase3/includes/diff/DifferenceInterface.php
@@ -364,8 +364,18 @@
365365 # Check if this user can see the revisions
366366 $allowed = $this->mOldRev->userCan(Revision::DELETED_TEXT)
367367 && $this->mNewRev->userCan(Revision::DELETED_TEXT);
368 - $deleted = $this->mOldRev->isDeleted(Revision::DELETED_TEXT)
369 - || $this->mNewRev->isDeleted(Revision::DELETED_TEXT);
 368+ # Check if one of the revisions is deleted/suppressed
 369+ $deleted = $suppressed = false;
 370+ if( $this->mOldRev->isDeleted(Revision::DELETED_TEXT) ) {
 371+ $deleted = true; // old revisions text is hidden
 372+ if( $this->mOldRev->isDeleted(Revision::DELETED_RESTRICTED) )
 373+ $suppressed = true; // also suppressed
 374+ }
 375+ if( $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) {
 376+ $deleted = true; // new revisions text is hidden
 377+ if( $this->mNewRev->isDeleted(Revision::DELETED_RESTRICTED) )
 378+ $suppressed = true; // also suppressed
 379+ }
370380 # Output the diff if allowed...
371381 if( $deleted && (!$this->unhide || !$allowed) ) {
372382 $this->showDiffStyle();
@@ -382,8 +392,8 @@
383393 'oldid' => $this->mOldid,
384394 'unhide' => 1
385395 ) );
386 - $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n",
387 - array( 'rev-deleted-unhide-diff', $link ) );
 396+ $msg = $suppressed ? 'rev-suppressed-unhide-diff' : 'rev-deleted-unhide-diff';
 397+ $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", array( $msg, $link ) );
388398 }
389399 } else if( $wgEnableHtmlDiff && $this->htmldiff ) {
390400 $multi = $this->getMultiNotice();
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1441,6 +1441,9 @@
14421442 'rev-deleted-unhide-diff' => "One of the revisions of this diff has been '''deleted'''.
14431443 There may be details in the [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} deletion log].
14441444 As an administrator you can still [$1 view this diff] if you wish to proceed.",
 1445+'rev-suppressed-unhide-diff' => "One of the revisions of this diff has been '''suppressed'''.
 1446+There may be details in the [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} deletion log].
 1447+As an administrator you can still [$1 view this diff] if you wish to proceed.",
14451448 'rev-delundel' => 'show/hide',
14461449 'revisiondelete' => 'Delete/undelete revisions',
14471450 'revdelete-nooldid-title' => 'Invalid target revision',

Status & tagging log