Merge "Fix some omitted colons in Spanish magic word l10n"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
1 <?php
2 /**
3 * Implements Special:Recentchanges
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup SpecialPage
22 */
23
24 /**
25 * A special page that lists last changes made to the wiki
26 *
27 * @ingroup SpecialPage
28 */
29 class SpecialRecentChanges extends ChangesListSpecialPage {
30
31 public function __construct( $name = 'Recentchanges', $restriction = '' ) {
32 parent::__construct( $name, $restriction );
33 }
34
35 /**
36 * Main execution point
37 *
38 * @param string $subpage
39 */
40 public function execute( $subpage ) {
41 // Backwards-compatibility: redirect to new feed URLs
42 $feedFormat = $this->getRequest()->getVal( 'feed' );
43 if ( !$this->including() && $feedFormat ) {
44 $query = $this->getFeedQuery();
45 $query['feedformat'] = $feedFormat === 'atom' ? 'atom' : 'rss';
46 $this->getOutput()->redirect( wfAppendQuery( wfScript( 'api' ), $query ) );
47 return;
48 }
49
50 // 10 seconds server-side caching max
51 $this->getOutput()->setSquidMaxage( 10 );
52 // Check if the client has a cached version
53 $lastmod = $this->checkLastModified();
54 if ( $lastmod === false ) {
55 return;
56 }
57
58 parent::execute( $subpage );
59 }
60
61 /**
62 * Get a FormOptions object containing the default options
63 *
64 * @return FormOptions
65 */
66 public function getDefaultOptions() {
67 $opts = parent::getDefaultOptions();
68 $user = $this->getUser();
69
70 $opts->add( 'days', $user->getIntOption( 'rcdays' ) );
71 $opts->add( 'limit', $user->getIntOption( 'rclimit' ) );
72 $opts->add( 'from', '' );
73
74 $opts->add( 'hideminor', $user->getBoolOption( 'hideminor' ) );
75 $opts->add( 'hidebots', true );
76 $opts->add( 'hideanons', false );
77 $opts->add( 'hideliu', false );
78 $opts->add( 'hidepatrolled', $user->getBoolOption( 'hidepatrolled' ) );
79 $opts->add( 'hidemyself', false );
80
81 $opts->add( 'categories', '' );
82 $opts->add( 'categories_any', false );
83 $opts->add( 'tagfilter', '' );
84
85 return $opts;
86 }
87
88 /**
89 * Get custom show/hide filters
90 *
91 * @return array Map of filter URL param names to properties (msg/default)
92 */
93 protected function getCustomFilters() {
94 if ( $this->customFilters === null ) {
95 $this->customFilters = array();
96 wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ) );
97 }
98
99 return $this->customFilters;
100 }
101
102 /**
103 * Process $par and put options found in $opts. Used when including the page.
104 *
105 * @param string $par
106 * @param FormOptions $opts
107 */
108 public function parseParameters( $par, FormOptions $opts ) {
109 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
110 foreach ( $bits as $bit ) {
111 if ( 'hidebots' === $bit ) {
112 $opts['hidebots'] = true;
113 }
114 if ( 'bots' === $bit ) {
115 $opts['hidebots'] = false;
116 }
117 if ( 'hideminor' === $bit ) {
118 $opts['hideminor'] = true;
119 }
120 if ( 'minor' === $bit ) {
121 $opts['hideminor'] = false;
122 }
123 if ( 'hideliu' === $bit ) {
124 $opts['hideliu'] = true;
125 }
126 if ( 'hidepatrolled' === $bit ) {
127 $opts['hidepatrolled'] = true;
128 }
129 if ( 'hideanons' === $bit ) {
130 $opts['hideanons'] = true;
131 }
132 if ( 'hidemyself' === $bit ) {
133 $opts['hidemyself'] = true;
134 }
135
136 if ( is_numeric( $bit ) ) {
137 $opts['limit'] = $bit;
138 }
139
140 $m = array();
141 if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
142 $opts['limit'] = $m[1];
143 }
144 if ( preg_match( '/^days=(\d+)$/', $bit, $m ) ) {
145 $opts['days'] = $m[1];
146 }
147 if ( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) {
148 $opts['namespace'] = $m[1];
149 }
150 }
151 }
152
153 public function validateOptions( FormOptions $opts ) {
154 $opts->validateIntBounds( 'limit', 0, 5000 );
155 parent::validateOptions( $opts );
156 }
157
158 /**
159 * Return an array of conditions depending of options set in $opts
160 *
161 * @param FormOptions $opts
162 * @return array
163 */
164 public function buildMainQueryConds( FormOptions $opts ) {
165 $dbr = $this->getDB();
166 $conds = parent::buildMainQueryConds( $opts );
167
168 // Calculate cutoff
169 $cutoff_unixtime = time() - ( $opts['days'] * 86400 );
170 $cutoff_unixtime = $cutoff_unixtime - ( $cutoff_unixtime % 86400 );
171 $cutoff = $dbr->timestamp( $cutoff_unixtime );
172
173 $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] );
174 if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) {
175 $cutoff = $dbr->timestamp( $opts['from'] );
176 } else {
177 $opts->reset( 'from' );
178 }
179
180 $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff );
181
182 return $conds;
183 }
184
185 /**
186 * Process the query
187 *
188 * @param array $conds
189 * @param FormOptions $opts
190 * @return bool|ResultWrapper Result or false (for Recentchangeslinked only)
191 */
192 public function doMainQuery( $conds, $opts ) {
193 global $wgAllowCategorizedRecentChanges;
194
195 $dbr = $this->getDB();
196 $user = $this->getUser();
197
198 $tables = array( 'recentchanges' );
199 $fields = RecentChange::selectFields();
200 $query_options = array();
201 $join_conds = array();
202
203 // JOIN on watchlist for users
204 if ( $user->getId() && $user->isAllowed( 'viewmywatchlist' ) ) {
205 $tables[] = 'watchlist';
206 $fields[] = 'wl_user';
207 $fields[] = 'wl_notificationtimestamp';
208 $join_conds['watchlist'] = array( 'LEFT JOIN', array(
209 'wl_user' => $user->getId(),
210 'wl_title=rc_title',
211 'wl_namespace=rc_namespace'
212 ) );
213 }
214
215 if ( $user->isAllowed( 'rollback' ) ) {
216 $tables[] = 'page';
217 $fields[] = 'page_latest';
218 $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' );
219 }
220
221 ChangeTags::modifyDisplayQuery(
222 $tables,
223 $fields,
224 $conds,
225 $join_conds,
226 $query_options,
227 $opts['tagfilter']
228 );
229
230 if ( !wfRunHooks( 'SpecialRecentChangesQuery',
231 array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) )
232 ) {
233 return false;
234 }
235
236 // rc_new is not an ENUM, but adding a redundant rc_new IN (0,1) gives mysql enough
237 // knowledge to use an index merge if it wants (it may use some other index though).
238 $rows = $dbr->select(
239 $tables,
240 $fields,
241 $conds + array( 'rc_new' => array( 0, 1 ) ),
242 __METHOD__,
243 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $opts['limit'] ) + $query_options,
244 $join_conds
245 );
246
247 // Build the final data
248 if ( $wgAllowCategorizedRecentChanges ) {
249 $this->filterByCategories( $rows, $opts );
250 }
251
252 return $rows;
253 }
254
255 public function outputFeedLinks() {
256 $this->addFeedLinks( $this->getFeedQuery() );
257 }
258
259 /**
260 * Get URL query parameters for action=feedrecentchanges API feed of current recent changes view.
261 *
262 * @return array
263 */
264 private function getFeedQuery() {
265 global $wgFeedLimit;
266 $query = array_filter( $this->getOptions()->getAllValues(), function ( $value ) {
267 // API handles empty parameters in a different way
268 return $value !== '';
269 } );
270 $query['action'] = 'feedrecentchanges';
271 if ( $query['limit'] > $wgFeedLimit ) {
272 $query['limit'] = $wgFeedLimit;
273 }
274 return $query;
275 }
276
277 /**
278 * Build and output the actual changes list.
279 *
280 * @param array $rows Database rows
281 * @param FormOptions $opts
282 */
283 public function outputChangesList( $rows, $opts ) {
284 global $wgRCShowWatchingUsers, $wgShowUpdatedMarker;
285
286 $limit = $opts['limit'];
287
288 $showWatcherCount = $wgRCShowWatchingUsers && $this->getUser()->getOption( 'shownumberswatching' );
289 $watcherCache = array();
290
291 $dbr = $this->getDB();
292
293 $counter = 1;
294 $list = ChangesList::newFromContext( $this->getContext() );
295
296 $rclistOutput = $list->beginRecentChangesList();
297 foreach ( $rows as $obj ) {
298 if ( $limit == 0 ) {
299 break;
300 }
301 $rc = RecentChange::newFromRow( $obj );
302 $rc->counter = $counter++;
303 # Check if the page has been updated since the last visit
304 if ( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp ) ) {
305 $rc->notificationtimestamp = ( $obj->rc_timestamp >= $obj->wl_notificationtimestamp );
306 } else {
307 $rc->notificationtimestamp = false; // Default
308 }
309 # Check the number of users watching the page
310 $rc->numberofWatchingusers = 0; // Default
311 if ( $showWatcherCount && $obj->rc_namespace >= 0 ) {
312 if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) {
313 $watcherCache[$obj->rc_namespace][$obj->rc_title] =
314 $dbr->selectField(
315 'watchlist',
316 'COUNT(*)',
317 array(
318 'wl_namespace' => $obj->rc_namespace,
319 'wl_title' => $obj->rc_title,
320 ),
321 __METHOD__ . '-watchers'
322 );
323 }
324 $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
325 }
326
327 $changeLine = $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter );
328 if ( $changeLine !== false ) {
329 $rclistOutput .= $changeLine;
330 --$limit;
331 }
332 }
333 $rclistOutput .= $list->endRecentChangesList();
334
335 if ( $rows->numRows() === 0 ) {
336 $this->getOutput()->addHtml(
337 '<div class="mw-changeslist-empty">' . $this->msg( 'recentchanges-noresult' )->parse() . '</div>'
338 );
339 } else {
340 $this->getOutput()->addHTML( $rclistOutput );
341 }
342 }
343
344 /**
345 * Return the text to be displayed above the changes
346 *
347 * @param FormOptions $opts
348 * @return string XHTML
349 */
350 public function doHeader( $opts ) {
351 global $wgScript;
352
353 $this->setTopText( $opts );
354
355 $defaults = $opts->getAllValues();
356 $nondefaults = $opts->getChangedValues();
357
358 $panel = array();
359 $panel[] = self::makeLegend( $this->getContext() );
360 $panel[] = $this->optionsPanel( $defaults, $nondefaults );
361 $panel[] = '<hr />';
362
363 $extraOpts = $this->getExtraOptions( $opts );
364 $extraOptsCount = count( $extraOpts );
365 $count = 0;
366 $submit = ' ' . Xml::submitbutton( $this->msg( 'allpagessubmit' )->text() );
367
368 $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
369 foreach ( $extraOpts as $name => $optionRow ) {
370 # Add submit button to the last row only
371 ++$count;
372 $addSubmit = ( $count === $extraOptsCount ) ? $submit : '';
373
374 $out .= Xml::openElement( 'tr' );
375 if ( is_array( $optionRow ) ) {
376 $out .= Xml::tags(
377 'td',
378 array( 'class' => 'mw-label mw-' . $name . '-label' ),
379 $optionRow[0]
380 );
381 $out .= Xml::tags(
382 'td',
383 array( 'class' => 'mw-input' ),
384 $optionRow[1] . $addSubmit
385 );
386 } else {
387 $out .= Xml::tags(
388 'td',
389 array( 'class' => 'mw-input', 'colspan' => 2 ),
390 $optionRow . $addSubmit
391 );
392 }
393 $out .= Xml::closeElement( 'tr' );
394 }
395 $out .= Xml::closeElement( 'table' );
396
397 $unconsumed = $opts->getUnconsumedValues();
398 foreach ( $unconsumed as $key => $value ) {
399 $out .= Html::hidden( $key, $value );
400 }
401
402 $t = $this->getPageTitle();
403 $out .= Html::hidden( 'title', $t->getPrefixedText() );
404 $form = Xml::tags( 'form', array( 'action' => $wgScript ), $out );
405 $panel[] = $form;
406 $panelString = implode( "\n", $panel );
407
408 $this->getOutput()->addHTML(
409 Xml::fieldset(
410 $this->msg( 'recentchanges-legend' )->text(),
411 $panelString,
412 array( 'class' => 'rcoptions' )
413 )
414 );
415
416 $this->setBottomText( $opts );
417 }
418
419 /**
420 * Send the text to be displayed above the options
421 *
422 * @param FormOptions $opts Unused
423 */
424 function setTopText( FormOptions $opts ) {
425 global $wgContLang;
426
427 $message = $this->msg( 'recentchangestext' )->inContentLanguage();
428 if ( !$message->isDisabled() ) {
429 $this->getOutput()->addWikiText(
430 Html::rawElement( 'p',
431 array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ),
432 "\n" . $message->plain() . "\n"
433 ),
434 /* $lineStart */ false,
435 /* $interface */ false
436 );
437 }
438 }
439
440 /**
441 * Get options to be displayed in a form
442 *
443 * @param FormOptions $opts
444 * @return array
445 */
446 function getExtraOptions( $opts ) {
447 $opts->consumeValues( array(
448 'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any'
449 ) );
450
451 $extraOpts = array();
452 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
453
454 global $wgAllowCategorizedRecentChanges;
455 if ( $wgAllowCategorizedRecentChanges ) {
456 $extraOpts['category'] = $this->categoryFilterForm( $opts );
457 }
458
459 $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
460 if ( count( $tagFilter ) ) {
461 $extraOpts['tagfilter'] = $tagFilter;
462 }
463
464 // Don't fire the hook for subclasses. (Or should we?)
465 if ( $this->getName() === 'Recentchanges' ) {
466 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
467 }
468
469 return $extraOpts;
470 }
471
472 /**
473 * Add page-specific modules.
474 */
475 protected function addModules() {
476 parent::addModules();
477 $out = $this->getOutput();
478 $out->addModules( 'mediawiki.special.recentchanges' );
479 }
480
481 /**
482 * Get last modified date, for client caching
483 * Don't use this if we are using the patrol feature, patrol changes don't
484 * update the timestamp
485 *
486 * @return string|bool
487 */
488 public function checkLastModified() {
489 $dbr = $this->getDB();
490 $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ );
491 return $lastmod;
492 }
493
494 /**
495 * Creates the choose namespace selection
496 *
497 * @param FormOptions $opts
498 * @return string
499 */
500 protected function namespaceFilterForm( FormOptions $opts ) {
501 $nsSelect = Html::namespaceSelector(
502 array( 'selected' => $opts['namespace'], 'all' => '' ),
503 array( 'name' => 'namespace', 'id' => 'namespace' )
504 );
505 $nsLabel = Xml::label( $this->msg( 'namespace' )->text(), 'namespace' );
506 $invert = Xml::checkLabel(
507 $this->msg( 'invert' )->text(), 'invert', 'nsinvert',
508 $opts['invert'],
509 array( 'title' => $this->msg( 'tooltip-invert' )->text() )
510 );
511 $associated = Xml::checkLabel(
512 $this->msg( 'namespace_association' )->text(), 'associated', 'nsassociated',
513 $opts['associated'],
514 array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
515 );
516
517 return array( $nsLabel, "$nsSelect $invert $associated" );
518 }
519
520 /**
521 * Create a input to filter changes by categories
522 *
523 * @param FormOptions $opts
524 * @return array
525 */
526 protected function categoryFilterForm( FormOptions $opts ) {
527 list( $label, $input ) = Xml::inputLabelSep( $this->msg( 'rc_categories' )->text(),
528 'categories', 'mw-categories', false, $opts['categories'] );
529
530 $input .= ' ' . Xml::checkLabel( $this->msg( 'rc_categories_any' )->text(),
531 'categories_any', 'mw-categories_any', $opts['categories_any'] );
532
533 return array( $label, $input );
534 }
535
536 /**
537 * Filter $rows by categories set in $opts
538 *
539 * @param ResultWrapper $rows Database rows
540 * @param FormOptions $opts
541 */
542 function filterByCategories( &$rows, FormOptions $opts ) {
543 $categories = array_map( 'trim', explode( '|', $opts['categories'] ) );
544
545 if ( !count( $categories ) ) {
546 return;
547 }
548
549 # Filter categories
550 $cats = array();
551 foreach ( $categories as $cat ) {
552 $cat = trim( $cat );
553 if ( $cat == '' ) {
554 continue;
555 }
556 $cats[] = $cat;
557 }
558
559 # Filter articles
560 $articles = array();
561 $a2r = array();
562 $rowsarr = array();
563 foreach ( $rows as $k => $r ) {
564 $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
565 $id = $nt->getArticleID();
566 if ( $id == 0 ) {
567 continue; # Page might have been deleted...
568 }
569 if ( !in_array( $id, $articles ) ) {
570 $articles[] = $id;
571 }
572 if ( !isset( $a2r[$id] ) ) {
573 $a2r[$id] = array();
574 }
575 $a2r[$id][] = $k;
576 $rowsarr[$k] = $r;
577 }
578
579 # Shortcut?
580 if ( !count( $articles ) || !count( $cats ) ) {
581 return;
582 }
583
584 # Look up
585 $c = new Categoryfinder;
586 $c->seed( $articles, $cats, $opts['categories_any'] ? 'OR' : 'AND' );
587 $match = $c->run();
588
589 # Filter
590 $newrows = array();
591 foreach ( $match as $id ) {
592 foreach ( $a2r[$id] as $rev ) {
593 $k = $rev;
594 $newrows[$k] = $rowsarr[$k];
595 }
596 }
597 $rows = $newrows;
598 }
599
600 /**
601 * Makes change an option link which carries all the other options
602 *
603 * @param string $title Title
604 * @param array $override Options to override
605 * @param array $options Current options
606 * @param bool $active Whether to show the link in bold
607 * @return string
608 */
609 function makeOptionsLink( $title, $override, $options, $active = false ) {
610 $params = $override + $options;
611
612 // Bug 36524: false values have be converted to "0" otherwise
613 // wfArrayToCgi() will omit it them.
614 foreach ( $params as &$value ) {
615 if ( $value === false ) {
616 $value = '0';
617 }
618 }
619 unset( $value );
620
621 $text = htmlspecialchars( $title );
622 if ( $active ) {
623 $text = '<strong>' . $text . '</strong>';
624 }
625
626 return Linker::linkKnown( $this->getPageTitle(), $text, array(), $params );
627 }
628
629 /**
630 * Creates the options panel.
631 *
632 * @param array $defaults
633 * @param array $nondefaults
634 * @return string
635 */
636 function optionsPanel( $defaults, $nondefaults ) {
637 global $wgRCLinkLimits, $wgRCLinkDays;
638
639 $options = $nondefaults + $defaults;
640
641 $note = '';
642 $msg = $this->msg( 'rclegend' );
643 if ( !$msg->isDisabled() ) {
644 $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n";
645 }
646
647 $lang = $this->getLanguage();
648 $user = $this->getUser();
649 if ( $options['from'] ) {
650 $note .= $this->msg( 'rcnotefrom' )->numParams( $options['limit'] )->params(
651 $lang->userTimeAndDate( $options['from'], $user ),
652 $lang->userDate( $options['from'], $user ),
653 $lang->userTime( $options['from'], $user ) )->parse() . '<br />';
654 }
655
656 # Sort data for display and make sure it's unique after we've added user data.
657 $linkLimits = $wgRCLinkLimits;
658 $linkLimits[] = $options['limit'];
659 sort( $linkLimits );
660 $linkLimits = array_unique( $linkLimits );
661
662 $linkDays = $wgRCLinkDays;
663 $linkDays[] = $options['days'];
664 sort( $linkDays );
665 $linkDays = array_unique( $linkDays );
666
667 // limit links
668 $cl = array();
669 foreach ( $linkLimits as $value ) {
670 $cl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
671 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] );
672 }
673 $cl = $lang->pipeList( $cl );
674
675 // day links, reset 'from' to none
676 $dl = array();
677 foreach ( $linkDays as $value ) {
678 $dl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
679 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] );
680 }
681 $dl = $lang->pipeList( $dl );
682
683 // show/hide links
684 $filters = array(
685 'hideminor' => 'rcshowhideminor',
686 'hidebots' => 'rcshowhidebots',
687 'hideanons' => 'rcshowhideanons',
688 'hideliu' => 'rcshowhideliu',
689 'hidepatrolled' => 'rcshowhidepatr',
690 'hidemyself' => 'rcshowhidemine'
691 );
692
693 $showhide = array( 'show', 'hide' );
694
695 foreach ( $this->getCustomFilters() as $key => $params ) {
696 $filters[$key] = $params['msg'];
697 }
698 // Disable some if needed
699 if ( !$user->useRCPatrol() ) {
700 unset( $filters['hidepatrolled'] );
701 }
702
703 $links = array();
704 foreach ( $filters as $key => $msg ) {
705 // The following messages are used here:
706 // rcshowhideminor-show, rcshowhideminor-hide, rcshowhidebots-show, rcshowhidebots-hide,
707 // rcshowhideanons-show, rcshowhideanons-hide, rcshowhideliu-show, rcshowhideliu-hide,
708 // rcshowhidepatr-show, rcshowhidepatr-hide, rcshowhidemine-show, rcshowhidemine-hide.
709 $linkMessage = $this->msg( $msg . '-' . $showhide[1 - $options[$key]] );
710 // Extensions can define additional filters, but don't need to define the corresponding
711 // messages. If they don't exist, just fall back to 'show' and 'hide'.
712 if ( !$linkMessage->exists() ) {
713 $linkMessage = $this->msg( $showhide[1 - $options[$key]] );
714 }
715
716 $link = $this->makeOptionsLink( $linkMessage->text(),
717 array( $key => 1 - $options[$key] ), $nondefaults );
718 $links[] = $this->msg( $msg )->rawParams( $link )->escaped();
719 }
720
721 // show from this onward link
722 $timestamp = wfTimestampNow();
723 $now = $lang->userTimeAndDate( $timestamp, $user );
724 $timenow = $lang->userTime( $timestamp, $user );
725 $datenow = $lang->userDate( $timestamp, $user );
726 $rclinks = $this->msg( 'rclinks' )->rawParams( $cl, $dl, $lang->pipeList( $links ) )
727 ->parse();
728 $rclistfrom = $this->makeOptionsLink(
729 $this->msg( 'rclistfrom' )->rawParams( $now, $timenow, $datenow )->parse(),
730 array( 'from' => $timestamp ),
731 $nondefaults
732 );
733
734 return "{$note}$rclinks<br />$rclistfrom";
735 }
736
737 public function isIncludable() {
738 return true;
739 }
740 }