$latest = ( $this->counter == 1 && $this->mIsFirst );
$firstInList = $this->counter == 1;
$this->counter++;
- $s = $this->historyLine( $this->lastRow, $row,
- $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
+
+ $notifTimestamp = $this->getConfig()->get( 'ShowUpdatedMarker' )
+ ? $this->getTitle()->getNotificationTimestamp( $this->getUser() )
+ : false;
+
+ $s = $this->historyLine(
+ $this->lastRow, $row, $notifTimestamp, $latest, $firstInList );
} else {
$s = '';
}
}
function doBatchLookups() {
+ if ( !Hooks::run( 'PageHistoryPager::doBatchLookups', array( $this, $this->mResult ) ) ) {
+ return;
+ }
+
# Do a link batch query
$this->mResult->seek( 0 );
$batch = new LinkBatch();
'id' => 'mw-history-compare' ) ) . "\n";
$s .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n";
$s .= Html::hidden( 'action', 'historysubmit' ) . "\n";
+ $s .= Html::hidden( 'type', 'revision' ) . "\n";
// Button container stored in $this->buttons for re-use in getEndBody()
$this->buttons = '<div>';
$attrs
) . "\n";
- if ( $this->getUser()->isAllowed( 'deleterevision' ) ) {
- $this->buttons .= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' );
+ $user = $this->getUser();
+ $actionButtons = '';
+ if ( $user->isAllowed( 'deleterevision' ) ) {
+ $actionButtons .= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' );
+ }
+ if ( $user->isAllowed( 'changetags' ) ) {
+ $actionButtons .= $this->getRevisionButton( 'editchangetags', 'history-edit-tags' );
+ }
+ if ( $actionButtons ) {
+ $this->buttons .= Xml::tags( 'div', array( 'class' =>
+ 'mw-history-revisionactions' ), $actionButtons );
}
$this->buttons .= '</div>';
$next = $this->mPastTheEndRow;
}
$this->counter++;
- $s = $this->historyLine( $this->lastRow, $next,
- $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
+
+ $notifTimestamp = $this->getConfig()->get( 'ShowUpdatedMarker' )
+ ? $this->getTitle()->getNotificationTimestamp( $this->getUser() )
+ : false;
+
+ $s = $this->historyLine(
+ $this->lastRow, $next, $notifTimestamp, $latest, $firstInList );
} else {
$s = '';
}
$del = '';
$user = $this->getUser();
- // Show checkboxes for each revision
- if ( $user->isAllowed( 'deleterevision' ) ) {
+ $canRevDelete = $user->isAllowed( 'deleterevision' );
+ $canModifyTags = $user->isAllowed( 'changetags' );
+ // Show checkboxes for each revision, to allow for revision deletion and
+ // change tags
+ if ( $canRevDelete || $canModifyTags ) {
$this->preventClickjacking();
- // If revision was hidden from sysops, disable the checkbox
- if ( !$rev->userCan( Revision::DELETED_RESTRICTED, $user ) ) {
+ // If revision was hidden from sysops and we don't need the checkbox
+ // for anything else, disable it
+ if ( !$canModifyTags && !$rev->userCan( Revision::DELETED_RESTRICTED, $user ) ) {
$del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
// Otherwise, enable the checkbox...
} else {