(bug 17055) Use a CSS class ('mw-revdelundel-link') for RevisionDelete "(show/hide...
[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', $wgUser->getBoolOption( 'hideminor' ) );
27 $opts->add( 'hidebots', true );
28 $opts->add( 'hideanons', false );
29 $opts->add( 'hideliu', false );
30 $opts->add( 'hidepatrolled', $wgUser->getBoolOption( 'hidepatrolled' ) );
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 # Feed is cached on limit,hideminor; other params would randomly not work
70 $opts->fetchValuesFromRequest( $wgRequest, array( 'limit', 'hideminor' ) );
71 $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
72 return $opts;
73 }
74
75 /**
76 * Main execution point
77 *
78 * @param $parameters string
79 */
80 public function execute( $parameters ) {
81 global $wgRequest, $wgOut;
82 $feedFormat = $wgRequest->getVal( 'feed' );
83
84 # 10 seconds server-side caching max
85 $wgOut->setSquidMaxage( 10 );
86 # Check if the client has a cached version
87 $lastmod = $this->checkLastModified( $feedFormat );
88 if( $lastmod === false ) {
89 return;
90 }
91
92 $opts = $feedFormat ? $this->feedSetup() : $this->setup( $parameters );
93 $this->setHeaders();
94 $this->outputHeader();
95
96 // Fetch results, prepare a batch link existence check query
97 $rows = array();
98 $conds = $this->buildMainQueryConds( $opts );
99 $rows = $this->doMainQuery( $conds, $opts );
100 if( $rows === false ){
101 if( !$this->including() ) {
102 $this->doHeader( $opts );
103 }
104 return;
105 }
106
107 if( !$feedFormat ) {
108 $batch = new LinkBatch;
109 foreach( $rows as $row ) {
110 $batch->add( NS_USER, $row->rc_user_text );
111 $batch->add( NS_USER_TALK, $row->rc_user_text );
112 }
113 $batch->execute();
114 }
115 $target = isset($opts['target']) ? $opts['target'] : ''; // RCL has targets
116 if( $feedFormat ) {
117 list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat );
118 $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod, $target );
119 } else {
120 $this->webOutput( $rows, $opts );
121 }
122
123 $rows->free();
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 string 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',
282 "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace") );
283 }
284
285 wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) );
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 used 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 if( $wgAllowCategorizedRecentChanges ) {
339 $this->filterByCategories( $rows, $opts );
340 }
341
342 $showWatcherCount = $wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' );
343 $watcherCache = array();
344
345 $dbr = wfGetDB( DB_SLAVE );
346
347 $counter = 1;
348 $list = ChangesList::newFromUser( $wgUser );
349
350 $s = $list->beginRecentChangesList();
351 foreach( $rows as $obj ) {
352 if( $limit == 0 ) break;
353 $rc = RecentChange::newFromRow( $obj );
354 $rc->counter = $counter++;
355 # Check if the page has been updated since the last visit
356 if( $wgShowUpdatedMarker && !empty($obj->wl_notificationtimestamp) ) {
357 $rc->notificationtimestamp = ($obj->rc_timestamp >= $obj->wl_notificationtimestamp);
358 } else {
359 $rc->notificationtimestamp = false; // Default
360 }
361 # Check the number of users watching the page
362 $rc->numberofWatchingusers = 0; // Default
363 if( $showWatcherCount && $obj->rc_namespace >= 0 ) {
364 if( !isset($watcherCache[$obj->rc_namespace][$obj->rc_title]) ) {
365 $watcherCache[$obj->rc_namespace][$obj->rc_title] =
366 $dbr->selectField( 'watchlist',
367 'COUNT(*)',
368 array(
369 'wl_namespace' => $obj->rc_namespace,
370 'wl_title' => $obj->rc_title,
371 ),
372 __METHOD__ . '-watchers' );
373 }
374 $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
375 }
376 $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ) );
377 --$limit;
378 }
379 $s .= $list->endRecentChangesList();
380 $wgOut->addHTML( $s );
381 }
382
383 /**
384 * Return the text to be displayed above the changes
385 *
386 * @param $opts FormOptions
387 * @return String: XHTML
388 */
389 public function doHeader( $opts ) {
390 global $wgScript, $wgOut;
391
392 $this->setTopText( $wgOut, $opts );
393
394 $defaults = $opts->getAllValues();
395 $nondefaults = $opts->getChangedValues();
396 $opts->consumeValues( array( 'namespace', 'invert' ) );
397
398 $panel = array();
399 $panel[] = $this->optionsPanel( $defaults, $nondefaults );
400 $panel[] = '<hr />';
401
402 $extraOpts = $this->getExtraOptions( $opts );
403 $extraOptsCount = count( $extraOpts );
404 $count = 0;
405 $submit = ' ' . Xml::submitbutton( wfMsg( 'allpagessubmit' ) );
406
407 $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
408 foreach( $extraOpts as $optionRow ) {
409 # Add submit button to the last row only
410 ++$count;
411 $addSubmit = $count === $extraOptsCount ? $submit : '';
412
413 $out .= Xml::openElement( 'tr' );
414 if( is_array( $optionRow ) ) {
415 $out .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $optionRow[0] );
416 $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
417 } else {
418 $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit );
419 }
420 $out .= Xml::closeElement( 'tr' );
421 }
422 $out .= Xml::closeElement( 'table' );
423
424 $unconsumed = $opts->getUnconsumedValues();
425 foreach( $unconsumed as $key => $value ) {
426 $out .= Xml::hidden( $key, $value );
427 }
428
429 $t = $this->getTitle();
430 $out .= Xml::hidden( 'title', $t->getPrefixedText() );
431 $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
432 $panel[] = $form;
433 $panelString = implode( "\n", $panel );
434
435 $wgOut->addHTML(
436 Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) )
437 );
438
439 $this->setBottomText( $wgOut, $opts );
440 }
441
442 /**
443 * Get options to be displayed in a form
444 *
445 * @param $opts FormOptions
446 * @return array
447 */
448 function getExtraOptions( $opts ){
449 $extraOpts = array();
450 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
451
452 global $wgAllowCategorizedRecentChanges;
453 if( $wgAllowCategorizedRecentChanges ) {
454 $extraOpts['category'] = $this->categoryFilterForm( $opts );
455 }
456
457 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
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 = Xml::namespaceSelector( $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 = $override + $options;
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 $note = '';
591 if( $options['from'] ) {
592 $note .= wfMsgExt( 'rcnotefrom', array( 'parseinline' ),
593 $wgLang->formatNum( $options['limit'] ),
594 $wgLang->timeanddate( $options['from'], true ) ) . '<br />';
595 }
596 if( !wfEmptyMsg( 'rclegend', wfMsg('rclegend') ) ) {
597 $note .= wfMsgExt( 'rclegend', array('parseinline') ) . '<br />';
598 }
599
600 # Sort data for display and make sure it's unique after we've added user data.
601 $wgRCLinkLimits[] = $options['limit'];
602 $wgRCLinkDays[] = $options['days'];
603 sort( $wgRCLinkLimits );
604 sort( $wgRCLinkDays );
605 $wgRCLinkLimits = array_unique( $wgRCLinkLimits );
606 $wgRCLinkDays = array_unique( $wgRCLinkDays );
607
608 // limit links
609 foreach( $wgRCLinkLimits as $value ) {
610 $cl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
611 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] ) ;
612 }
613 $cl = implode( ' | ', $cl );
614
615 // day links, reset 'from' to none
616 foreach( $wgRCLinkDays as $value ) {
617 $dl[] = $this->makeOptionsLink( $wgLang->formatNum( $value ),
618 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] ) ;
619 }
620 $dl = implode( ' | ', $dl );
621
622
623 // show/hide links
624 $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
625 $minorLink = $this->makeOptionsLink( $showhide[1-$options['hideminor']],
626 array( 'hideminor' => 1-$options['hideminor'] ), $nondefaults);
627 $botLink = $this->makeOptionsLink( $showhide[1-$options['hidebots']],
628 array( 'hidebots' => 1-$options['hidebots'] ), $nondefaults);
629 $anonsLink = $this->makeOptionsLink( $showhide[ 1 - $options['hideanons'] ],
630 array( 'hideanons' => 1 - $options['hideanons'] ), $nondefaults );
631 $liuLink = $this->makeOptionsLink( $showhide[1-$options['hideliu']],
632 array( 'hideliu' => 1-$options['hideliu'] ), $nondefaults);
633 $patrLink = $this->makeOptionsLink( $showhide[1-$options['hidepatrolled']],
634 array( 'hidepatrolled' => 1-$options['hidepatrolled'] ), $nondefaults);
635 $myselfLink = $this->makeOptionsLink( $showhide[1-$options['hidemyself']],
636 array( 'hidemyself' => 1-$options['hidemyself'] ), $nondefaults);
637
638 $links[] = wfMsgHtml( 'rcshowhideminor', $minorLink );
639 $links[] = wfMsgHtml( 'rcshowhidebots', $botLink );
640 $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink );
641 $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink );
642 if( $wgUser->useRCPatrol() )
643 $links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
644 $links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
645 $hl = implode( ' | ', $links );
646
647 // show from this onward link
648 $now = $wgLang->timeanddate( wfTimestampNow(), true );
649 $tl = $this->makeOptionsLink( $now, array( 'from' => wfTimestampNow() ), $nondefaults );
650
651 $rclinks = wfMsgExt( 'rclinks', array( 'parseinline', 'replaceafter' ),
652 $cl, $dl, $hl );
653 $rclistfrom = wfMsgExt( 'rclistfrom', array( 'parseinline', 'replaceafter' ), $tl );
654 return "{$note}$rclinks<br />$rclistfrom";
655 }
656 }