summaryrefslogtreecommitdiff
path: root/includes/actions/HistoryAction.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/actions/HistoryAction.php')
-rw-r--r--includes/actions/HistoryAction.php33
1 files changed, 25 insertions, 8 deletions
diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php
index dcd77415..a81adf99 100644
--- a/includes/actions/HistoryAction.php
+++ b/includes/actions/HistoryAction.php
@@ -368,6 +368,9 @@ class HistoryPager extends ReverseChronologicalPager {
*/
protected $parentLens;
+ /** @var bool Whether to show the tag editing UI */
+ protected $showTagEditUI;
+
/**
* @param HistoryAction $historyPage
* @param string $year
@@ -381,6 +384,7 @@ class HistoryPager extends ReverseChronologicalPager {
$this->tagFilter = $tagFilter;
$this->getDateCond( $year, $month );
$this->conds = $conds;
+ $this->showTagEditUI = ChangeTags::showTagEditingUI( $this->getUser() );
}
// For hook compatibility...
@@ -432,8 +436,13 @@ class HistoryPager extends ReverseChronologicalPager {
$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 = '';
}
@@ -443,6 +452,10 @@ class HistoryPager extends ReverseChronologicalPager {
}
function doBatchLookups() {
+ if ( !Hooks::run( 'PageHistoryPager::doBatchLookups', array( $this, $this->mResult ) ) ) {
+ return;
+ }
+
# Do a link batch query
$this->mResult->seek( 0 );
$batch = new LinkBatch();
@@ -495,7 +508,7 @@ class HistoryPager extends ReverseChronologicalPager {
if ( $user->isAllowed( 'deleterevision' ) ) {
$actionButtons .= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' );
}
- if ( ChangeTags::showTagEditingUI( $user ) ) {
+ if ( $this->showTagEditUI ) {
$actionButtons .= $this->getRevisionButton( 'editchangetags', 'history-edit-tags' );
}
if ( $actionButtons ) {
@@ -542,8 +555,13 @@ class HistoryPager extends ReverseChronologicalPager {
$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 = '';
}
@@ -617,14 +635,13 @@ class HistoryPager extends ReverseChronologicalPager {
$del = '';
$user = $this->getUser();
$canRevDelete = $user->isAllowed( 'deleterevision' );
- $showTagEditUI = ChangeTags::showTagEditingUI( $user );
// Show checkboxes for each revision, to allow for revision deletion and
// change tags
- if ( $canRevDelete || $showTagEditUI ) {
+ if ( $canRevDelete || $this->showTagEditUI ) {
$this->preventClickjacking();
// If revision was hidden from sysops and we don't need the checkbox
// for anything else, disable it
- if ( !$showTagEditUI && !$rev->userCan( Revision::DELETED_RESTRICTED, $user ) ) {
+ if ( !$this->showTagEditUI && !$rev->userCan( Revision::DELETED_RESTRICTED, $user ) ) {
$del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
// Otherwise, enable the checkbox...
} else {