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