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