923d47c0707f2671e13c58ccd4ee20040d2f9a8b
[lhc/web/wiklou.git] / includes / PageHistory.php
1 <?php
2 /**
3 * Page history
4 *
5 * Split off from Article.php and Skin.php, 2003-12-22
6 * @file
7 */
8
9 /**
10 * This class handles printing the history page for an article. In order to
11 * be efficient, it uses timestamps rather than offsets for paging, to avoid
12 * costly LIMIT,offset queries.
13 *
14 * Construct it by passing in an Article, and call $h->history() to print the
15 * history.
16 *
17 */
18 class PageHistory {
19 const DIR_PREV = 0;
20 const DIR_NEXT = 1;
21
22 var $mArticle, $mTitle, $mSkin;
23 var $lastdate;
24 var $linesonpage;
25 var $mLatestId = null;
26
27 private $mOldIdChecked = 0;
28
29 /**
30 * Construct a new PageHistory.
31 *
32 * @param Article $article
33 * @returns nothing
34 */
35 function __construct( $article ) {
36 global $wgUser;
37 $this->mArticle =& $article;
38 $this->mTitle =& $article->mTitle;
39 $this->mSkin = $wgUser->getSkin();
40 $this->preCacheMessages();
41 }
42
43 function getArticle() {
44 return $this->mArticle;
45 }
46
47 function getTitle() {
48 return $this->mTitle;
49 }
50
51 /**
52 * As we use the same small set of messages in various methods and that
53 * they are called often, we call them once and save them in $this->message
54 */
55 function preCacheMessages() {
56 // Precache various messages
57 if( !isset( $this->message ) ) {
58 foreach( explode(' ', 'cur last rev-delundel' ) as $msg ) {
59 $this->message[$msg] = wfMsgExt( $msg, array( 'escape') );
60 }
61 }
62 }
63
64 /**
65 * Print the history page for an article.
66 *
67 * @returns nothing
68 */
69 function history() {
70 global $wgOut, $wgRequest, $wgScript;
71
72 /*
73 * Allow client caching.
74 */
75 if( $wgOut->checkLastModified( $this->mArticle->getTouched() ) )
76 return; // Client cache fresh and headers sent, nothing more to do.
77
78 wfProfileIn( __METHOD__ );
79
80 /*
81 * Setup page variables.
82 */
83 $wgOut->setPageTitle( wfMsg( 'history-title', $this->mTitle->getPrefixedText() ) );
84 $wgOut->setPageTitleActionText( wfMsg( 'history_short' ) );
85 $wgOut->setArticleFlag( false );
86 $wgOut->setArticleRelated( true );
87 $wgOut->setRobotPolicy( 'noindex,nofollow' );
88 $wgOut->setSyndicated( true );
89 $wgOut->setFeedAppendQuery( 'action=history' );
90 $wgOut->addScriptFile( 'history.js' );
91
92 $logPage = SpecialPage::getTitleFor( 'Log' );
93 $logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ),
94 'page=' . $this->mTitle->getPrefixedUrl() );
95 $wgOut->setSubtitle( $logLink );
96
97 $feedType = $wgRequest->getVal( 'feed' );
98 if( $feedType ) {
99 wfProfileOut( __METHOD__ );
100 return $this->feed( $feedType );
101 }
102
103 /*
104 * Fail if article doesn't exist.
105 */
106 if( !$this->mTitle->exists() ) {
107 $wgOut->addWikiMsg( 'nohistory' );
108 wfProfileOut( __METHOD__ );
109 return;
110 }
111
112 /**
113 * Add date selector to quickly get to a certain time
114 */
115 $year = $wgRequest->getInt( 'year' );
116 $month = $wgRequest->getInt( 'month' );
117 $tagFilter = $wgRequest->getVal( 'tagfilter' );
118 $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
119
120 $action = htmlspecialchars( $wgScript );
121 $wgOut->addHTML(
122 "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
123 Xml::fieldset( wfMsg( 'history-fieldset-title' ), false, array( 'id' => 'mw-history-search' ) ) .
124 Xml::hidden( 'title', $this->mTitle->getPrefixedDBKey() ) . "\n" .
125 Xml::hidden( 'action', 'history' ) . "\n" .
126 xml::dateMenu( $year, $month ) . '&nbsp;' .
127 ( $tagSelector ? ( implode( '&nbsp;', $tagSelector ) . '&nbsp;' ) : '' ) .
128 Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
129 '</fieldset></form>'
130 );
131
132 wfRunHooks( 'PageHistoryBeforeList', array( &$this->mArticle ) );
133
134 /**
135 * Do the list
136 */
137 $pager = new PageHistoryPager( $this, $year, $month, $tagFilter );
138 $this->linesonpage = $pager->getNumRows();
139 $wgOut->addHTML(
140 $pager->getNavigationBar() .
141 $this->beginHistoryList() .
142 $pager->getBody() .
143 $this->endHistoryList() .
144 $pager->getNavigationBar()
145 );
146
147 wfProfileOut( __METHOD__ );
148 }
149
150 /**
151 * Creates begin of history list with a submit button
152 *
153 * @return string HTML output
154 */
155 function beginHistoryList() {
156 global $wgUser, $wgScript, $wgEnableHtmlDiff;
157 $this->lastdate = '';
158 $s = wfMsgExt( 'histlegend', array( 'parse') );
159 if( $this->linesonpage > 1 && $wgUser->isAllowed('deleterevision') ) {
160 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
161 $s .= Xml::openElement( 'form',
162 array(
163 'action' => $revdel->getLocalURL( array(
164 'type' => 'revision',
165 'target' => $this->mTitle->getPrefixedDbKey()
166 ) ),
167 'method' => 'post',
168 'id' => 'mw-history-revdeleteform',
169 'style' => 'visibility:hidden;float:right;'
170 )
171 );
172 $s .= Xml::hidden( 'ids', '', array('id'=>'revdel-oldid') );
173 $s .= Xml::submitButton( wfMsg( 'showhideselectedversions' ) );
174 $s .= Xml::closeElement( 'form' );
175 }
176 $s .= Xml::openElement( 'form', array( 'action' => $wgScript,
177 'id' => 'mw-history-compare' ) );
178 $s .= Xml::hidden( 'title', $this->mTitle->getPrefixedDbKey() );
179 if( $wgEnableHtmlDiff ) {
180 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
181 array(
182 'name' => 'htmldiff',
183 'class' => 'historysubmit',
184 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
185 'title' => wfMsg( 'tooltip-compareselectedversions' ),
186 )
187 );
188 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
189 array(
190 'class' => 'historysubmit',
191 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
192 'title' => wfMsg( 'tooltip-compareselectedversions' ),
193 )
194 );
195 } else {
196 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
197 array(
198 'class' => 'historysubmit',
199 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
200 'title' => wfMsg( 'tooltip-compareselectedversions' ),
201 )
202 );
203 }
204 $s .= '<ul id="pagehistory">' . "\n";
205 return $s;
206 }
207
208 /**
209 * Creates end of history list with a submit button
210 *
211 * @return string HTML output
212 */
213 function endHistoryList() {
214 global $wgEnableHtmlDiff;
215 $s = '</ul>';
216 if( $wgEnableHtmlDiff ) {
217 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
218 array(
219 'name' => 'htmldiff',
220 'class' => 'historysubmit',
221 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
222 'title' => wfMsg( 'tooltip-compareselectedversions' ),
223 )
224 );
225 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
226 array(
227 'class' => 'historysubmit',
228 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
229 'title' => wfMsg( 'tooltip-compareselectedversions' ),
230 )
231 );
232 } else {
233 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
234 array(
235 'class' => 'historysubmit',
236 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
237 'title' => wfMsg( 'tooltip-compareselectedversions' ),
238 )
239 );
240 }
241 $s .= '</form>';
242 return $s;
243 }
244
245 /**
246 * Creates a submit button
247 *
248 * @param array $attributes attributes
249 * @return string HTML output for the submit button
250 */
251 function submitButton($message, $attributes = array() ) {
252 # Disable submit button if history has 1 revision only
253 if( $this->linesonpage > 1 ) {
254 return Xml::submitButton( $message , $attributes );
255 } else {
256 return '';
257 }
258 }
259
260 /**
261 * Returns a row from the history printout.
262 *
263 * @todo document some more, and maybe clean up the code (some params redundant?)
264 *
265 * @param Row $row The database row corresponding to the previous line.
266 * @param mixed $next The database row corresponding to the next line.
267 * @param int $counter Apparently a counter of what row number we're at, counted from the top row = 1.
268 * @param $notificationtimestamp
269 * @param bool $latest Whether this row corresponds to the page's latest revision.
270 * @param bool $firstInList Whether this row corresponds to the first displayed on this history page.
271 * @return string HTML output for the row
272 */
273 function historyLine( $row, $next, $counter = '', $notificationtimestamp = false,
274 $latest = false, $firstInList = false )
275 {
276 global $wgUser, $wgLang;
277 $rev = new Revision( $row );
278 $rev->setTitle( $this->mTitle );
279
280 $curlink = $this->curLink( $rev, $latest );
281 $lastlink = $this->lastLink( $rev, $next, $counter );
282 $arbitrary = $this->diffButtons( $rev, $firstInList, $counter );
283 $link = $this->revLink( $rev );
284 $classes = array();
285
286 $s = "($curlink) ($lastlink) $arbitrary";
287
288 if( $wgUser->isAllowed( 'deleterevision' ) ) {
289 // Hide JS by default for non-JS browsing
290 $hidden = array( 'style' => 'display:none' );
291 // If revision was hidden from sysops
292 if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
293 $del = Xml::check( 'deleterevisions', false,
294 $hidden + array('disabled' => 'disabled') );
295 $del .= Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ),
296 '(' . $this->message['rev-delundel'] . ')' );
297 // Otherwise, show the link...
298 } else {
299 $jsCall = 'updateShowHideForm('.$rev->getId().',this.checked)';
300 $del = Xml::check( 'showhiderevisions', false,
301 $hidden + array('onchange' => $jsCall) );
302 $query = array(
303 'type' => 'revision',
304 'target' => $this->mTitle->getPrefixedDbkey(),
305 'ids' => $rev->getId() );
306 $del .= $this->mSkin->revDeleteLink( $query,
307 $rev->isDeleted( Revision::DELETED_RESTRICTED ) );
308 }
309 $s .= " $del ";
310 }
311
312 $s .= " $link";
313 $s .= " <span class='history-user'>" . $this->mSkin->revUserTools( $rev, true ) . "</span>";
314
315 if( $rev->isMinor() ) {
316 $s .= ' ' . Xml::element( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') );
317 }
318
319 if( !is_null( $size = $rev->getSize() ) && !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
320 $s .= ' ' . $this->mSkin->formatRevisionSize( $size );
321 }
322
323 $s .= $this->mSkin->revComment( $rev, false, true );
324
325 if( $notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp) ) {
326 $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>';
327 }
328
329 $tools = array();
330
331 if( !is_null( $next ) && is_object( $next ) ) {
332 if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) {
333 $tools[] = '<span class="mw-rollback-link">'.
334 $this->mSkin->buildRollbackLink( $rev ).'</span>';
335 }
336
337 if( $this->mTitle->quickUserCan( 'edit' )
338 && !$rev->isDeleted( Revision::DELETED_TEXT )
339 && !$next->rev_deleted & Revision::DELETED_TEXT )
340 {
341 # Create undo tooltip for the first (=latest) line only
342 $undoTooltip = $latest
343 ? array( 'title' => wfMsg( 'tooltip-undo' ) )
344 : array();
345 $undolink = $this->mSkin->link(
346 $this->mTitle,
347 wfMsgHtml( 'editundo' ),
348 $undoTooltip,
349 array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
350 array( 'known', 'noclasses' )
351 );
352 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
353 }
354 }
355
356 if( $tools ) {
357 $s .= ' (' . $wgLang->pipeList( $tools ) . ')';
358 }
359
360 # Tags
361 list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'history' );
362 $classes = array_merge( $classes, $newClasses );
363 $s .= " $tagSummary";
364
365 wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row , &$s ) );
366
367 $classes = implode( ' ', $classes );
368
369 return "<li class=\"$classes\">$s</li>\n";
370 }
371
372 /**
373 * Create a link to view this revision of the page
374 * @param Revision $rev
375 * @returns string
376 */
377 function revLink( $rev ) {
378 global $wgLang;
379 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
380 $date = htmlspecialchars( $date );
381 if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
382 $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, $date, "oldid=" . $rev->getId() );
383 } else {
384 $link = "<span class=\"history-deleted\">$date</span>";
385 }
386 return $link;
387 }
388
389 /**
390 * Create a diff-to-current link for this revision for this page
391 * @param Revision $rev
392 * @param Bool $latest, this is the latest revision of the page?
393 * @returns string
394 */
395 function curLink( $rev, $latest ) {
396 $cur = $this->message['cur'];
397 if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) {
398 return $cur;
399 } else {
400 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $cur,
401 'diff=' . $this->mTitle->getLatestRevID() . "&oldid=" . $rev->getId() );
402 }
403 }
404
405 /**
406 * Create a diff-to-previous link for this revision for this page.
407 * @param Revision $prevRev, the previous revision
408 * @param mixed $next, the newer revision
409 * @param int $counter, what row on the history list this is
410 * @returns string
411 */
412 function lastLink( $prevRev, $next, $counter ) {
413 $last = $this->message['last'];
414 # $next may either be a Row, null, or "unkown"
415 $nextRev = is_object($next) ? new Revision( $next ) : $next;
416 if( is_null($next) ) {
417 # Probably no next row
418 return $last;
419 } elseif( $next === 'unknown' ) {
420 # Next row probably exists but is unknown, use an oldid=prev link
421 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last,
422 "diff=" . $prevRev->getId() . "&oldid=prev" );
423 } elseif( !$prevRev->userCan(Revision::DELETED_TEXT) || !$nextRev->userCan(Revision::DELETED_TEXT) ) {
424 return $last;
425 } else {
426 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last,
427 "diff=" . $prevRev->getId() . "&oldid={$next->rev_id}" );
428 }
429 }
430
431 /**
432 * Create radio buttons for page history
433 *
434 * @param object $rev Revision
435 * @param bool $firstInList Is this version the first one?
436 * @param int $counter A counter of what row number we're at, counted from the top row = 1.
437 * @return string HTML output for the radio buttons
438 */
439 function diffButtons( $rev, $firstInList, $counter ) {
440 if( $this->linesonpage > 1 ) {
441 $radio = array( 'type' => 'radio', 'value' => $rev->getId() );
442 /** @todo: move title texts to javascript */
443 if( $firstInList ) {
444 $first = Xml::element( 'input',
445 array_merge( $radio, array( 'style' => 'visibility:hidden', 'name' => 'oldid' ) )
446 );
447 $checkmark = array( 'checked' => 'checked' );
448 } else {
449 # Check visibility of old revisions
450 if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
451 $radio['disabled'] = 'disabled';
452 $checkmark = array(); // We will check the next possible one
453 } else if( $counter == 2 || !$this->mOldIdChecked ) {
454 $checkmark = array( 'checked' => 'checked' );
455 $this->mOldIdChecked = $rev->getId();
456 } else {
457 $checkmark = array();
458 }
459 $first = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'oldid' ) ) );
460 $checkmark = array();
461 }
462 $second = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'diff' ) ) );
463 return $first . $second;
464 } else {
465 return '';
466 }
467 }
468
469 /**
470 * Fetch an array of revisions, specified by a given limit, offset and
471 * direction. This is now only used by the feeds. It was previously
472 * used by the main UI but that's now handled by the pager.
473 */
474 function fetchRevisions($limit, $offset, $direction) {
475 $dbr = wfGetDB( DB_SLAVE );
476
477 if( $direction == PageHistory::DIR_PREV )
478 list($dirs, $oper) = array("ASC", ">=");
479 else /* $direction == PageHistory::DIR_NEXT */
480 list($dirs, $oper) = array("DESC", "<=");
481
482 if( $offset )
483 $offsets = array("rev_timestamp $oper '$offset'");
484 else
485 $offsets = array();
486
487 $page_id = $this->mTitle->getArticleID();
488
489 return $dbr->select( 'revision',
490 Revision::selectFields(),
491 array_merge(array("rev_page=$page_id"), $offsets),
492 __METHOD__,
493 array( 'ORDER BY' => "rev_timestamp $dirs",
494 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit)
495 );
496 }
497
498 /**
499 * Output a subscription feed listing recent edits to this page.
500 * @param string $type
501 */
502 function feed( $type ) {
503 global $wgFeedClasses, $wgRequest, $wgFeedLimit;
504 if( !FeedUtils::checkFeedOutput($type) ) {
505 return;
506 }
507
508 $feed = new $wgFeedClasses[$type](
509 $this->mTitle->getPrefixedText() . ' - ' .
510 wfMsgForContent( 'history-feed-title' ),
511 wfMsgForContent( 'history-feed-description' ),
512 $this->mTitle->getFullUrl( 'action=history' ) );
513
514 // Get a limit on number of feed entries. Provide a sane default
515 // of 10 if none is defined (but limit to $wgFeedLimit max)
516 $limit = $wgRequest->getInt( 'limit', 10 );
517 if( $limit > $wgFeedLimit || $limit < 1 ) {
518 $limit = 10;
519 }
520 $items = $this->fetchRevisions($limit, 0, PageHistory::DIR_NEXT);
521
522 $feed->outHeader();
523 if( $items ) {
524 foreach( $items as $row ) {
525 $feed->outItem( $this->feedItem( $row ) );
526 }
527 } else {
528 $feed->outItem( $this->feedEmpty() );
529 }
530 $feed->outFooter();
531 }
532
533 function feedEmpty() {
534 global $wgOut;
535 return new FeedItem(
536 wfMsgForContent( 'nohistory' ),
537 $wgOut->parse( wfMsgForContent( 'history-feed-empty' ) ),
538 $this->mTitle->getFullUrl(),
539 wfTimestamp( TS_MW ),
540 '',
541 $this->mTitle->getTalkPage()->getFullUrl() );
542 }
543
544 /**
545 * Generate a FeedItem object from a given revision table row
546 * Borrows Recent Changes' feed generation functions for formatting;
547 * includes a diff to the previous revision (if any).
548 *
549 * @param $row
550 * @return FeedItem
551 */
552 function feedItem( $row ) {
553 $rev = new Revision( $row );
554 $rev->setTitle( $this->mTitle );
555 $text = FeedUtils::formatDiffRow( $this->mTitle,
556 $this->mTitle->getPreviousRevisionID( $rev->getId() ),
557 $rev->getId(),
558 $rev->getTimestamp(),
559 $rev->getComment() );
560
561 if( $rev->getComment() == '' ) {
562 global $wgContLang;
563 $ts = $rev->getTimestamp();
564 $title = wfMsgForContent( 'history-feed-item-nocomment',
565 $rev->getUserText(),
566 $wgContLang->timeanddate( $ts ),
567 $wgContLang->date( $ts ),
568 $wgContLang->time( $ts ) );
569 } else {
570 $title = $rev->getUserText() . wfMsgForContent( 'colon-separator' ) . FeedItem::stripComment( $rev->getComment() );
571 }
572
573 return new FeedItem(
574 $title,
575 $text,
576 $this->mTitle->getFullUrl( 'diff=' . $rev->getId() . '&oldid=prev' ),
577 $rev->getTimestamp(),
578 $rev->getUserText(),
579 $this->mTitle->getTalkPage()->getFullUrl() );
580 }
581 }
582
583
584 /**
585 * @ingroup Pager
586 */
587 class PageHistoryPager extends ReverseChronologicalPager {
588 public $mLastRow = false, $mPageHistory, $mTitle;
589
590 function __construct( $pageHistory, $year='', $month='', $tagFilter = '' ) {
591 parent::__construct();
592 $this->mPageHistory = $pageHistory;
593 $this->mTitle =& $this->mPageHistory->mTitle;
594 $this->tagFilter = $tagFilter;
595 $this->getDateCond( $year, $month );
596 }
597
598 function getQueryInfo() {
599 $queryInfo = array(
600 'tables' => array('revision'),
601 'fields' => array_merge( Revision::selectFields(), array('ts_tags') ),
602 'conds' => array('rev_page' => $this->mPageHistory->mTitle->getArticleID() ),
603 'options' => array( 'USE INDEX' => array('revision' => 'page_timestamp') ),
604 'join_conds' => array( 'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
605 );
606 ChangeTags::modifyDisplayQuery( $queryInfo['tables'],
607 $queryInfo['fields'],
608 $queryInfo['conds'],
609 $queryInfo['join_conds'],
610 $queryInfo['options'],
611 $this->tagFilter );
612 wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
613 return $queryInfo;
614 }
615
616 function getIndexField() {
617 return 'rev_timestamp';
618 }
619
620 function formatRow( $row ) {
621 if( $this->mLastRow ) {
622 $latest = $this->mCounter == 1 && $this->mIsFirst;
623 $firstInList = $this->mCounter == 1;
624 $s = $this->mPageHistory->historyLine( $this->mLastRow, $row, $this->mCounter++,
625 $this->mTitle->getNotificationTimestamp(), $latest, $firstInList );
626 } else {
627 $s = '';
628 }
629 $this->mLastRow = $row;
630 return $s;
631 }
632
633 function getStartBody() {
634 $this->mLastRow = false;
635 $this->mCounter = 1;
636 return '';
637 }
638
639 function getEndBody() {
640 if( $this->mLastRow ) {
641 $latest = $this->mCounter == 1 && $this->mIsFirst;
642 $firstInList = $this->mCounter == 1;
643 if( $this->mIsBackwards ) {
644 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
645 if( $this->mOffset == '' ) {
646 $next = null;
647 } else {
648 $next = 'unknown';
649 }
650 } else {
651 # The next row is the past-the-end row
652 $next = $this->mPastTheEndRow;
653 }
654 $s = $this->mPageHistory->historyLine( $this->mLastRow, $next, $this->mCounter++,
655 $this->mTitle->getNotificationTimestamp(), $latest, $firstInList );
656 } else {
657 $s = '';
658 }
659 return $s;
660 }
661 }