diff --git a/includes/actions/pagers/HistoryPager.php b/includes/actions/pagers/HistoryPager.php index f7181ada59b..0d46869dfaf 100644 --- a/includes/actions/pagers/HistoryPager.php +++ b/includes/actions/pagers/HistoryPager.php @@ -171,6 +171,14 @@ class HistoryPager extends ReverseChronologicalPager { $this->mResult->seek( 0 ); } + /** + * Returns message when query returns no revisions + * @return string escaped message + */ + protected function getEmptyBody() { + return $this->msg( 'history-empty' )->escaped(); + } + /** * Creates begin of history list with a submit button * @@ -181,17 +189,19 @@ class HistoryPager extends ReverseChronologicalPager { $this->lastRow = false; $this->counter = 1; $this->oldIdChecked = 0; - - $this->getOutput()->wrapWikiMsg( "
\n$1\n
", 'histlegend' ); - $s = Html::openElement( 'form', [ 'action' => wfScript(), - '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"; - + $s = ''; // Button container stored in $this->buttons for re-use in getEndBody() $this->buttons = ''; if ( $this->getNumRows() > 0 ) { + $this->getOutput()->wrapWikiMsg( "
\n$1\n
", 'histlegend' ); + $s = Html::openElement( 'form', [ + 'action' => wfScript(), + '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"; + $this->buttons .= Html::openElement( 'div', [ 'class' => 'mw-history-compareselectedversions' ] ); $className = 'historysubmit mw-history-compareselectedversions-button mw-ui-button'; @@ -223,8 +233,8 @@ class HistoryPager extends ReverseChronologicalPager { $this->buttons .= ''; $s .= $this->buttons; + $s .= '