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