(bug 14659) Passing the default limit param to Special:Recentchanges no more falls...
[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 $res = $this->doMainQuery( $conds, $opts );
100 if( $res === false ){
101 $this->doHeader( $opts );
102 return;
103 }
104 $dbr = wfGetDB( DB_SLAVE );
105 while( $row = $dbr->fetchObject( $res ) ){
106 $rows[] = $row;
107 if ( !$feedFormat ) {
108 // User page and talk links
109 $batch->add( NS_USER, $row->rc_user_text );
110 $batch->add( NS_USER_TALK, $row->rc_user_text );
111 }
112
113 }
114 $dbr->freeResult( $res );
115
116 if ( $feedFormat ) {
117 list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat );
118 $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod );
119 } else {
120 $batch->execute();
121 $this->webOutput( $rows, $opts );
122 }
123
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 int 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',"wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace") );
282 }
283
284 wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) );
285
286 // Is there either one namespace selected or excluded?
287 // Also, if this is "all" or main namespace, just use timestamp index.
288 if( is_null($namespace) || $invert || $namespace == NS_MAIN ) {
289 $res = $dbr->select( $tables, '*', $conds, __METHOD__,
290 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit,
291 'USE INDEX' => array('recentchanges' => 'rc_timestamp') ),
292 $join_conds );
293 // We have a new_namespace_time index! UNION over new=(0,1) and sort result set!
294 } else {
295 // New pages
296 $sqlNew = $dbr->selectSQLText( $tables, '*',
297 array( 'rc_new' => 1 ) + $conds,
298 __METHOD__,
299 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit,
300 'USE INDEX' => array('recentchanges' => 'new_name_timestamp') ),
301 $join_conds );
302 // Old pages
303 $sqlOld = $dbr->selectSQLText( $tables, '*',
304 array( 'rc_new' => 0 ) + $conds,
305 __METHOD__,
306 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit,
307 'USE INDEX' => array('recentchanges' => 'new_name_timestamp') ),
308 $join_conds );
309 # Join the two fast queries, and sort the result set
310 $sql = "($sqlNew) UNION ($sqlOld) ORDER BY rc_timestamp DESC LIMIT $limit";
311 $res = $dbr->query( $sql, __METHOD__ );
312 }
313
314 return $res;
315 }
316
317 /**
318 * Send output to $wgOut, only called if not used feeds
319 *
320 * @param $rows array of database rows
321 * @param $opts FormOptions
322 */
323 public function webOutput( $rows, $opts ) {
324 global $wgOut, $wgUser, $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
325 global $wgAllowCategorizedRecentChanges;
326
327 $limit = $opts['limit'];
328
329 if ( !$this->including() ) {
330 // Output options box
331 $this->doHeader( $opts );
332 }
333
334 // And now for the content
335 $wgOut->setSyndicated( true );
336
337 $list = ChangesList::newFromUser( $wgUser );
338
339 if ( $wgAllowCategorizedRecentChanges ) {
340 $this->filterByCategories( $rows, $opts );
341 }
342
343 $s = $list->beginRecentChangesList();
344 $counter = 1;
345
346 $showWatcherCount = $wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' );
347 $watcherCache = array();
348
349 $dbr = wfGetDB( DB_SLAVE );
350
351 foreach( $rows as $obj ){
352 if( $limit == 0) {
353 break;
354 }
355
356 if ( ! ( $opts['hideminor'] && $obj->rc_minor ) &&
357 ! ( $opts['hidepatrolled'] && $obj->rc_patrolled ) ) {
358 $rc = RecentChange::newFromRow( $obj );
359 $rc->counter = $counter++;
360
361 if ($wgShowUpdatedMarker
362 && !empty( $obj->wl_notificationtimestamp )
363 && ($obj->rc_timestamp >= $obj->wl_notificationtimestamp)) {
364 $rc->notificationtimestamp = true;
365 } else {
366 $rc->notificationtimestamp = false;
367 }
368
369 $rc->numberofWatchingusers = 0; // Default
370 if ($showWatcherCount && $obj->rc_namespace >= 0) {
371 if (!isset($watcherCache[$obj->rc_namespace][$obj->rc_title])) {
372 $watcherCache[$obj->rc_namespace][$obj->rc_title] =
373 $dbr->selectField( 'watchlist',
374 'COUNT(*)',
375 array(
376 'wl_namespace' => $obj->rc_namespace,
377 'wl_title' => $obj->rc_title,
378 ),
379 __METHOD__ . '-watchers' );
380 }
381 $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
382 }
383 $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ) );
384 --$limit;
385 }
386 }
387 $s .= $list->endRecentChangesList();
388 $wgOut->addHTML( $s );
389 }
390
391 /**
392 * Return the text to be displayed above the changes
393 *
394 * @param $opts FormOptions
395 * @return String: XHTML
396 */
397 public function doHeader( $opts ) {
398 global $wgScript, $wgOut;
399
400 $this->setTopText( $wgOut, $opts );
401
402 $defaults = $opts->getAllValues();
403 $nondefaults = $opts->getChangedValues();
404 $opts->consumeValues( array( 'namespace', 'invert' ) );
405
406 $panel = array();
407 $panel[] = $this->optionsPanel( $defaults, $nondefaults );
408 $panel[] = '<hr />';
409
410 $extraOpts = $this->getExtraOptions( $opts );
411
412 $out = Xml::openElement( 'table' );
413 foreach ( $extraOpts as $optionRow ) {
414 $out .= Xml::openElement( 'tr' );
415 if ( is_array($optionRow) ) {
416 $out .= Xml::tags( 'td', null, $optionRow[0] );
417 $out .= Xml::tags( 'td', null, $optionRow[1] );
418 } else {
419 $out .= Xml::tags( 'td', array( 'colspan' => 2 ), $optionRow );
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( strtolower( $this->mName ) ), $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 $extraOpts['submit'] = Xml::submitbutton( wfMsg('allpagessubmit') );
460 return $extraOpts;
461 }
462
463 /**
464 * Send the text to be displayed above the options
465 *
466 * @param $out OutputPage
467 * @param $opts FormOptions
468 */
469 function setTopText( &$out, $opts ){
470 $out->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) );
471 }
472
473 /**
474 * Send the text to be displayed after the options, for use in
475 * Recentchangeslinked
476 *
477 * @param $out OutputPage
478 * @param $opts FormOptions
479 */
480 function setBottomText( &$out, $opts ){}
481
482 /**
483 * Creates the choose namespace selection
484 *
485 * @param $opts FormOptions
486 * @return string
487 */
488 protected function namespaceFilterForm( FormOptions $opts ) {
489 $nsSelect = HTMLnamespaceselector( $opts['namespace'], '' );
490 $nsLabel = Xml::label( wfMsg('namespace'), 'namespace' );
491 $invert = Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $opts['invert'] );
492 return array( $nsLabel, "$nsSelect $invert" );
493 }
494
495 /**
496 * Create a input to filter changes by categories
497 *
498 * @param $opts FormOptions
499 * @return array
500 */
501 protected function categoryFilterForm( FormOptions $opts ) {
502 list( $label, $input ) = Xml::inputLabelSep( wfMsg('rc_categories'),
503 'categories', 'mw-categories', false, $opts['categories'] );
504
505 $input .= ' ' . Xml::checkLabel( wfMsg('rc_categories_any'),
506 'categories_any', 'mw-categories_any', $opts['categories_any'] );
507
508 return array( $label, $input );
509 }
510
511 /**
512 * Filter $rows by categories set in $opts
513 *
514 * @param $rows array of database rows
515 * @param $opts FormOptions
516 */
517 function filterByCategories( &$rows, FormOptions $opts ) {
518 $categories = array_map( 'trim', explode( "|" , $opts['categories'] ) );
519
520 if( empty($categories) ) {
521 return;
522 }
523
524 # Filter categories
525 $cats = array();
526 foreach ( $categories as $cat ) {
527 $cat = trim( $cat );
528 if ( $cat == "" ) continue;
529 $cats[] = $cat;
530 }
531
532 # Filter articles
533 $articles = array();
534 $a2r = array();
535 foreach ( $rows AS $k => $r ) {
536 $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
537 $id = $nt->getArticleID();
538 if ( $id == 0 ) continue; # Page might have been deleted...
539 if ( !in_array($id, $articles) ) {
540 $articles[] = $id;
541 }
542 if ( !isset($a2r[$id]) ) {
543 $a2r[$id] = array();
544 }
545 $a2r[$id][] = $k;
546 }
547
548 # Shortcut?
549 if ( !count($articles) || !count($cats) )
550 return ;
551
552 # Look up
553 $c = new Categoryfinder ;
554 $c->seed( $articles, $cats, $opts['categories_any'] ? "OR" : "AND" ) ;
555 $match = $c->run();
556
557 # Filter
558 $newrows = array();
559 foreach ( $match AS $id ) {
560 foreach ( $a2r[$id] AS $rev ) {
561 $k = $rev;
562 $newrows[$k] = $rows[$k];
563 }
564 }
565 $rows = $newrows;
566 }
567
568 /**
569 * Makes change an option link which carries all the other options
570 * @param $title see Title
571 * @param $override
572 * @param $options
573 */
574 function makeOptionsLink( $title, $override, $options, $active = false ) {
575 global $wgUser;
576 $sk = $wgUser->getSkin();
577 return $sk->makeKnownLinkObj( $this->getTitle(), htmlspecialchars( $title ),
578 wfArrayToCGI( $override, $options ), '', '', $active ? 'style="font-weight: bold;"' : '' );
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 if( $options['from'] )
592 $note = wfMsgExt( 'rcnotefrom', array( 'parseinline' ),
593 $wgLang->formatNum( $options['limit'] ),
594 $wgLang->timeanddate( $options['from'], true ) );
595 else
596 $note = wfMsgExt( 'rcnote', array( 'parseinline' ),
597 $wgLang->formatNum( $options['limit'] ),
598 $wgLang->formatNum( $options['days'] ),
599 $wgLang->timeAndDate( wfTimestampNow(), true ),
600 $wgLang->date( wfTimestampNow(), true ),
601 $wgLang->time( wfTimestampNow(), true ) );
602
603 # Sort data for display and make sure it's unique after we've added user data.
604 $wgRCLinkLimits[] = $options['limit'];
605 $wgRCLinkDays[] = $options['days'];
606 sort($wgRCLinkLimits);
607 sort($wgRCLinkDays);
608 $wgRCLinkLimits = array_unique($wgRCLinkLimits);
609 $wgRCLinkDays = array_unique($wgRCLinkDays);
610
611 // limit links
612 foreach( $wgRCLinkLimits as $value ) {
613 $cl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
614 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ) ;
615 }
616 $cl = implode( ' | ', $cl);
617
618 // day links, reset 'from' to none
619 foreach( $wgRCLinkDays as $value ) {
620 $dl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
621 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ) ;
622 }
623 $dl = implode( ' | ', $dl);
624
625
626 // show/hide links
627 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ));
628 $minorLink = $this->makeOptionsLink( $showhide[1-$options['hideminor']],
629 array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults);
630 $botLink = $this->makeOptionsLink( $showhide[1-$options['hidebots']],
631 array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults);
632 $anonsLink = $this->makeOptionsLink( $showhide[ 1 - $options['hideanons'] ],
633 array( 'hideanons' => 1 - $options['hideanons'] ), $nondefaults );
634 $liuLink = $this->makeOptionsLink( $showhide[1-$options['hideliu']],
635 array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults);
636 $patrLink = $this->makeOptionsLink( $showhide[1-$options['hidepatrolled']],
637 array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
638 $myselfLink = $this->makeOptionsLink( $showhide[1-$options['hidemyself']],
639 array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults);
640
641 $links[] = wfMsgHtml( 'rcshowhideminor', $minorLink );
642 $links[] = wfMsgHtml( 'rcshowhidebots', $botLink );
643 $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink );
644 $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink );
645 if( $wgUser->useRCPatrol() )
646 $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
647 $links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
648 $hl = implode( ' | ', $links );
649
650 // show from this onward link
651 $now = $wgLang->timeanddate( wfTimestampNow(), true );
652 $tl = $this->makeOptionsLink( $now, array( 'from' => wfTimestampNow()), $nondefaults );
653
654 $rclinks = wfMsgExt( 'rclinks', array( 'parseinline', 'replaceafter'),
655 $cl, $dl, $hl );
656 $rclistfrom = wfMsgExt( 'rclistfrom', array( 'parseinline', 'replaceafter'), $tl );
657 return "$note<br />$rclinks<br />$rclistfrom";
658 }
659 }