From: Tim Starling Date: Tue, 2 Jun 2009 03:51:01 +0000 (+0000) Subject: Reverted r51291 (including random formatting changes) and reimplemented in a more... X-Git-Tag: 1.31.0-rc.0~41548 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=90e29f33c8e18b300ef4233a412c8c5df3861c29;p=lhc%2Fweb%2Fwiklou.git Reverted r51291 (including random formatting changes) and reimplemented in a more sane manner. --- diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 5b9448db16..554d025236 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -170,13 +170,11 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $qc = $this->getLogQueryCond(); # Show relevant lines from the deletion log $wgOut->addHTML( "

" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "

\n" ); - LogEventsList::showLogExtract( $wgOut, 'delete', - $this->targetObj->getPrefixedText(), '', 25, $qc ); + LogEventsList::showLogExtract( $wgOut, 'delete', $this->targetObj->getPrefixedText(), '', 25, $qc ); # Show relevant lines from the suppression log if( $wgUser->isAllowed( 'suppressionlog' ) ) { $wgOut->addHTML( "

" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "

\n" ); - LogEventsList::showLogExtract( $wgOut, 'suppress', - $this->targetObj->getPrefixedText(), '', 25, $qc ); + LogEventsList::showLogExtract( $wgOut, 'suppress', $this->targetObj->getPrefixedText(), '', 25, $qc ); } } @@ -295,8 +293,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { if ( $this->typeName == 'logging' ) { $wgOut->addWikiMsg( 'logdelete-selected', $wgLang->formatNum( count($this->ids) ) ); } else { - $wgOut->addWikiMsg( 'revdelete-selected', - $this->targetObj->getPrefixedText(), count( $this->ids ) ); + $wgOut->addWikiMsg( 'revdelete-selected', $this->targetObj->getPrefixedText(), count( $this->ids ) ); } $bitfields = 0; @@ -647,8 +644,7 @@ abstract class RevDel_List { $opType = 'modify'; } - // TODO: use FILE::DELETED_FILE, though value is the same - if ( $item->isCurrent() && ($newBits & Revision::DELETED_TEXT) ) { + if ( $item->isHideCurrentOp( $newBits ) ) { // Cannot hide current version text $status->error( 'revdelete-hide-current', $item->formatDate(), $item->formatTime() ); $status->failCount++; @@ -905,10 +901,11 @@ abstract class RevDel_Item { } /** - * Returns true if the item is "current" and can't be deleted for that reason + * Returns true if the item is "current", and the operation to set the given + * bits can't be executed for that reason * STUB */ - public function isCurrent() { + public function isHideCurrentOp( $newBits ) { return false; } @@ -1046,8 +1043,9 @@ class RevDel_RevisionItem extends RevDel_Item { return $this->revision->isDeleted( Revision::DELETED_TEXT ); } - public function isCurrent() { - return $this->list->getCurrent() == $this->getId(); + public function isHideCurrentOp( $newBits ) { + return ( $newBits & Revision::DELETED_TEXT ) + && $this->list->getCurrent() == $this->getId(); } /**