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