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