r61971 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61970‎ | r61971 | r61972 >
Date:10:39, 4 February 2010
Author:aaron
Status:ok
Tags:
Comment:
* Added Id to "deleted only" check to make label work
* Broke some super long lines
Modified paths:
  • /trunk/phase3/includes/HistoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HistoryPage.php
@@ -133,9 +133,14 @@
134134 * We use "isBigDeletion" to determine if the history is too big to go through.
135135 * Additionally, only users with 'deleterevision' right can filter for deleted edits.
136136 */
137 - if ( $this->title->userCan( 'deleterevision' ) && ( !$this->article->isBigDeletion() || $this->title->userCan( 'bigdelete' ) ) ) {
138 - $conds = ( $wgRequest->getBool( 'deleted' ) ) ? array("rev_deleted != '0'") : array();
139 - $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' ), 'deleted', '', $wgRequest->getBool( 'deleted' ) ) . "\n";
 137+ if ( $this->title->userCan( 'deleterevision' )
 138+ && ( !$this->article->isBigDeletion() || $this->title->userCan( 'bigdelete' ) ) )
 139+ {
 140+ $conds = ( $wgRequest->getBool( 'deleted' ) )
 141+ ? array("rev_deleted != '0'")
 142+ : array();
 143+ $checkDeleted = Xml::checkLabel( wfMsg( 'history-show-deleted' ),
 144+ 'deleted', 'mw-show-deleted-only', $wgRequest->getBool( 'deleted' ) ) . "\n";
140145 }
141146 else { # Don't filter and don't add the checkbox for filtering
142147 $conds = array();
@@ -324,7 +329,9 @@
325330 $queryInfo = array(
326331 'tables' => array('revision'),
327332 'fields' => Revision::selectFields(),
328 - 'conds' => array_merge( array('rev_page' => $this->historyPage->title->getArticleID() ), $this->conds ),
 333+ 'conds' => array_merge(
 334+ array( 'rev_page' => $this->historyPage->title->getArticleID() ),
 335+ $this->conds ),
329336 'options' => array( 'USE INDEX' => array('revision' => 'page_timestamp') ),
330337 'join_conds' => array( 'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
331338 );
@@ -487,7 +494,8 @@
488495 $del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
489496 // Otherwise, enable the checkbox...
490497 } else {
491 - $del = Xml::check( 'showhiderevisions', false, array( 'name' => 'ids['.$rev->getId().']' ) );
 498+ $del = Xml::check( 'showhiderevisions', false,
 499+ array( 'name' => 'ids['.$rev->getId().']' ) );
492500 }
493501 // User can only view deleted revisions...
494502 } else if( $rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' ) ) {
@@ -505,7 +513,8 @@
506514 if( $del ) $s .= " $del ";
507515
508516 $s .= " $link";
509 - $s .= " <span class='history-user'>" . $this->getSkin()->revUserTools( $rev, true ) . "</span>";
 517+ $s .= " <span class='history-user'>" .
 518+ $this->getSkin()->revUserTools( $rev, true ) . "</span>";
510519
511520 if( $rev->isMinor() ) {
512521 $s .= ' ' . ChangesList::flag( 'minor' );
@@ -648,7 +657,9 @@
649658 ),
650659 array( 'known', 'noclasses' )
651660 );
652 - } elseif( !$prevRev->userCan(Revision::DELETED_TEXT) || !$nextRev->userCan(Revision::DELETED_TEXT) ) {
 661+ } elseif( !$prevRev->userCan(Revision::DELETED_TEXT)
 662+ || !$nextRev->userCan(Revision::DELETED_TEXT) )
 663+ {
653664 return $last;
654665 } else {
655666 return $this->getSkin()->link(

Status & tagging log