Update docs to caution against use of create_function(). Per bug 15476.
[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', 'user' );
268 $join_conds = array( 'user' => array('LEFT JOIN','rc_user != 0 AND user_id = rc_user') );
269 $fields = RecentChange::getSelectFields();
270 $fields[] = 'user_editcount';
271 $fields[] = 'user_registration';
272
273 $uid = $wgUser->getId();
274 $dbr = wfGetDB( DB_SLAVE );
275 $limit = $opts['limit'];
276 $namespace = $opts['namespace'];
277 $invert = $opts['invert'];
278
279 // JOIN on watchlist for users
280 if( $uid ) {
281 $tables[] = 'watchlist';
282 $join_conds['watchlist'] = array('LEFT JOIN',"wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace");
283 }
284
285 wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$fields ) );
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 using 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 $list = ChangesList::newFromUser( $wgUser );
339
340 if ( $wgAllowCategorizedRecentChanges ) {
341 $this->filterByCategories( $rows, $opts );
342 }
343
344 $s = $list->beginRecentChangesList();
345 $counter = 1;
346
347 $showWatcherCount = $wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' );
348 $watcherCache = array();
349
350 $dbr = wfGetDB( DB_SLAVE );
351
352 foreach( $rows as $obj ){
353 if( $limit == 0) {
354 break;
355 }
356
357 if ( ! ( $opts['hideminor'] && $obj->rc_minor ) &&
358 ! ( $opts['hidepatrolled'] && $obj->rc_patrolled ) ) {
359 $rc = RecentChange::newFromRow( $obj );
360 $rc->counter = $counter++;
361
362 if ($wgShowUpdatedMarker
363 && !empty( $obj->wl_notificationtimestamp )
364 && ($obj->rc_timestamp >= $obj->wl_notificationtimestamp)) {
365 $rc->notificationtimestamp = true;
366 } else {
367 $rc->notificationtimestamp = false;
368 }
369
370 $rc->numberofWatchingusers = 0; // Default
371 if ($showWatcherCount && $obj->rc_namespace >= 0) {
372 if (!isset($watcherCache[$obj->rc_namespace][$obj->rc_title])) {
373 $watcherCache[$obj->rc_namespace][$obj->rc_title] =
374 $dbr->selectField( 'watchlist',
375 'COUNT(*)',
376 array(
377 'wl_namespace' => $obj->rc_namespace,
378 'wl_title' => $obj->rc_title,
379 ),
380 __METHOD__ . '-watchers' );
381 }
382 $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
383 }
384 $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ) );
385 --$limit;
386 }
387 }
388 $s .= $list->endRecentChangesList();
389 $wgOut->addHTML( $s );
390 }
391
392 /**
393 * Return the text to be displayed above the changes
394 *
395 * @param $opts FormOptions
396 * @return String: XHTML
397 */
398 public function doHeader( $opts ) {
399 global $wgScript, $wgOut;
400
401 $this->setTopText( $wgOut, $opts );
402
403 $defaults = $opts->getAllValues();
404 $nondefaults = $opts->getChangedValues();
405 $opts->consumeValues( array( 'namespace', 'invert' ) );
406
407 $panel = array();
408 $panel[] = $this->optionsPanel( $defaults, $nondefaults );
409 $panel[] = '<hr />';
410
411 $extraOpts = $this->getExtraOptions( $opts );
412 $extraOptsCount = count( $extraOpts );
413 $count = 0;
414 $submit = ' ' . Xml::submitbutton( wfMsg( 'allpagessubmit' ) );
415
416 $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
417 foreach ( $extraOpts as $optionRow ) {
418 # Add submit button to the last row only
419 ++$count;
420 $addSubmit = $count === $extraOptsCount ? $submit : '';
421
422 $out .= Xml::openElement( 'tr' );
423 if ( is_array( $optionRow ) ) {
424 $out .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $optionRow[0] );
425 $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
426 } else {
427 $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit );
428 }
429 $out .= Xml::closeElement( 'tr' );
430 }
431 $out .= Xml::closeElement( 'table' );
432
433 $unconsumed = $opts->getUnconsumedValues();
434 foreach ( $unconsumed as $key => $value ) {
435 $out .= Xml::hidden( $key, $value );
436 }
437
438 $t = $this->getTitle();
439 $out .= Xml::hidden( 'title', $t->getPrefixedText() );
440 $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
441 $panel[] = $form;
442 $panelString = implode( "\n", $panel );
443
444 $wgOut->addHTML(
445 Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) )
446 );
447
448 $this->setBottomText( $wgOut, $opts );
449 }
450
451 /**
452 * Get options to be displayed in a form
453 *
454 * @param $opts FormOptions
455 * @return array
456 */
457 function getExtraOptions( $opts ){
458 $extraOpts = array();
459 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
460
461 global $wgAllowCategorizedRecentChanges;
462 if ( $wgAllowCategorizedRecentChanges ) {
463 $extraOpts['category'] = $this->categoryFilterForm( $opts );
464 }
465
466 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
467 return $extraOpts;
468 }
469
470 /**
471 * Send the text to be displayed above the options
472 *
473 * @param $out OutputPage
474 * @param $opts FormOptions
475 */
476 function setTopText( OutputPage $out, FormOptions $opts ){
477 $out->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) );
478 }
479
480 /**
481 * Send the text to be displayed after the options, for use in
482 * Recentchangeslinked
483 *
484 * @param $out OutputPage
485 * @param $opts FormOptions
486 */
487 function setBottomText( OutputPage $out, FormOptions $opts ){}
488
489 /**
490 * Creates the choose namespace selection
491 *
492 * @param $opts FormOptions
493 * @return string
494 */
495 protected function namespaceFilterForm( FormOptions $opts ) {
496 $nsSelect = HTMLnamespaceselector( $opts['namespace'], '' );
497 $nsLabel = Xml::label( wfMsg('namespace'), 'namespace' );
498 $invert = Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $opts['invert'] );
499 return array( $nsLabel, "$nsSelect $invert" );
500 }
501
502 /**
503 * Create a input to filter changes by categories
504 *
505 * @param $opts FormOptions
506 * @return array
507 */
508 protected function categoryFilterForm( FormOptions $opts ) {
509 list( $label, $input ) = Xml::inputLabelSep( wfMsg('rc_categories'),
510 'categories', 'mw-categories', false, $opts['categories'] );
511
512 $input .= ' ' . Xml::checkLabel( wfMsg('rc_categories_any'),
513 'categories_any', 'mw-categories_any', $opts['categories_any'] );
514
515 return array( $label, $input );
516 }
517
518 /**
519 * Filter $rows by categories set in $opts
520 *
521 * @param $rows array of database rows
522 * @param $opts FormOptions
523 */
524 function filterByCategories( &$rows, FormOptions $opts ) {
525 $categories = array_map( 'trim', explode( "|" , $opts['categories'] ) );
526
527 if( empty($categories) ) {
528 return;
529 }
530
531 # Filter categories
532 $cats = array();
533 foreach ( $categories as $cat ) {
534 $cat = trim( $cat );
535 if ( $cat == "" ) continue;
536 $cats[] = $cat;
537 }
538
539 # Filter articles
540 $articles = array();
541 $a2r = array();
542 foreach ( $rows AS $k => $r ) {
543 $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
544 $id = $nt->getArticleID();
545 if ( $id == 0 ) continue; # Page might have been deleted...
546 if ( !in_array($id, $articles) ) {
547 $articles[] = $id;
548 }
549 if ( !isset($a2r[$id]) ) {
550 $a2r[$id] = array();
551 }
552 $a2r[$id][] = $k;
553 }
554
555 # Shortcut?
556 if ( !count($articles) || !count($cats) )
557 return ;
558
559 # Look up
560 $c = new Categoryfinder ;
561 $c->seed( $articles, $cats, $opts['categories_any'] ? "OR" : "AND" ) ;
562 $match = $c->run();
563
564 # Filter
565 $newrows = array();
566 foreach ( $match AS $id ) {
567 foreach ( $a2r[$id] AS $rev ) {
568 $k = $rev;
569 $newrows[$k] = $rows[$k];
570 }
571 }
572 $rows = $newrows;
573 }
574
575 /**
576 * Makes change an option link which carries all the other options
577 * @param $title see Title
578 * @param $override
579 * @param $options
580 */
581 function makeOptionsLink( $title, $override, $options, $active = false ) {
582 global $wgUser;
583 $sk = $wgUser->getSkin();
584 $params = wfArrayMerge( $options, $override );
585 return $sk->link( $this->getTitle(), htmlspecialchars( $title ),
586 ( $active ? array( 'style'=>'font-weight: bold;' ) : array() ), $params, array( 'known' ) );
587 }
588
589 /**
590 * Creates the options panel.
591 * @param $defaults array
592 * @param $nondefaults array
593 */
594 function optionsPanel( $defaults, $nondefaults ) {
595 global $wgLang, $wgUser, $wgRCLinkLimits, $wgRCLinkDays;
596
597 $options = $nondefaults + $defaults;
598
599 if( $options['from'] )
600 $note = wfMsgExt( 'rcnotefrom', array( 'parseinline' ),
601 $wgLang->formatNum( $options['limit'] ),
602 $wgLang->timeanddate( $options['from'], true ) );
603 else
604 $note = wfMsgExt( 'rcnote', array( 'parseinline' ),
605 $wgLang->formatNum( $options['limit'] ),
606 $wgLang->formatNum( $options['days'] ),
607 $wgLang->timeAndDate( wfTimestampNow(), true ),
608 $wgLang->date( wfTimestampNow(), true ),
609 $wgLang->time( wfTimestampNow(), true ) );
610
611 # Sort data for display and make sure it's unique after we've added user data.
612 $wgRCLinkLimits[] = $options['limit'];
613 $wgRCLinkDays[] = $options['days'];
614 sort( $wgRCLinkLimits );
615 sort( $wgRCLinkDays );
616 $wgRCLinkLimits = array_unique( $wgRCLinkLimits );
617 $wgRCLinkDays = array_unique( $wgRCLinkDays );
618
619 // limit links
620 foreach( $wgRCLinkLimits as $value ) {
621 $cl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
622 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ) ;
623 }
624 $cl = implode( ' | ', $cl );
625
626 // day links, reset 'from' to none
627 foreach( $wgRCLinkDays as $value ) {
628 $dl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
629 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ) ;
630 }
631 $dl = implode( ' | ', $dl );
632
633
634 // show/hide links
635 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
636 $minorLink = $this->makeOptionsLink( $showhide[1-$options['hideminor']],
637 array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults);
638 $botLink = $this->makeOptionsLink( $showhide[1-$options['hidebots']],
639 array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults);
640 $anonsLink = $this->makeOptionsLink( $showhide[ 1 - $options['hideanons'] ],
641 array( 'hideanons' => 1 - $options['hideanons'] ), $nondefaults );
642 $liuLink = $this->makeOptionsLink( $showhide[1-$options['hideliu']],
643 array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults);
644 $patrLink = $this->makeOptionsLink( $showhide[1-$options['hidepatrolled']],
645 array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
646 $myselfLink = $this->makeOptionsLink( $showhide[1-$options['hidemyself']],
647 array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults);
648
649 $links[] = wfMsgHtml( 'rcshowhideminor', $minorLink );
650 $links[] = wfMsgHtml( 'rcshowhidebots', $botLink );
651 $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink );
652 $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink );
653 if( $wgUser->useRCPatrol() )
654 $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
655 $links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
656 $hl = implode( ' | ', $links );
657
658 // show from this onward link
659 $now = $wgLang->timeanddate( wfTimestampNow(), true );
660 $tl = $this->makeOptionsLink( $now, array( 'from' => wfTimestampNow() ), $nondefaults );
661
662 $rclinks = wfMsgExt( 'rclinks', array( 'parseinline', 'replaceafter' ),
663 $cl, $dl, $hl );
664 $rclistfrom = wfMsgExt( 'rclistfrom', array( 'parseinline', 'replaceafter' ), $tl );
665 return "$note<br />$rclinks<br />$rclistfrom";
666 }
667 }