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