r51325 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51324‎ | r51325 | r51326 >
Date:03:51, 2 June 2009
Author:tstarling
Status:deferred
Tags:
Comment:
Reverted r51291 (including random formatting changes) and reimplemented in a more sane manner.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -170,13 +170,11 @@
171171 $qc = $this->getLogQueryCond();
172172 # Show relevant lines from the deletion log
173173 $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
174 - LogEventsList::showLogExtract( $wgOut, 'delete',
175 - $this->targetObj->getPrefixedText(), '', 25, $qc );
 174+ LogEventsList::showLogExtract( $wgOut, 'delete', $this->targetObj->getPrefixedText(), '', 25, $qc );
176175 # Show relevant lines from the suppression log
177176 if( $wgUser->isAllowed( 'suppressionlog' ) ) {
178177 $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'suppress' ) ) . "</h2>\n" );
179 - LogEventsList::showLogExtract( $wgOut, 'suppress',
180 - $this->targetObj->getPrefixedText(), '', 25, $qc );
 178+ LogEventsList::showLogExtract( $wgOut, 'suppress', $this->targetObj->getPrefixedText(), '', 25, $qc );
181179 }
182180 }
183181
@@ -295,8 +293,7 @@
296294 if ( $this->typeName == 'logging' ) {
297295 $wgOut->addWikiMsg( 'logdelete-selected', $wgLang->formatNum( count($this->ids) ) );
298296 } else {
299 - $wgOut->addWikiMsg( 'revdelete-selected',
300 - $this->targetObj->getPrefixedText(), count( $this->ids ) );
 297+ $wgOut->addWikiMsg( 'revdelete-selected', $this->targetObj->getPrefixedText(), count( $this->ids ) );
301298 }
302299
303300 $bitfields = 0;
@@ -647,8 +644,7 @@
648645 $opType = 'modify';
649646 }
650647
651 - // TODO: use FILE::DELETED_FILE, though value is the same
652 - if ( $item->isCurrent() && ($newBits & Revision::DELETED_TEXT) ) {
 648+ if ( $item->isHideCurrentOp( $newBits ) ) {
653649 // Cannot hide current version text
654650 $status->error( 'revdelete-hide-current', $item->formatDate(), $item->formatTime() );
655651 $status->failCount++;
@@ -905,10 +901,11 @@
906902 }
907903
908904 /**
909 - * Returns true if the item is "current" and can't be deleted for that reason
 905+ * Returns true if the item is "current", and the operation to set the given
 906+ * bits can't be executed for that reason
910907 * STUB
911908 */
912 - public function isCurrent() {
 909+ public function isHideCurrentOp( $newBits ) {
913910 return false;
914911 }
915912
@@ -1046,8 +1043,9 @@
10471044 return $this->revision->isDeleted( Revision::DELETED_TEXT );
10481045 }
10491046
1050 - public function isCurrent() {
1051 - return $this->list->getCurrent() == $this->getId();
 1047+ public function isHideCurrentOp( $newBits ) {
 1048+ return ( $newBits & Revision::DELETED_TEXT )
 1049+ && $this->list->getCurrent() == $this->getId();
10521050 }
10531051
10541052 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r51291Tweak r51279: re-added ability to hide comment/user of top revisionaaron16:16, 1 June 2009

Status & tagging log