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