c8f3595ebdde9cc48e599541051fefb770be99ef
[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 // For hook compatibility...
275 function getArticle() {
276 return $this->historyPage->getArticle();
277 }
278
279 function getQueryInfo() {
280 $queryInfo = array(
281 'tables' => array('revision'),
282 'fields' => array_merge( Revision::selectFields(), array('ts_tags') ),
283 'conds' => array('rev_page' => $this->historyPage->title->getArticleID() ),
284 'options' => array( 'USE INDEX' => array('revision' => 'page_timestamp') ),
285 'join_conds' => array( 'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
286 );
287 ChangeTags::modifyDisplayQuery( $queryInfo['tables'],
288 $queryInfo['fields'],
289 $queryInfo['conds'],
290 $queryInfo['join_conds'],
291 $queryInfo['options'],
292 $this->tagFilter );
293 wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
294 return $queryInfo;
295 }
296
297 function getIndexField() {
298 return 'rev_timestamp';
299 }
300
301 function formatRow( $row ) {
302 if( $this->lastRow ) {
303 $latest = $this->counter == 1 && $this->mIsFirst;
304 $firstInList = $this->counter == 1;
305 $s = $this->historyLine( $this->lastRow, $row, $this->counter++,
306 $this->title->getNotificationTimestamp(), $latest, $firstInList );
307 } else {
308 $s = '';
309 }
310 $this->lastRow = $row;
311 return $s;
312 }
313
314 /**
315 * Creates begin of history list with a submit button
316 *
317 * @return string HTML output
318 */
319 function getStartBody() {
320 global $wgScript, $wgEnableHtmlDiff, $wgUser;
321 $this->lastRow = false;
322 $this->counter = 1;
323 $this->oldIdChecked = 0;
324
325 $s = wfMsgExt( 'histlegend', array( 'parse') );
326 if( $this->getNumRows() > 1 && $wgUser->isAllowed('deleterevision') ) {
327 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
328 $s .= Xml::openElement( 'form',
329 array(
330 'action' => $revdel->getLocalURL( array(
331 'type' => 'revision',
332 'target' => $this->title->getPrefixedDbKey()
333 ) ),
334 'method' => 'post',
335 'id' => 'mw-history-revdeleteform',
336 'style' => 'visibility:hidden;float:right;'
337 )
338 );
339 $s .= Xml::hidden( 'ids', '', array('id'=>'revdel-oldid') );
340 $s .= Xml::submitButton( wfMsg( 'showhideselectedversions' ) );
341 $s .= Xml::closeElement( 'form' );
342 }
343 $s .= Xml::openElement( 'form', array( 'action' => $wgScript,
344 'id' => 'mw-history-compare' ) );
345 $s .= Xml::hidden( 'title', $this->title->getPrefixedDbKey() );
346 if( $wgEnableHtmlDiff ) {
347 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
348 array(
349 'name' => 'htmldiff',
350 'class' => 'historysubmit',
351 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
352 'title' => wfMsg( 'tooltip-compareselectedversions' ),
353 )
354 );
355 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
356 array(
357 'class' => 'historysubmit',
358 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
359 'title' => wfMsg( 'tooltip-compareselectedversions' ),
360 )
361 );
362 } else {
363 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
364 array(
365 'class' => 'historysubmit',
366 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
367 'title' => wfMsg( 'tooltip-compareselectedversions' ),
368 )
369 );
370 }
371 $s .= '<ul id="pagehistory">' . "\n";
372 return $s;
373 }
374
375 function getEndBody() {
376
377 if( $this->lastRow ) {
378 $latest = $this->counter == 1 && $this->mIsFirst;
379 $firstInList = $this->counter == 1;
380 if( $this->mIsBackwards ) {
381 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
382 if( $this->mOffset == '' ) {
383 $next = null;
384 } else {
385 $next = 'unknown';
386 }
387 } else {
388 # The next row is the past-the-end row
389 $next = $this->mPastTheEndRow;
390 }
391 $s = $this->historyLine( $this->lastRow, $next, $this->counter++,
392 $this->title->getNotificationTimestamp(), $latest, $firstInList );
393 } else {
394 $s = '';
395 }
396
397 global $wgEnableHtmlDiff;
398 $s .= '</ul>';
399 if( $wgEnableHtmlDiff ) {
400 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
401 array(
402 'name' => 'htmldiff',
403 'class' => 'historysubmit',
404 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
405 'title' => wfMsg( 'tooltip-compareselectedversions' ),
406 )
407 );
408 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
409 array(
410 'class' => 'historysubmit',
411 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
412 'title' => wfMsg( 'tooltip-compareselectedversions' ),
413 )
414 );
415 } else {
416 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
417 array(
418 'class' => 'historysubmit',
419 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
420 'title' => wfMsg( 'tooltip-compareselectedversions' ),
421 )
422 );
423 }
424 $s .= '</form>';
425 return $s;
426 }
427
428 /**
429 * Creates a submit button
430 *
431 * @param array $attributes attributes
432 * @return string HTML output for the submit button
433 */
434 function submitButton($message, $attributes = array() ) {
435 # Disable submit button if history has 1 revision only
436 if( $this->getNumRows() > 1 ) {
437 return Xml::submitButton( $message , $attributes );
438 } else {
439 return '';
440 }
441 }
442
443 /**
444 * Returns a row from the history printout.
445 *
446 * @todo document some more, and maybe clean up the code (some params redundant?)
447 *
448 * @param Row $row The database row corresponding to the previous line.
449 * @param mixed $next The database row corresponding to the next line.
450 * @param int $counter Apparently a counter of what row number we're at, counted from the top row = 1.
451 * @param $notificationtimestamp
452 * @param bool $latest Whether this row corresponds to the page's latest revision.
453 * @param bool $firstInList Whether this row corresponds to the first displayed on this history page.
454 * @return string HTML output for the row
455 */
456 function historyLine( $row, $next, $counter = '', $notificationtimestamp = false,
457 $latest = false, $firstInList = false )
458 {
459 global $wgUser, $wgLang;
460 $rev = new Revision( $row );
461 $rev->setTitle( $this->title );
462
463 $curlink = $this->curLink( $rev, $latest );
464 $lastlink = $this->lastLink( $rev, $next, $counter );
465 $diffButtons = $this->diffButtons( $rev, $firstInList, $counter );
466 $link = $this->revLink( $rev );
467 $classes = array();
468
469 $s = "($curlink) ($lastlink) $diffButtons";
470
471 if( $wgUser->isAllowed( 'deleterevision' ) ) {
472 // Hide JS by default for non-JS browsing
473 $hidden = array( 'style' => 'display:none' );
474 // If revision was hidden from sysops
475 if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
476 $del = Xml::check( 'deleterevisions', false,
477 $hidden + array('disabled' => 'disabled') );
478 $del .= Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ),
479 '(' . $this->historyPage->message['rev-delundel'] . ')' );
480 // Otherwise, show the link...
481 } else {
482 $id = $rev->getId();
483 $jsCall = "updateShowHideForm($id,this.checked)";
484 $del = Xml::check( 'showhiderevisions', false,
485 $hidden + array(
486 'onchange' => $jsCall,
487 'id' => "mw-revdel-$id" ) );
488 $query = array(
489 'type' => 'revision',
490 'target' => $this->title->getPrefixedDbkey(),
491 'ids' => $rev->getId() );
492 $del .= $this->getSkin()->revDeleteLink( $query,
493 $rev->isDeleted( Revision::DELETED_RESTRICTED ) );
494 }
495 $s .= " $del ";
496 }
497
498 $s .= " $link";
499 $s .= " <span class='history-user'>" . $this->getSkin()->revUserTools( $rev, true ) . "</span>";
500
501 if( $rev->isMinor() ) {
502 $s .= ' ' . ChangesList::flag( 'minor' );
503 }
504
505 if( !is_null( $size = $rev->getSize() ) && !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
506 $s .= ' ' . $this->getSkin()->formatRevisionSize( $size );
507 }
508
509 $s .= $this->getSkin()->revComment( $rev, false, true );
510
511 if( $notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp) ) {
512 $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>';
513 }
514
515 $tools = array();
516
517 if( !is_null( $next ) && is_object( $next ) ) {
518 if( $latest && $this->title->userCan( 'rollback' ) && $this->title->userCan( 'edit' ) ) {
519 $tools[] = '<span class="mw-rollback-link">'.
520 $this->getSkin()->buildRollbackLink( $rev ).'</span>';
521 }
522
523 if( $this->title->quickUserCan( 'edit' )
524 && !$rev->isDeleted( Revision::DELETED_TEXT )
525 && !$next->rev_deleted & Revision::DELETED_TEXT )
526 {
527 # Create undo tooltip for the first (=latest) line only
528 $undoTooltip = $latest
529 ? array( 'title' => wfMsg( 'tooltip-undo' ) )
530 : array();
531 $undolink = $this->getSkin()->link(
532 $this->title,
533 wfMsgHtml( 'editundo' ),
534 $undoTooltip,
535 array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
536 array( 'known', 'noclasses' )
537 );
538 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
539 }
540 }
541
542 if( $tools ) {
543 $s .= ' (' . $wgLang->pipeList( $tools ) . ')';
544 }
545
546 # Tags
547 list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'history' );
548 $classes = array_merge( $classes, $newClasses );
549 $s .= " $tagSummary";
550
551 wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row , &$s ) );
552
553 $attribs = array();
554 if ( $classes ) {
555 $attribs['class'] = implode( ' ', $classes );
556 }
557
558 return Xml::tags( 'li', $attribs, $s ) . "\n";
559 }
560
561 /**
562 * Create a link to view this revision of the page
563 * @param Revision $rev
564 * @returns string
565 */
566 function revLink( $rev ) {
567 global $wgLang;
568 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
569 $date = htmlspecialchars( $date );
570 if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
571 $link = $this->getSkin()->link(
572 $this->title,
573 $date,
574 array(),
575 array( 'oldid' => $rev->getId() ),
576 array( 'known', 'noclasses' )
577 );
578 } else {
579 $link = "<span class=\"history-deleted\">$date</span>";
580 }
581 return $link;
582 }
583
584 /**
585 * Create a diff-to-current link for this revision for this page
586 * @param Revision $rev
587 * @param Bool $latest, this is the latest revision of the page?
588 * @returns string
589 */
590 function curLink( $rev, $latest ) {
591 $cur = $this->historyPage->message['cur'];
592 if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) {
593 return $cur;
594 } else {
595 return $this->getSkin()->link(
596 $this->title,
597 $cur,
598 array(),
599 array(
600 'diff' => $this->title->getLatestRevID(),
601 'oldid' => $rev->getId()
602 ),
603 array( 'known', 'noclasses' )
604 );
605 }
606 }
607
608 /**
609 * Create a diff-to-previous link for this revision for this page.
610 * @param Revision $prevRev, the previous revision
611 * @param mixed $next, the newer revision
612 * @param int $counter, what row on the history list this is
613 * @returns string
614 */
615 function lastLink( $prevRev, $next, $counter ) {
616 $last = $this->historyPage->message['last'];
617 # $next may either be a Row, null, or "unkown"
618 $nextRev = is_object($next) ? new Revision( $next ) : $next;
619 if( is_null($next) ) {
620 # Probably no next row
621 return $last;
622 } elseif( $next === 'unknown' ) {
623 # Next row probably exists but is unknown, use an oldid=prev link
624 return $this->getSkin()->link(
625 $this->title,
626 $last,
627 array(),
628 array(
629 'diff' => $prevRev->getId(),
630 'oldid' => 'prev'
631 ),
632 array( 'known', 'noclasses' )
633 );
634 } elseif( !$prevRev->userCan(Revision::DELETED_TEXT) || !$nextRev->userCan(Revision::DELETED_TEXT) ) {
635 return $last;
636 } else {
637 return $this->getSkin()->link(
638 $this->title,
639 $last,
640 array(),
641 array(
642 'diff' => $prevRev->getId(),
643 'oldid' => $next->rev_id
644 ),
645 array( 'known', 'noclasses' )
646 );
647 }
648 }
649
650 /**
651 * Create radio buttons for page history
652 *
653 * @param object $rev Revision
654 * @param bool $firstInList Is this version the first one?
655 * @param int $counter A counter of what row number we're at, counted from the top row = 1.
656 * @return string HTML output for the radio buttons
657 */
658 function diffButtons( $rev, $firstInList, $counter ) {
659 if( $this->getNumRows() > 1 ) {
660 $id = $rev->getId();
661 $radio = array( 'type' => 'radio', 'value' => $id );
662 /** @todo: move title texts to javascript */
663 if( $firstInList ) {
664 $first = Xml::element( 'input',
665 array_merge( $radio, array(
666 'style' => 'visibility:hidden',
667 'name' => 'oldid',
668 'id' => 'mw-oldid-null' ) )
669 );
670 $checkmark = array( 'checked' => 'checked' );
671 } else {
672 # Check visibility of old revisions
673 if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
674 $radio['disabled'] = 'disabled';
675 $checkmark = array(); // We will check the next possible one
676 } else if( $counter == 2 || !$this->oldIdChecked ) {
677 $checkmark = array( 'checked' => 'checked' );
678 $this->oldIdChecked = $id;
679 } else {
680 $checkmark = array();
681 }
682 $first = Xml::element( 'input',
683 array_merge( $radio, $checkmark, array(
684 'name' => 'oldid',
685 'id' => "mw-oldid-$id" ) ) );
686 $checkmark = array();
687 }
688 $second = Xml::element( 'input',
689 array_merge( $radio, $checkmark, array(
690 'name' => 'diff',
691 'id' => "mw-diff-$id" ) ) );
692 return $first . $second;
693 } else {
694 return '';
695 }
696 }
697 }
698
699 /**
700 * Backwards-compatibility aliases
701 */
702 class PageHistory extends HistoryPage {}
703 class PageHistoryPager extends HistoryPager {}
704