Revert r40627, r40551, r40536, r40535 (mark non-autoconfirmed users in RC and watchli...
[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 ) );
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 $extraOptsCount = count( $extraOpts );
410 $count = 0;
411 $submit = ' ' . Xml::submitbutton( wfMsg( 'allpagessubmit' ) );
412
413 $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
414 foreach ( $extraOpts as $optionRow ) {
415 # Add submit button to the last row only
416 ++$count;
417 $addSubmit = $count === $extraOptsCount ? $submit : '';
418
419 $out .= Xml::openElement( 'tr' );
420 if ( is_array( $optionRow ) ) {
421 $out .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $optionRow[0] );
422 $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
423 } else {
424 $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit );
425 }
426 $out .= Xml::closeElement( 'tr' );
427 }
428 $out .= Xml::closeElement( 'table' );
429
430 $unconsumed = $opts->getUnconsumedValues();
431 foreach ( $unconsumed as $key => $value ) {
432 $out .= Xml::hidden( $key, $value );
433 }
434
435 $t = $this->getTitle();
436 $out .= Xml::hidden( 'title', $t->getPrefixedText() );
437 $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
438 $panel[] = $form;
439 $panelString = implode( "\n", $panel );
440
441 $wgOut->addHTML(
442 Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) )
443 );
444
445 $this->setBottomText( $wgOut, $opts );
446 }
447
448 /**
449 * Get options to be displayed in a form
450 *
451 * @param $opts FormOptions
452 * @return array
453 */
454 function getExtraOptions( $opts ){
455 $extraOpts = array();
456 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
457
458 global $wgAllowCategorizedRecentChanges;
459 if ( $wgAllowCategorizedRecentChanges ) {
460 $extraOpts['category'] = $this->categoryFilterForm( $opts );
461 }
462
463 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
464 return $extraOpts;
465 }
466
467 /**
468 * Send the text to be displayed above the options
469 *
470 * @param $out OutputPage
471 * @param $opts FormOptions
472 */
473 function setTopText( OutputPage $out, FormOptions $opts ){
474 $out->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) );
475 }
476
477 /**
478 * Send the text to be displayed after the options, for use in
479 * Recentchangeslinked
480 *
481 * @param $out OutputPage
482 * @param $opts FormOptions
483 */
484 function setBottomText( OutputPage $out, FormOptions $opts ){}
485
486 /**
487 * Creates the choose namespace selection
488 *
489 * @param $opts FormOptions
490 * @return string
491 */
492 protected function namespaceFilterForm( FormOptions $opts ) {
493 $nsSelect = HTMLnamespaceselector( $opts['namespace'], '' );
494 $nsLabel = Xml::label( wfMsg('namespace'), 'namespace' );
495 $invert = Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $opts['invert'] );
496 return array( $nsLabel, "$nsSelect $invert" );
497 }
498
499 /**
500 * Create a input to filter changes by categories
501 *
502 * @param $opts FormOptions
503 * @return array
504 */
505 protected function categoryFilterForm( FormOptions $opts ) {
506 list( $label, $input ) = Xml::inputLabelSep( wfMsg('rc_categories'),
507 'categories', 'mw-categories', false, $opts['categories'] );
508
509 $input .= ' ' . Xml::checkLabel( wfMsg('rc_categories_any'),
510 'categories_any', 'mw-categories_any', $opts['categories_any'] );
511
512 return array( $label, $input );
513 }
514
515 /**
516 * Filter $rows by categories set in $opts
517 *
518 * @param $rows array of database rows
519 * @param $opts FormOptions
520 */
521 function filterByCategories( &$rows, FormOptions $opts ) {
522 $categories = array_map( 'trim', explode( "|" , $opts['categories'] ) );
523
524 if( empty($categories) ) {
525 return;
526 }
527
528 # Filter categories
529 $cats = array();
530 foreach ( $categories as $cat ) {
531 $cat = trim( $cat );
532 if ( $cat == "" ) continue;
533 $cats[] = $cat;
534 }
535
536 # Filter articles
537 $articles = array();
538 $a2r = array();
539 foreach ( $rows AS $k => $r ) {
540 $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
541 $id = $nt->getArticleID();
542 if ( $id == 0 ) continue; # Page might have been deleted...
543 if ( !in_array($id, $articles) ) {
544 $articles[] = $id;
545 }
546 if ( !isset($a2r[$id]) ) {
547 $a2r[$id] = array();
548 }
549 $a2r[$id][] = $k;
550 }
551
552 # Shortcut?
553 if ( !count($articles) || !count($cats) )
554 return ;
555
556 # Look up
557 $c = new Categoryfinder ;
558 $c->seed( $articles, $cats, $opts['categories_any'] ? "OR" : "AND" ) ;
559 $match = $c->run();
560
561 # Filter
562 $newrows = array();
563 foreach ( $match AS $id ) {
564 foreach ( $a2r[$id] AS $rev ) {
565 $k = $rev;
566 $newrows[$k] = $rows[$k];
567 }
568 }
569 $rows = $newrows;
570 }
571
572 /**
573 * Makes change an option link which carries all the other options
574 * @param $title see Title
575 * @param $override
576 * @param $options
577 */
578 function makeOptionsLink( $title, $override, $options, $active = false ) {
579 global $wgUser;
580 $sk = $wgUser->getSkin();
581 $params = wfArrayMerge( $options, $override );
582 return $sk->link( $this->getTitle(), htmlspecialchars( $title ),
583 ( $active ? array( 'style'=>'font-weight: bold;' ) : array() ), $params, array( 'known' ) );
584 }
585
586 /**
587 * Creates the options panel.
588 * @param $defaults array
589 * @param $nondefaults array
590 */
591 function optionsPanel( $defaults, $nondefaults ) {
592 global $wgLang, $wgUser, $wgRCLinkLimits, $wgRCLinkDays;
593
594 $options = $nondefaults + $defaults;
595
596 if( $options['from'] )
597 $note = wfMsgExt( 'rcnotefrom', array( 'parseinline' ),
598 $wgLang->formatNum( $options['limit'] ),
599 $wgLang->timeanddate( $options['from'], true ) );
600 else
601 $note = wfMsgExt( 'rcnote', array( 'parseinline' ),
602 $wgLang->formatNum( $options['limit'] ),
603 $wgLang->formatNum( $options['days'] ),
604 $wgLang->timeAndDate( wfTimestampNow(), true ),
605 $wgLang->date( wfTimestampNow(), true ),
606 $wgLang->time( wfTimestampNow(), true ) );
607
608 # Sort data for display and make sure it's unique after we've added user data.
609 $wgRCLinkLimits[] = $options['limit'];
610 $wgRCLinkDays[] = $options['days'];
611 sort( $wgRCLinkLimits );
612 sort( $wgRCLinkDays );
613 $wgRCLinkLimits = array_unique( $wgRCLinkLimits );
614 $wgRCLinkDays = array_unique( $wgRCLinkDays );
615
616 // limit links
617 foreach( $wgRCLinkLimits as $value ) {
618 $cl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
619 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ) ;
620 }
621 $cl = implode( ' | ', $cl );
622
623 // day links, reset 'from' to none
624 foreach( $wgRCLinkDays as $value ) {
625 $dl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
626 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ) ;
627 }
628 $dl = implode( ' | ', $dl );
629
630
631 // show/hide links
632 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
633 $minorLink = $this->makeOptionsLink( $showhide[1-$options['hideminor']],
634 array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults);
635 $botLink = $this->makeOptionsLink( $showhide[1-$options['hidebots']],
636 array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults);
637 $anonsLink = $this->makeOptionsLink( $showhide[ 1 - $options['hideanons'] ],
638 array( 'hideanons' => 1 - $options['hideanons'] ), $nondefaults );
639 $liuLink = $this->makeOptionsLink( $showhide[1-$options['hideliu']],
640 array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults);
641 $patrLink = $this->makeOptionsLink( $showhide[1-$options['hidepatrolled']],
642 array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
643 $myselfLink = $this->makeOptionsLink( $showhide[1-$options['hidemyself']],
644 array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults);
645
646 $links[] = wfMsgHtml( 'rcshowhideminor', $minorLink );
647 $links[] = wfMsgHtml( 'rcshowhidebots', $botLink );
648 $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink );
649 $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink );
650 if( $wgUser->useRCPatrol() )
651 $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
652 $links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
653 $hl = implode( ' | ', $links );
654
655 // show from this onward link
656 $now = $wgLang->timeanddate( wfTimestampNow(), true );
657 $tl = $this->makeOptionsLink( $now, array( 'from' => wfTimestampNow() ), $nondefaults );
658
659 $rclinks = wfMsgExt( 'rclinks', array( 'parseinline', 'replaceafter' ),
660 $cl, $dl, $hl );
661 $rclistfrom = wfMsgExt( 'rclistfrom', array( 'parseinline', 'replaceafter' ), $tl );
662 return "$note<br />$rclinks<br />$rclistfrom";
663 }
664 }