Tweaks for bug 17060
[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, $wgTitle, $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 $this->getDateMenu( $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 * @return string Formatted HTML
152 * @param int $year
153 * @param int $month
154 */
155 private function getDateMenu( $year, $month ) {
156 # Offset overrides year/month selection
157 if( $month && $month !== -1 ) {
158 $encMonth = intval( $month );
159 } else {
160 $encMonth = '';
161 }
162 if( $year ) {
163 $encYear = intval( $year );
164 } else if( $encMonth ) {
165 $thisMonth = intval( gmdate( 'n' ) );
166 $thisYear = intval( gmdate( 'Y' ) );
167 if( intval($encMonth) > $thisMonth ) {
168 $thisYear--;
169 }
170 $encYear = $thisYear;
171 } else {
172 $encYear = '';
173 }
174 return Xml::label( wfMsg( 'year' ), 'year' ) . ' '.
175 Xml::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) .
176 ' '.
177 Xml::label( wfMsg( 'month' ), 'month' ) . ' '.
178 Xml::monthSelector( $encMonth, -1 );
179 }
180
181 /**
182 * Creates begin of history list with a submit button
183 *
184 * @return string HTML output
185 */
186 function beginHistoryList() {
187 global $wgTitle, $wgScript, $wgEnableHtmlDiff;
188 $this->lastdate = '';
189 $s = wfMsgExt( 'histlegend', array( 'parse') );
190 $s .= Xml::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-history-compare' ) );
191 $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
192 if( $wgEnableHtmlDiff ) {
193 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
194 array(
195 'name' => 'htmldiff',
196 'class' => 'historysubmit',
197 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
198 'title' => wfMsg( 'tooltip-compareselectedversions' ),
199 )
200 );
201 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
202 array(
203 'class' => 'historysubmit',
204 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
205 'title' => wfMsg( 'tooltip-compareselectedversions' ),
206 )
207 );
208 } else {
209 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
210 array(
211 'class' => 'historysubmit',
212 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
213 'title' => wfMsg( 'tooltip-compareselectedversions' ),
214 )
215 );
216 }
217 $s .= '<ul id="pagehistory">' . "\n";
218 return $s;
219 }
220
221 /**
222 * Creates end of history list with a submit button
223 *
224 * @return string HTML output
225 */
226 function endHistoryList() {
227 global $wgEnableHtmlDiff;
228 $s = '</ul>';
229 if( $wgEnableHtmlDiff ) {
230 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
231 array(
232 'name' => 'htmldiff',
233 'class' => 'historysubmit',
234 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
235 'title' => wfMsg( 'tooltip-compareselectedversions' ),
236 )
237 );
238 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
239 array(
240 'class' => 'historysubmit',
241 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
242 'title' => wfMsg( 'tooltip-compareselectedversions' ),
243 )
244 );
245 } else {
246 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
247 array(
248 'class' => 'historysubmit',
249 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
250 'title' => wfMsg( 'tooltip-compareselectedversions' ),
251 )
252 );
253 }
254 $s .= '</form>';
255 return $s;
256 }
257
258 /**
259 * Creates a submit button
260 *
261 * @param array $attributes attributes
262 * @return string HTML output for the submit button
263 */
264 function submitButton($message, $attributes = array() ) {
265 # Disable submit button if history has 1 revision only
266 if( $this->linesonpage > 1 ) {
267 return Xml::submitButton( $message , $attributes );
268 } else {
269 return '';
270 }
271 }
272
273 /**
274 * Returns a row from the history printout.
275 *
276 * @todo document some more, and maybe clean up the code (some params redundant?)
277 *
278 * @param Row $row The database row corresponding to the previous line.
279 * @param mixed $next The database row corresponding to the next line.
280 * @param int $counter Apparently a counter of what row number we're at, counted from the top row = 1.
281 * @param $notificationtimestamp
282 * @param bool $latest Whether this row corresponds to the page's latest revision.
283 * @param bool $firstInList Whether this row corresponds to the first displayed on this history page.
284 * @return string HTML output for the row
285 */
286 function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) {
287 global $wgUser, $wgLang;
288 $rev = new Revision( $row );
289 $rev->setTitle( $this->mTitle );
290
291 $curlink = $this->curLink( $rev, $latest );
292 $lastlink = $this->lastLink( $rev, $next, $counter );
293 $arbitrary = $this->diffButtons( $rev, $firstInList, $counter );
294 $link = $this->revLink( $rev );
295 $classes = array();
296
297 $s = "($curlink) ($lastlink) $arbitrary";
298
299 if( $wgUser->isAllowed( 'deleterevision' ) ) {
300 if( $firstInList ) {
301 // We don't currently handle well changing the top revision's settings
302 $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('.$this->message['rev-delundel'].')' );
303 } else if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
304 // If revision was hidden from sysops
305 $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('.$this->message['rev-delundel'].')' );
306 } else {
307 $query = array( 'target' => $this->mTitle->getPrefixedDbkey(),
308 'oldid' => $rev->getId()
309 );
310 $del = $this->mSkin->revDeleteLink( $query, $rev->isDeleted( Revision::DELETED_RESTRICTED ) );
311 }
312 $s .= " $del ";
313 }
314
315 $s .= " $link";
316 $s .= " <span class='history-user'>" . $this->mSkin->revUserTools( $rev, true ) . "</span>";
317
318 if( $rev->isMinor() ) {
319 $s .= ' ' . Xml::element( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') );
320 }
321
322 if( !is_null( $size = $rev->getSize() ) && !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
323 $s .= ' ' . $this->mSkin->formatRevisionSize( $size );
324 }
325
326 $s .= $this->mSkin->revComment( $rev, false, true );
327
328 if( $notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp) ) {
329 $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>';
330 }
331 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
332 $s .= ' <tt>' . wfMsgHtml( 'deletedrev' ) . '</tt>';
333 }
334
335 $tools = array();
336
337 if( !is_null( $next ) && is_object( $next ) ) {
338 if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) {
339 $tools[] = '<span class="mw-rollback-link">'.$this->mSkin->buildRollbackLink( $rev ).'</span>';
340 }
341
342 if( $this->mTitle->quickUserCan( 'edit' ) && !$rev->isDeleted( Revision::DELETED_TEXT ) &&
343 !$next->rev_deleted & Revision::DELETED_TEXT )
344 {
345 # Create undo tooltip for the first (=latest) line only
346 $undoTooltip = $latest
347 ? array( 'title' => wfMsg( 'tooltip-undo' ) )
348 : array();
349 $undolink = $this->mSkin->link(
350 $this->mTitle,
351 wfMsgHtml( 'editundo' ),
352 $undoTooltip,
353 array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
354 array( 'known', 'noclasses' )
355 );
356 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
357 }
358 }
359
360 if( $tools ) {
361 $s .= ' (' . $wgLang->pipeList( $tools ) . ')';
362 }
363
364 # Tags
365 list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'history' );
366 $classes = array_merge( $classes, $newClasses );
367 $s .= " $tagSummary";
368
369 wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row , &$s ) );
370
371 $classes = implode( ' ', $classes );
372
373 return "<li class=\"$classes\">$s</li>\n";
374 }
375
376 /**
377 * Create a link to view this revision of the page
378 * @param Revision $rev
379 * @returns string
380 */
381 function revLink( $rev ) {
382 global $wgLang;
383 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
384 if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
385 $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, $date, "oldid=" . $rev->getId() );
386 } else {
387 $link = '<span class="history-deleted">' . $date . '</span>';
388 }
389 return $link;
390 }
391
392 /**
393 * Create a diff-to-current link for this revision for this page
394 * @param Revision $rev
395 * @param Bool $latest, this is the latest revision of the page?
396 * @returns string
397 */
398 function curLink( $rev, $latest ) {
399 $cur = $this->message['cur'];
400 if( $latest || $rev->isDeleted( Revision::DELETED_TEXT ) ) {
401 return $cur;
402 } else {
403 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $cur,
404 'diff=' . $this->mTitle->getLatestRevID() . "&oldid=" . $rev->getId() );
405 }
406 }
407
408 /**
409 * Create a diff-to-previous link for this revision for this page.
410 * @param Revision $prevRev, the previous revision
411 * @param mixed $next, the newer revision
412 * @param int $counter, what row on the history list this is
413 * @returns string
414 */
415 function lastLink( $prevRev, $next, $counter ) {
416 $last = $this->message['last'];
417 # $next may either be a Row, null, or "unkown"
418 $nextRev = is_object($next) ? new Revision( $next ) : $next;
419 if( is_null($next) ) {
420 # Probably no next row
421 return $last;
422 } elseif( $next === 'unknown' ) {
423 # Next row probably exists but is unknown, use an oldid=prev link
424 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last,
425 "diff=" . $prevRev->getId() . "&oldid=prev" );
426 } elseif( $prevRev->isDeleted(Revision::DELETED_TEXT) || $nextRev->isDeleted(Revision::DELETED_TEXT) ) {
427 return $last;
428 } else {
429 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last,
430 "diff=" . $prevRev->getId() . "&oldid={$next->rev_id}" );
431 }
432 }
433
434 /**
435 * Create radio buttons for page history
436 *
437 * @param object $rev Revision
438 * @param bool $firstInList Is this version the first one?
439 * @param int $counter A counter of what row number we're at, counted from the top row = 1.
440 * @return string HTML output for the radio buttons
441 */
442 function diffButtons( $rev, $firstInList, $counter ) {
443 if( $this->linesonpage > 1 ) {
444 $radio = array( 'type' => 'radio', 'value' => $rev->getId() );
445 /** @todo: move title texts to javascript */
446 if( $firstInList ) {
447 $first = Xml::element( 'input',
448 array_merge( $radio, array( 'style' => 'visibility:hidden', 'name' => 'oldid' ) )
449 );
450 $checkmark = array( 'checked' => 'checked' );
451 } else {
452 # Check visibility of old revisions
453 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
454 $radio['disabled'] = 'disabled';
455 $checkmark = array(); // We will check the next possible one
456 } else if( $counter == 2 || !$this->mOldIdChecked ) {
457 $checkmark = array( 'checked' => 'checked' );
458 $this->mOldIdChecked = $rev->getId();
459 } else {
460 $checkmark = array();
461 }
462 $first = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'oldid' ) ) );
463 $checkmark = array();
464 }
465 $second = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'diff' ) ) );
466 return $first . $second;
467 } else {
468 return '';
469 }
470 }
471
472 /**
473 * Fetch an array of revisions, specified by a given limit, offset and
474 * direction. This is now only used by the feeds. It was previously
475 * used by the main UI but that's now handled by the pager.
476 */
477 function fetchRevisions($limit, $offset, $direction) {
478 $dbr = wfGetDB( DB_SLAVE );
479
480 if( $direction == PageHistory::DIR_PREV )
481 list($dirs, $oper) = array("ASC", ">=");
482 else /* $direction == PageHistory::DIR_NEXT */
483 list($dirs, $oper) = array("DESC", "<=");
484
485 if( $offset )
486 $offsets = array("rev_timestamp $oper '$offset'");
487 else
488 $offsets = array();
489
490 $page_id = $this->mTitle->getArticleID();
491
492 return $dbr->select( 'revision',
493 Revision::selectFields(),
494 array_merge(array("rev_page=$page_id"), $offsets),
495 __METHOD__,
496 array( 'ORDER BY' => "rev_timestamp $dirs",
497 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit)
498 );
499 }
500
501 /**
502 * Output a subscription feed listing recent edits to this page.
503 * @param string $type
504 */
505 function feed( $type ) {
506 global $wgFeedClasses, $wgRequest, $wgFeedLimit;
507 if( !FeedUtils::checkFeedOutput($type) ) {
508 return;
509 }
510
511 $feed = new $wgFeedClasses[$type](
512 $this->mTitle->getPrefixedText() . ' - ' .
513 wfMsgForContent( 'history-feed-title' ),
514 wfMsgForContent( 'history-feed-description' ),
515 $this->mTitle->getFullUrl( 'action=history' ) );
516
517 // Get a limit on number of feed entries. Provide a sane default
518 // of 10 if none is defined (but limit to $wgFeedLimit max)
519 $limit = $wgRequest->getInt( 'limit', 10 );
520 if( $limit > $wgFeedLimit || $limit < 1 ) {
521 $limit = 10;
522 }
523 $items = $this->fetchRevisions($limit, 0, PageHistory::DIR_NEXT);
524
525 $feed->outHeader();
526 if( $items ) {
527 foreach( $items as $row ) {
528 $feed->outItem( $this->feedItem( $row ) );
529 }
530 } else {
531 $feed->outItem( $this->feedEmpty() );
532 }
533 $feed->outFooter();
534 }
535
536 function feedEmpty() {
537 global $wgOut;
538 return new FeedItem(
539 wfMsgForContent( 'nohistory' ),
540 $wgOut->parse( wfMsgForContent( 'history-feed-empty' ) ),
541 $this->mTitle->getFullUrl(),
542 wfTimestamp( TS_MW ),
543 '',
544 $this->mTitle->getTalkPage()->getFullUrl() );
545 }
546
547 /**
548 * Generate a FeedItem object from a given revision table row
549 * Borrows Recent Changes' feed generation functions for formatting;
550 * includes a diff to the previous revision (if any).
551 *
552 * @param $row
553 * @return FeedItem
554 */
555 function feedItem( $row ) {
556 $rev = new Revision( $row );
557 $rev->setTitle( $this->mTitle );
558 $text = FeedUtils::formatDiffRow( $this->mTitle,
559 $this->mTitle->getPreviousRevisionID( $rev->getId() ),
560 $rev->getId(),
561 $rev->getTimestamp(),
562 $rev->getComment() );
563
564 if( $rev->getComment() == '' ) {
565 global $wgContLang;
566 $title = wfMsgForContent( 'history-feed-item-nocomment',
567 $rev->getUserText(),
568 $wgContLang->timeanddate( $rev->getTimestamp() ) );
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'], $queryInfo['fields'], $queryInfo['conds'], $queryInfo['join_conds'], $this->tagFilter );
607 wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
608 return $queryInfo;
609 }
610
611 function getIndexField() {
612 return 'rev_timestamp';
613 }
614
615 function formatRow( $row ) {
616 if( $this->mLastRow ) {
617 $latest = $this->mCounter == 1 && $this->mIsFirst;
618 $firstInList = $this->mCounter == 1;
619 $s = $this->mPageHistory->historyLine( $this->mLastRow, $row, $this->mCounter++,
620 $this->mTitle->getNotificationTimestamp(), $latest, $firstInList );
621 } else {
622 $s = '';
623 }
624 $this->mLastRow = $row;
625 return $s;
626 }
627
628 function getStartBody() {
629 $this->mLastRow = false;
630 $this->mCounter = 1;
631 return '';
632 }
633
634 function getEndBody() {
635 if( $this->mLastRow ) {
636 $latest = $this->mCounter == 1 && $this->mIsFirst;
637 $firstInList = $this->mCounter == 1;
638 if( $this->mIsBackwards ) {
639 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
640 if( $this->mOffset == '' ) {
641 $next = null;
642 } else {
643 $next = 'unknown';
644 }
645 } else {
646 # The next row is the past-the-end row
647 $next = $this->mPastTheEndRow;
648 }
649 $s = $this->mPageHistory->historyLine( $this->mLastRow, $next, $this->mCounter++,
650 $this->mTitle->getNotificationTimestamp(), $latest, $firstInList );
651 } else {
652 $s = '';
653 }
654 return $s;
655 }
656 }