* Rewrote wfArrayMerge() in terms of array plus
[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 if( !$this->including() ) {
102 $this->doHeader( $opts );
103 }
104 return;
105 }
106
107 foreach( $rows as $row ) {
108 if ( !$feedFormat ) {
109 // User page and talk links
110 $batch->add( NS_USER, $row->rc_user_text );
111 $batch->add( NS_USER_TALK, $row->rc_user_text );
112 }
113 }
114
115 if ( $feedFormat ) {
116 list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat );
117 $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod );
118 } else {
119 $batch->execute();
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 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 $extraOptsCount = count( $extraOpts );
412 $count = 0;
413 $submit = ' ' . Xml::submitbutton( wfMsg( 'allpagessubmit' ) );
414
415 $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
416 foreach ( $extraOpts as $optionRow ) {
417 # Add submit button to the last row only
418 ++$count;
419 $addSubmit = $count === $extraOptsCount ? $submit : '';
420
421 $out .= Xml::openElement( 'tr' );
422 if ( is_array( $optionRow ) ) {
423 $out .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $optionRow[0] );
424 $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
425 } else {
426 $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit );
427 }
428 $out .= Xml::closeElement( 'tr' );
429 }
430 $out .= Xml::closeElement( 'table' );
431
432 $unconsumed = $opts->getUnconsumedValues();
433 foreach ( $unconsumed as $key => $value ) {
434 $out .= Xml::hidden( $key, $value );
435 }
436
437 $t = $this->getTitle();
438 $out .= Xml::hidden( 'title', $t->getPrefixedText() );
439 $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
440 $panel[] = $form;
441 $panelString = implode( "\n", $panel );
442
443 $wgOut->addHTML(
444 Xml::fieldset( wfMsg( 'recentchanges-legend' ), $panelString, array( 'class' => 'rcoptions' ) )
445 );
446
447 $this->setBottomText( $wgOut, $opts );
448 }
449
450 /**
451 * Get options to be displayed in a form
452 *
453 * @param $opts FormOptions
454 * @return array
455 */
456 function getExtraOptions( $opts ){
457 $extraOpts = array();
458 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
459
460 global $wgAllowCategorizedRecentChanges;
461 if ( $wgAllowCategorizedRecentChanges ) {
462 $extraOpts['category'] = $this->categoryFilterForm( $opts );
463 }
464
465 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
466 return $extraOpts;
467 }
468
469 /**
470 * Send the text to be displayed above the options
471 *
472 * @param $out OutputPage
473 * @param $opts FormOptions
474 */
475 function setTopText( OutputPage $out, FormOptions $opts ){
476 $out->addWikiText( wfMsgForContentNoTrans( 'recentchangestext' ) );
477 }
478
479 /**
480 * Send the text to be displayed after the options, for use in
481 * Recentchangeslinked
482 *
483 * @param $out OutputPage
484 * @param $opts FormOptions
485 */
486 function setBottomText( OutputPage $out, FormOptions $opts ){}
487
488 /**
489 * Creates the choose namespace selection
490 *
491 * @param $opts FormOptions
492 * @return string
493 */
494 protected function namespaceFilterForm( FormOptions $opts ) {
495 $nsSelect = HTMLnamespaceselector( $opts['namespace'], '' );
496 $nsLabel = Xml::label( wfMsg('namespace'), 'namespace' );
497 $invert = Xml::checkLabel( wfMsg('invert'), 'invert', 'nsinvert', $opts['invert'] );
498 return array( $nsLabel, "$nsSelect $invert" );
499 }
500
501 /**
502 * Create a input to filter changes by categories
503 *
504 * @param $opts FormOptions
505 * @return array
506 */
507 protected function categoryFilterForm( FormOptions $opts ) {
508 list( $label, $input ) = Xml::inputLabelSep( wfMsg('rc_categories'),
509 'categories', 'mw-categories', false, $opts['categories'] );
510
511 $input .= ' ' . Xml::checkLabel( wfMsg('rc_categories_any'),
512 'categories_any', 'mw-categories_any', $opts['categories_any'] );
513
514 return array( $label, $input );
515 }
516
517 /**
518 * Filter $rows by categories set in $opts
519 *
520 * @param $rows array of database rows
521 * @param $opts FormOptions
522 */
523 function filterByCategories( &$rows, FormOptions $opts ) {
524 $categories = array_map( 'trim', explode( "|" , $opts['categories'] ) );
525
526 if( empty($categories) ) {
527 return;
528 }
529
530 # Filter categories
531 $cats = array();
532 foreach ( $categories as $cat ) {
533 $cat = trim( $cat );
534 if ( $cat == "" ) continue;
535 $cats[] = $cat;
536 }
537
538 # Filter articles
539 $articles = array();
540 $a2r = array();
541 foreach ( $rows AS $k => $r ) {
542 $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
543 $id = $nt->getArticleID();
544 if ( $id == 0 ) continue; # Page might have been deleted...
545 if ( !in_array($id, $articles) ) {
546 $articles[] = $id;
547 }
548 if ( !isset($a2r[$id]) ) {
549 $a2r[$id] = array();
550 }
551 $a2r[$id][] = $k;
552 }
553
554 # Shortcut?
555 if ( !count($articles) || !count($cats) )
556 return ;
557
558 # Look up
559 $c = new Categoryfinder ;
560 $c->seed( $articles, $cats, $opts['categories_any'] ? "OR" : "AND" ) ;
561 $match = $c->run();
562
563 # Filter
564 $newrows = array();
565 foreach ( $match AS $id ) {
566 foreach ( $a2r[$id] AS $rev ) {
567 $k = $rev;
568 $newrows[$k] = $rows[$k];
569 }
570 }
571 $rows = $newrows;
572 }
573
574 /**
575 * Makes change an option link which carries all the other options
576 * @param $title see Title
577 * @param $override
578 * @param $options
579 */
580 function makeOptionsLink( $title, $override, $options, $active = false ) {
581 global $wgUser;
582 $sk = $wgUser->getSkin();
583 $params = $override + $options;
584 return $sk->link( $this->getTitle(), htmlspecialchars( $title ),
585 ( $active ? array( 'style'=>'font-weight: bold;' ) : array() ), $params, array( 'known' ) );
586 }
587
588 /**
589 * Creates the options panel.
590 * @param $defaults array
591 * @param $nondefaults array
592 */
593 function optionsPanel( $defaults, $nondefaults ) {
594 global $wgLang, $wgUser, $wgRCLinkLimits, $wgRCLinkDays;
595
596 $options = $nondefaults + $defaults;
597
598 $note = '';
599 if( $options['from'] ) {
600 $note .= wfMsgExt( 'rcnotefrom', array( 'parseinline' ),
601 $wgLang->formatNum( $options['limit'] ),
602 $wgLang->timeanddate( $options['from'], true ) ) . '<br />';
603 }
604 if( !wfEmptyMsg( 'rclegend', wfMsg('rclegend') ) ) {
605 $note .= wfMsgExt( 'rclegend', array('parseinline') ) . '<br />';
606 }
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}$rclinks<br />$rclistfrom";
663 }
664 }