War on wfElement() and friends. Call the Xml members directly, rather than using...
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
1 <?php
2
3 /**
4 * Implements Special:Recentchanges
5 * @ingroup SpecialPage
6 */
7 class SpecialRecentChanges extends SpecialPage {
8 public function __construct() {
9 parent::__construct( 'Recentchanges' );
10 $this->includable( true );
11 }
12
13 /**
14 * Get a FormOptions object containing the default options
15 *
16 * @return FormOptions
17 */
18 public function getDefaultOptions() {
19 global $wgUser;
20 $opts = new FormOptions();
21
22 $opts->add( 'days', (int)$wgUser->getOption( 'rcdays' ) );
23 $opts->add( 'limit', (int)$wgUser->getOption( 'rclimit' ) );
24 $opts->add( 'from', '' );
25
26 $opts->add( 'hideminor', (bool)$wgUser->getOption( 'hideminor' ) );
27 $opts->add( 'hidebots', true );
28 $opts->add( 'hideanons', false );
29 $opts->add( 'hideliu', false );
30 $opts->add( 'hidepatrolled', false );
31 $opts->add( 'hidemyself', false );
32
33 $opts->add( 'namespace', '', FormOptions::INTNULL );
34 $opts->add( 'invert', false );
35
36 $opts->add( 'categories', '' );
37 $opts->add( 'categories_any', false );
38 return $opts;
39 }
40
41 /**
42 * Get a FormOptions object with options as specified by the user
43 *
44 * @return FormOptions
45 */
46 public function setup( $parameters ) {
47 global $wgRequest;
48
49 $opts = $this->getDefaultOptions();
50 $opts->fetchValuesFromRequest( $wgRequest );
51
52 // Give precedence to subpage syntax
53 if( $parameters !== null ) {
54 $this->parseParameters( $parameters, $opts );
55 }
56
57 $opts->validateIntBounds( 'limit', 0, 5000 );
58 return $opts;
59 }
60
61 /**
62 * Get a FormOptions object sepcific for feed requests
63 *
64 * @return FormOptions
65 */
66 public function feedSetup() {
67 global $wgFeedLimit, $wgRequest;
68 $opts = $this->getDefaultOptions();
69 $opts->fetchValuesFromRequest( $wgRequest, array( 'days', 'limit', 'hideminor' ) );
70 $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
71 return $opts;
72 }
73
74 /**
75 * Main execution point
76 *
77 * @param $parameters string
78 */
79 public function execute( $parameters ) {
80 global $wgRequest, $wgOut;
81 $feedFormat = $wgRequest->getVal( 'feed' );
82
83 # 10 seconds server-side caching max
84 $wgOut->setSquidMaxage( 10 );
85
86 $lastmod = $this->checkLastModified( $feedFormat );
87 if( $lastmod === false ){
88 return;
89 }
90
91 $opts = $feedFormat ? $this->feedSetup() : $this->setup( $parameters );
92 $this->setHeaders();
93 $this->outputHeader();
94
95 // Fetch results, prepare a batch link existence check query
96 $rows = array();
97 $batch = new LinkBatch;
98 $conds = $this->buildMainQueryConds( $opts );
99 $rows = $this->doMainQuery( $conds, $opts );
100 if( $rows === false ){
101 if( !$this->including() ) {
102 $this->doHeader( $opts );
103 }
104 return;
105 }
106
107 foreach( $rows as $row ) {
108 if( !$feedFormat ) {
109 // User page and talk links
110 $batch->add( NS_USER, $row->rc_user_text );
111 $batch->add( NS_USER_TALK, $row->rc_user_text );
112 }
113 }
114
115 if( $feedFormat ) {
116 list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat );
117 $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod );
118 } else {
119 $batch->execute();
120 $this->webOutput( $rows, $opts );
121 }
122
123 $rows->free();
124 }
125
126 /**
127 * Return an array with a ChangesFeed object and ChannelFeed object
128 *
129 * @return array
130 */
131 public function getFeedObject( $feedFormat ){
132 $feed = new ChangesFeed( $feedFormat, 'rcfeed' );
133 $feedObj = $feed->getFeedObject(
134 wfMsgForContent( 'recentchanges' ),
135 wfMsgForContent( 'recentchanges-feed-description' )
136 );
137 return array( $feed, $feedObj );
138 }
139
140 /**
141 * Process $par and put options found if $opts
142 * Mainly used when including the page
143 *
144 * @param $par String
145 * @param $opts FormOptions
146 */
147 public function parseParameters( $par, FormOptions $opts ) {
148 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
149 foreach( $bits as $bit ) {
150 if( 'hidebots' === $bit ) $opts['hidebots'] = true;
151 if( 'bots' === $bit ) $opts['hidebots'] = false;
152 if( 'hideminor' === $bit ) $opts['hideminor'] = true;
153 if( 'minor' === $bit ) $opts['hideminor'] = false;
154 if( 'hideliu' === $bit ) $opts['hideliu'] = true;
155 if( 'hidepatrolled' === $bit ) $opts['hidepatrolled'] = true;
156 if( 'hideanons' === $bit ) $opts['hideanons'] = true;
157 if( 'hidemyself' === $bit ) $opts['hidemyself'] = true;
158
159 if( is_numeric( $bit ) ) $opts['limit'] = $bit;
160
161 $m = array();
162 if( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) $opts['limit'] = $m[1];
163 if( preg_match( '/^days=(\d+)$/', $bit, $m ) ) $opts['days'] = $m[1];
164 }
165 }
166
167 /**
168 * Get last modified date, for client caching
169 * Don't use this if we are using the patrol feature, patrol changes don't
170 * update the timestamp
171 *
172 * @param $feedFormat String
173 * @return string or false
174 */
175 public function checkLastModified( $feedFormat ) {
176 global $wgUseRCPatrol, $wgOut;
177 $dbr = wfGetDB( DB_SLAVE );
178 $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __FUNCTION__ );
179 if( $feedFormat || !$wgUseRCPatrol ) {
180 if( $lastmod && $wgOut->checkLastModified( $lastmod ) ) {
181 # Client cache fresh and headers sent, nothing more to do.
182 return false;
183 }
184 }
185 return $lastmod;
186 }
187
188 /**
189 * Return an array of conditions depending of options set in $opts
190 *
191 * @param $opts FormOptions
192 * @return array
193 */
194 public function buildMainQueryConds( FormOptions $opts ) {
195 global $wgUser;
196
197 $dbr = wfGetDB( DB_SLAVE );
198 $conds = array();
199
200 # It makes no sense to hide both anons and logged-in users
201 # Where this occurs, force anons to be shown
202 $forcebot = false;
203 if( $opts['hideanons'] && $opts['hideliu'] ){
204 # Check if the user wants to show bots only
205 if( $opts['hidebots'] ){
206 $opts['hideanons'] = false;
207 } else {
208 $forcebot = true;
209 $opts['hidebots'] = false;
210 }
211 }
212
213 // Calculate cutoff
214 $cutoff_unixtime = time() - ( $opts['days'] * 86400 );
215 $cutoff_unixtime = $cutoff_unixtime - ($cutoff_unixtime % 86400);
216 $cutoff = $dbr->timestamp( $cutoff_unixtime );
217
218 $fromValid = preg_match('/^[0-9]{14}$/', $opts['from']);
219 if( $fromValid && $opts['from'] > wfTimestamp(TS_MW,$cutoff) ) {
220 $cutoff = $dbr->timestamp($opts['from']);
221 } else {
222 $opts->reset( 'from' );
223 }
224
225 $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff );
226
227
228 $hidePatrol = $wgUser->useRCPatrol() && $opts['hidepatrolled'];
229 $hideLoggedInUsers = $opts['hideliu'] && !$forcebot;
230 $hideAnonymousUsers = $opts['hideanons'] && !$forcebot;
231
232 if( $opts['hideminor'] ) $conds['rc_minor'] = 0;
233 if( $opts['hidebots'] ) $conds['rc_bot'] = 0;
234 if( $hidePatrol ) $conds['rc_patrolled'] = 0;
235 if( $forcebot ) $conds['rc_bot'] = 1;
236 if( $hideLoggedInUsers ) $conds[] = 'rc_user = 0';
237 if( $hideAnonymousUsers ) $conds[] = 'rc_user != 0';
238
239 if( $opts['hidemyself'] ) {
240 if( $wgUser->getId() ) {
241 $conds[] = 'rc_user != ' . $dbr->addQuotes( $wgUser->getId() );
242 } else {
243 $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() );
244 }
245 }
246
247 # Namespace filtering
248 if( $opts['namespace'] !== '' ) {
249 if( !$opts['invert'] ) {
250 $conds[] = 'rc_namespace = ' . $dbr->addQuotes( $opts['namespace'] );
251 } else {
252 $conds[] = 'rc_namespace != ' . $dbr->addQuotes( $opts['namespace'] );
253 }
254 }
255
256 return $conds;
257 }
258
259 /**
260 * Process the query
261 *
262 * @param $conds array
263 * @param $opts FormOptions
264 * @return database result or false (for Recentchangeslinked only)
265 */
266 public function doMainQuery( $conds, $opts ) {
267 global $wgUser;
268
269 $tables = array( 'recentchanges' );
270 $join_conds = array();
271
272 $uid = $wgUser->getId();
273 $dbr = wfGetDB( DB_SLAVE );
274 $limit = $opts['limit'];
275 $namespace = $opts['namespace'];
276 $invert = $opts['invert'];
277
278 // JOIN on watchlist for users
279 if( $uid ) {
280 $tables[] = 'watchlist';
281 $join_conds = array( 'watchlist' => array('LEFT JOIN',
282 "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace") );
283 }
284
285 wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) );
286
287 // Is there either one namespace selected or excluded?
288 // Also, if this is "all" or main namespace, just use timestamp index.
289 if( is_null($namespace) || $invert || $namespace == NS_MAIN ) {
290 $res = $dbr->select( $tables, '*', $conds, __METHOD__,
291 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit,
292 'USE INDEX' => array('recentchanges' => 'rc_timestamp') ),
293 $join_conds );
294 // We have a new_namespace_time index! UNION over new=(0,1) and sort result set!
295 } else {
296 // New pages
297 $sqlNew = $dbr->selectSQLText( $tables, '*',
298 array( 'rc_new' => 1 ) + $conds,
299 __METHOD__,
300 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit,
301 'USE INDEX' => array('recentchanges' => 'new_name_timestamp') ),
302 $join_conds );
303 // Old pages
304 $sqlOld = $dbr->selectSQLText( $tables, '*',
305 array( 'rc_new' => 0 ) + $conds,
306 __METHOD__,
307 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit,
308 'USE INDEX' => array('recentchanges' => 'new_name_timestamp') ),
309 $join_conds );
310 # Join the two fast queries, and sort the result set
311 $sql = "($sqlNew) UNION ($sqlOld) ORDER BY rc_timestamp DESC LIMIT $limit";
312 $res = $dbr->query( $sql, __METHOD__ );
313 }
314
315 return $res;
316 }
317
318 /**
319 * Send output to $wgOut, only called if not used feeds
320 *
321 * @param $rows array of database rows
322 * @param $opts FormOptions
323 */
324 public function webOutput( $rows, $opts ) {
325 global $wgOut, $wgUser, $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
326 global $wgAllowCategorizedRecentChanges;
327
328 $limit = $opts['limit'];
329
330 if( !$this->including() ) {
331 // Output options box
332 $this->doHeader( $opts );
333 }
334
335 // And now for the content
336 $wgOut->setSyndicated( true );
337
338 if( $wgAllowCategorizedRecentChanges ) {
339 $this->filterByCategories( $rows, $opts );
340 }
341
342 $showWatcherCount = $wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' );
343 $watcherCache = array();
344
345 $dbr = wfGetDB( DB_SLAVE );
346
347 $counter = 1;
348 $list = ChangesList::newFromUser( $wgUser );
349
350 $s = $list->beginRecentChangesList();
351 foreach( $rows as $obj ) {
352 if( $limit == 0 ) {
353 break;
354 }
355 $rc = RecentChange::newFromRow( $obj );
356 $rc->counter = $counter++;
357
358 $rc->notificationtimestamp = false; // Default
359 if( $wgShowUpdatedMarker && !empty($obj->wl_notificationtimestamp) ) {
360 $rc->notificationtimestamp = ($obj->rc_timestamp >= $obj->wl_notificationtimestamp);
361 }
362
363 $rc->numberofWatchingusers = 0; // Default
364 if( $showWatcherCount && $obj->rc_namespace >= 0 ) {
365 if( !isset($watcherCache[$obj->rc_namespace][$obj->rc_title]) ) {
366 $watcherCache[$obj->rc_namespace][$obj->rc_title] =
367 $dbr->selectField( 'watchlist',
368 'COUNT(*)',
369 array(
370 'wl_namespace' => $obj->rc_namespace,
371 'wl_title' => $obj->rc_title,
372 ),
373 __METHOD__ . '-watchers' );
374 }
375 $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
376 }
377 $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ) );
378 --$limit;
379 }
380 $s .= $list->endRecentChangesList();
381 $wgOut->addHTML( $s );
382 }
383
384 /**
385 * Return the text to be displayed above the changes
386 *
387 * @param $opts FormOptions
388 * @return String: XHTML
389 */
390 public function doHeader( $opts ) {
391 global $wgScript, $wgOut;
392
393 $this->setTopText( $wgOut, $opts );
394
395 $defaults = $opts->getAllValues();
396 $nondefaults = $opts->getChangedValues();
397 $opts->consumeValues( array( 'namespace', 'invert' ) );
398
399 $panel = array();
400 $panel[] = $this->optionsPanel( $defaults, $nondefaults );
401 $panel[] = '<hr />';
402
403 $extraOpts = $this->getExtraOptions( $opts );
404 $extraOptsCount = count( $extraOpts );
405 $count = 0;
406 $submit = ' ' . Xml::submitbutton( wfMsg( 'allpagessubmit' ) );
407
408 $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
409 foreach( $extraOpts as $optionRow ) {
410 # Add submit button to the last row only
411 ++$count;
412 $addSubmit = $count === $extraOptsCount ? $submit : '';
413
414 $out .= Xml::openElement( 'tr' );
415 if( is_array( $optionRow ) ) {
416 $out .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $optionRow[0] );
417 $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
418 } else {
419 $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit );
420 }
421 $out .= Xml::closeElement( 'tr' );
422 }
423 $out .= Xml::closeElement( 'table' );
424
425 $unconsumed = $opts->getUnconsumedValues();
426 foreach( $unconsumed as $key => $value ) {
427 $out .= Xml::hidden( $key, $value );
428 }
429
430 $t = $this->getTitle();
431 $out .= Xml::hidden( 'title', $t->getPrefixedText() );
432 $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
433 $panel[] = $form;
434 $panelString = implode( "\n", $panel );
435
436 $wgOut->addHTML(
437 Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) )
438 );
439
440 $this->setBottomText( $wgOut, $opts );
441 }
442
443 /**
444 * Get options to be displayed in a form
445 *
446 * @param $opts FormOptions
447 * @return array
448 */
449 function getExtraOptions( $opts ){
450 $extraOpts = array();
451 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
452
453 global $wgAllowCategorizedRecentChanges;
454 if( $wgAllowCategorizedRecentChanges ) {
455 $extraOpts['category'] = $this->categoryFilterForm( $opts );
456 }
457
458 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
459 return $extraOpts;
460 }
461
462 /**
463 * Send the text to be displayed above the options
464 *
465 * @param $out OutputPage
466 * @param $opts FormOptions
467 */
468 function setTopText( OutputPage $out, FormOptions $opts ){
469 $out->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) );
470 }
471
472 /**
473 * Send the text to be displayed after the options, for use in
474 * Recentchangeslinked
475 *
476 * @param $out OutputPage
477 * @param $opts FormOptions
478 */
479 function setBottomText( OutputPage $out, FormOptions $opts ){}
480
481 /**
482 * Creates the choose namespace selection
483 *
484 * @param $opts FormOptions
485 * @return string
486 */
487 protected function namespaceFilterForm( FormOptions $opts ) {
488 $nsSelect = Xml::namespaceSelector( $opts['namespace'], '' );
489 $nsLabel = Xml::label( wfMsg('namespace'), 'namespace' );
490 $invert = Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $opts['invert'] );
491 return array( $nsLabel, "$nsSelect $invert" );
492 }
493
494 /**
495 * Create a input to filter changes by categories
496 *
497 * @param $opts FormOptions
498 * @return array
499 */
500 protected function categoryFilterForm( FormOptions $opts ) {
501 list( $label, $input ) = Xml::inputLabelSep( wfMsg('rc_categories'),
502 'categories', 'mw-categories', false, $opts['categories'] );
503
504 $input .= ' ' . Xml::checkLabel( wfMsg('rc_categories_any'),
505 'categories_any', 'mw-categories_any', $opts['categories_any'] );
506
507 return array( $label, $input );
508 }
509
510 /**
511 * Filter $rows by categories set in $opts
512 *
513 * @param $rows array of database rows
514 * @param $opts FormOptions
515 */
516 function filterByCategories( &$rows, FormOptions $opts ) {
517 $categories = array_map( 'trim', explode( "|" , $opts['categories'] ) );
518
519 if( empty($categories) ) {
520 return;
521 }
522
523 # Filter categories
524 $cats = array();
525 foreach( $categories as $cat ) {
526 $cat = trim( $cat );
527 if( $cat == "" ) continue;
528 $cats[] = $cat;
529 }
530
531 # Filter articles
532 $articles = array();
533 $a2r = array();
534 foreach( $rows AS $k => $r ) {
535 $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
536 $id = $nt->getArticleID();
537 if( $id == 0 ) continue; # Page might have been deleted...
538 if( !in_array($id, $articles) ) {
539 $articles[] = $id;
540 }
541 if( !isset($a2r[$id]) ) {
542 $a2r[$id] = array();
543 }
544 $a2r[$id][] = $k;
545 }
546
547 # Shortcut?
548 if( !count($articles) || !count($cats) )
549 return ;
550
551 # Look up
552 $c = new Categoryfinder ;
553 $c->seed( $articles, $cats, $opts['categories_any'] ? "OR" : "AND" ) ;
554 $match = $c->run();
555
556 # Filter
557 $newrows = array();
558 foreach( $match AS $id ) {
559 foreach( $a2r[$id] AS $rev ) {
560 $k = $rev;
561 $newrows[$k] = $rows[$k];
562 }
563 }
564 $rows = $newrows;
565 }
566
567 /**
568 * Makes change an option link which carries all the other options
569 * @param $title see Title
570 * @param $override
571 * @param $options
572 */
573 function makeOptionsLink( $title, $override, $options, $active = false ) {
574 global $wgUser;
575 $sk = $wgUser->getSkin();
576 $params = $override + $options;
577 return $sk->link( $this->getTitle(), htmlspecialchars( $title ),
578 ( $active ? array( 'style'=>'font-weight: bold;' ) : array() ), $params, array( 'known' ) );
579 }
580
581 /**
582 * Creates the options panel.
583 * @param $defaults array
584 * @param $nondefaults array
585 */
586 function optionsPanel( $defaults, $nondefaults ) {
587 global $wgLang, $wgUser, $wgRCLinkLimits, $wgRCLinkDays;
588
589 $options = $nondefaults + $defaults;
590
591 $note = '';
592 if( $options['from'] ) {
593 $note .= wfMsgExt( 'rcnotefrom', array( 'parseinline' ),
594 $wgLang->formatNum( $options['limit'] ),
595 $wgLang->timeanddate( $options['from'], true ) ) . '<br />';
596 }
597 if( !wfEmptyMsg( 'rclegend', wfMsg('rclegend') ) ) {
598 $note .= wfMsgExt( 'rclegend', array('parseinline') ) . '<br />';
599 }
600
601 # Sort data for display and make sure it's unique after we've added user data.
602 $wgRCLinkLimits[] = $options['limit'];
603 $wgRCLinkDays[] = $options['days'];
604 sort( $wgRCLinkLimits );
605 sort( $wgRCLinkDays );
606 $wgRCLinkLimits = array_unique( $wgRCLinkLimits );
607 $wgRCLinkDays = array_unique( $wgRCLinkDays );
608
609 // limit links
610 foreach( $wgRCLinkLimits as $value ) {
611 $cl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
612 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ) ;
613 }
614 $cl = implode( ' | ', $cl );
615
616 // day links, reset 'from' to none
617 foreach( $wgRCLinkDays as $value ) {
618 $dl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
619 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ) ;
620 }
621 $dl = implode( ' | ', $dl );
622
623
624 // show/hide links
625 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
626 $minorLink = $this->makeOptionsLink( $showhide[1-$options['hideminor']],
627 array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults);
628 $botLink = $this->makeOptionsLink( $showhide[1-$options['hidebots']],
629 array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults);
630 $anonsLink = $this->makeOptionsLink( $showhide[ 1 - $options['hideanons'] ],
631 array( 'hideanons' => 1 - $options['hideanons'] ), $nondefaults );
632 $liuLink = $this->makeOptionsLink( $showhide[1-$options['hideliu']],
633 array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults);
634 $patrLink = $this->makeOptionsLink( $showhide[1-$options['hidepatrolled']],
635 array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
636 $myselfLink = $this->makeOptionsLink( $showhide[1-$options['hidemyself']],
637 array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults);
638
639 $links[] = wfMsgHtml( 'rcshowhideminor', $minorLink );
640 $links[] = wfMsgHtml( 'rcshowhidebots', $botLink );
641 $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink );
642 $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink );
643 if( $wgUser->useRCPatrol() )
644 $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
645 $links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
646 $hl = implode( ' | ', $links );
647
648 // show from this onward link
649 $now = $wgLang->timeanddate( wfTimestampNow(), true );
650 $tl = $this->makeOptionsLink( $now, array( 'from' => wfTimestampNow() ), $nondefaults );
651
652 $rclinks = wfMsgExt( 'rclinks', array( 'parseinline', 'replaceafter' ),
653 $cl, $dl, $hl );
654 $rclistfrom = wfMsgExt( 'rclistfrom', array( 'parseinline', 'replaceafter' ), $tl );
655 return "{$note}$rclinks<br />$rclistfrom";
656 }
657 }