wfMsgForContentNoTrans() was removed
[mediawiki.git] / includes / specials / SpecialRecentchanges.php
blob4848d01141f0566503277426d9f0c3318857771b
1 <?php
2 /**
3 * Implements Special:Recentchanges
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.
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.
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
20 * @file
21 * @ingroup SpecialPage
24 /**
25 * A special page that lists last changes made to the wiki
27 * @ingroup SpecialPage
29 class SpecialRecentChanges extends ChangesListSpecialPage {
30 // @codingStandardsIgnoreStart Needed "useless" override to change parameters.
31 public function __construct( $name = 'Recentchanges', $restriction = '' ) {
32 parent::__construct( $name, $restriction );
34 // @codingStandardsIgnoreEnd
36 /**
37 * Main execution point
39 * @param string $subpage
41 public function execute( $subpage ) {
42 // Backwards-compatibility: redirect to new feed URLs
43 $feedFormat = $this->getRequest()->getVal( 'feed' );
44 if ( !$this->including() && $feedFormat ) {
45 $query = $this->getFeedQuery();
46 $query['feedformat'] = $feedFormat === 'atom' ? 'atom' : 'rss';
47 $this->getOutput()->redirect( wfAppendQuery( wfScript( 'api' ), $query ) );
49 return;
52 // 10 seconds server-side caching max
53 $this->getOutput()->setCdnMaxage( 10 );
54 // Check if the client has a cached version
55 $lastmod = $this->checkLastModified();
56 if ( $lastmod === false ) {
57 return;
60 $this->addHelpLink(
61 '//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Recent_changes',
62 true
64 parent::execute( $subpage );
67 /**
68 * Get a FormOptions object containing the default options
70 * @return FormOptions
72 public function getDefaultOptions() {
73 $opts = parent::getDefaultOptions();
74 $user = $this->getUser();
75 $config = $this->getConfig();
77 $opts->add( 'days', $user->getIntOption( 'rcdays' ) );
78 $opts->add( 'limit', $user->getIntOption( 'rclimit' ) );
79 $opts->add( 'from', '' );
81 $opts->add( 'hideminor', $user->getBoolOption( 'hideminor' ) );
82 $opts->add( 'hidebots', true );
83 $opts->add( 'hideanons', false );
84 $opts->add( 'hideliu', false );
85 $opts->add( 'hidepatrolled', $user->getBoolOption( 'hidepatrolled' ) );
86 $opts->add( 'hidemyself', false );
88 if ( $config->get( 'RCWatchCategoryMembership' ) ) {
89 $opts->add( 'hidecategorization', $user->getBoolOption( 'hidecategorization' ) );
92 $opts->add( 'categories', '' );
93 $opts->add( 'categories_any', false );
94 $opts->add( 'tagfilter', '' );
96 return $opts;
99 /**
100 * Get custom show/hide filters
102 * @return array Map of filter URL param names to properties (msg/default)
104 protected function getCustomFilters() {
105 if ( $this->customFilters === null ) {
106 $this->customFilters = parent::getCustomFilters();
107 Hooks::run( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ), '1.23' );
110 return $this->customFilters;
114 * Process $par and put options found in $opts. Used when including the page.
116 * @param string $par
117 * @param FormOptions $opts
119 public function parseParameters( $par, FormOptions $opts ) {
120 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
121 foreach ( $bits as $bit ) {
122 if ( 'hidebots' === $bit ) {
123 $opts['hidebots'] = true;
125 if ( 'bots' === $bit ) {
126 $opts['hidebots'] = false;
128 if ( 'hideminor' === $bit ) {
129 $opts['hideminor'] = true;
131 if ( 'minor' === $bit ) {
132 $opts['hideminor'] = false;
134 if ( 'hideliu' === $bit ) {
135 $opts['hideliu'] = true;
137 if ( 'hidepatrolled' === $bit ) {
138 $opts['hidepatrolled'] = true;
140 if ( 'hideanons' === $bit ) {
141 $opts['hideanons'] = true;
143 if ( 'hidemyself' === $bit ) {
144 $opts['hidemyself'] = true;
146 if ( 'hidecategorization' === $bit ) {
147 $opts['hidecategorization'] = true;
150 if ( is_numeric( $bit ) ) {
151 $opts['limit'] = $bit;
154 $m = array();
155 if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
156 $opts['limit'] = $m[1];
158 if ( preg_match( '/^days=(\d+)$/', $bit, $m ) ) {
159 $opts['days'] = $m[1];
161 if ( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) {
162 $opts['namespace'] = $m[1];
167 public function validateOptions( FormOptions $opts ) {
168 $opts->validateIntBounds( 'limit', 0, 5000 );
169 parent::validateOptions( $opts );
173 * Return an array of conditions depending of options set in $opts
175 * @param FormOptions $opts
176 * @return array
178 public function buildMainQueryConds( FormOptions $opts ) {
179 $dbr = $this->getDB();
180 $conds = parent::buildMainQueryConds( $opts );
182 // Calculate cutoff
183 $cutoff_unixtime = time() - ( $opts['days'] * 86400 );
184 $cutoff_unixtime = $cutoff_unixtime - ( $cutoff_unixtime % 86400 );
185 $cutoff = $dbr->timestamp( $cutoff_unixtime );
187 $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] );
188 if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW, $cutoff ) ) {
189 $cutoff = $dbr->timestamp( $opts['from'] );
190 } else {
191 $opts->reset( 'from' );
194 $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff );
196 return $conds;
200 * Process the query
202 * @param array $conds
203 * @param FormOptions $opts
204 * @return bool|ResultWrapper Result or false (for Recentchangeslinked only)
206 public function doMainQuery( $conds, $opts ) {
207 $dbr = $this->getDB();
208 $user = $this->getUser();
210 $tables = array( 'recentchanges' );
211 $fields = RecentChange::selectFields();
212 $query_options = array();
213 $join_conds = array();
215 // JOIN on watchlist for users
216 if ( $user->getId() && $user->isAllowed( 'viewmywatchlist' ) ) {
217 $tables[] = 'watchlist';
218 $fields[] = 'wl_user';
219 $fields[] = 'wl_notificationtimestamp';
220 $join_conds['watchlist'] = array( 'LEFT JOIN', array(
221 'wl_user' => $user->getId(),
222 'wl_title=rc_title',
223 'wl_namespace=rc_namespace'
224 ) );
227 if ( $user->isAllowed( 'rollback' ) ) {
228 $tables[] = 'page';
229 $fields[] = 'page_latest';
230 $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' );
233 ChangeTags::modifyDisplayQuery(
234 $tables,
235 $fields,
236 $conds,
237 $join_conds,
238 $query_options,
239 $opts['tagfilter']
242 if ( !$this->runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds,
243 $opts )
245 return false;
248 // array_merge() is used intentionally here so that hooks can, should
249 // they so desire, override the ORDER BY / LIMIT condition(s); prior to
250 // MediaWiki 1.26 this used to use the plus operator instead, which meant
251 // that extensions weren't able to change these conditions
252 $query_options = array_merge( array(
253 'ORDER BY' => 'rc_timestamp DESC',
254 'LIMIT' => $opts['limit'] ), $query_options );
255 $rows = $dbr->select(
256 $tables,
257 $fields,
258 // rc_new is not an ENUM, but adding a redundant rc_new IN (0,1) gives mysql enough
259 // knowledge to use an index merge if it wants (it may use some other index though).
260 $conds + array( 'rc_new' => array( 0, 1 ) ),
261 __METHOD__,
262 $query_options,
263 $join_conds
266 // Build the final data
267 if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' ) ) {
268 $this->filterByCategories( $rows, $opts );
271 return $rows;
274 protected function runMainQueryHook( &$tables, &$fields, &$conds,
275 &$query_options, &$join_conds, $opts
277 return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts )
278 && Hooks::run(
279 'SpecialRecentChangesQuery',
280 array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ),
281 '1.23'
285 protected function getDB() {
286 return wfGetDB( DB_SLAVE, 'recentchanges' );
289 public function outputFeedLinks() {
290 $this->addFeedLinks( $this->getFeedQuery() );
294 * Get URL query parameters for action=feedrecentchanges API feed of current recent changes view.
296 * @return array
298 protected function getFeedQuery() {
299 $query = array_filter( $this->getOptions()->getAllValues(), function ( $value ) {
300 // API handles empty parameters in a different way
301 return $value !== '';
302 } );
303 $query['action'] = 'feedrecentchanges';
304 $feedLimit = $this->getConfig()->get( 'FeedLimit' );
305 if ( $query['limit'] > $feedLimit ) {
306 $query['limit'] = $feedLimit;
309 return $query;
313 * Build and output the actual changes list.
315 * @param array $rows Database rows
316 * @param FormOptions $opts
318 public function outputChangesList( $rows, $opts ) {
319 $limit = $opts['limit'];
321 $showWatcherCount = $this->getConfig()->get( 'RCShowWatchingUsers' )
322 && $this->getUser()->getOption( 'shownumberswatching' );
323 $watcherCache = array();
325 $dbr = $this->getDB();
327 $counter = 1;
328 $list = ChangesList::newFromContext( $this->getContext() );
329 $list->initChangesListRows( $rows );
331 $rclistOutput = $list->beginRecentChangesList();
332 foreach ( $rows as $obj ) {
333 if ( $limit == 0 ) {
334 break;
336 $rc = RecentChange::newFromRow( $obj );
337 $rc->counter = $counter++;
338 # Check if the page has been updated since the last visit
339 if ( $this->getConfig()->get( 'ShowUpdatedMarker' )
340 && !empty( $obj->wl_notificationtimestamp )
342 $rc->notificationtimestamp = ( $obj->rc_timestamp >= $obj->wl_notificationtimestamp );
343 } else {
344 $rc->notificationtimestamp = false; // Default
346 # Check the number of users watching the page
347 $rc->numberofWatchingusers = 0; // Default
348 if ( $showWatcherCount && $obj->rc_namespace >= 0 ) {
349 if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) {
350 $watcherCache[$obj->rc_namespace][$obj->rc_title] =
351 $dbr->selectField(
352 'watchlist',
353 'COUNT(*)',
354 array(
355 'wl_namespace' => $obj->rc_namespace,
356 'wl_title' => $obj->rc_title,
358 __METHOD__ . '-watchers'
361 $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
364 $changeLine = $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter );
365 if ( $changeLine !== false ) {
366 $rclistOutput .= $changeLine;
367 --$limit;
370 $rclistOutput .= $list->endRecentChangesList();
372 if ( $rows->numRows() === 0 ) {
373 $this->getOutput()->addHtml(
374 '<div class="mw-changeslist-empty">' .
375 $this->msg( 'recentchanges-noresult' )->parse() .
376 '</div>'
378 if ( !$this->including() ) {
379 $this->getOutput()->setStatusCode( 404 );
381 } else {
382 $this->getOutput()->addHTML( $rclistOutput );
387 * Set the text to be displayed above the changes
389 * @param FormOptions $opts
390 * @param int $numRows Number of rows in the result to show after this header
392 public function doHeader( $opts, $numRows ) {
393 $this->setTopText( $opts );
395 $defaults = $opts->getAllValues();
396 $nondefaults = $opts->getChangedValues();
398 $panel = array();
399 $panel[] = self::makeLegend( $this->getContext() );
400 $panel[] = $this->optionsPanel( $defaults, $nondefaults, $numRows );
401 $panel[] = '<hr />';
403 $extraOpts = $this->getExtraOptions( $opts );
404 $extraOptsCount = count( $extraOpts );
405 $count = 0;
406 $submit = ' ' . Xml::submitbutton( $this->msg( 'recentchanges-submit' )->text() );
408 $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
409 foreach ( $extraOpts as $name => $optionRow ) {
410 # Add submit button to the last row only
411 ++$count;
412 $addSubmit = ( $count === $extraOptsCount ) ? $submit : '';
414 $out .= Xml::openElement( 'tr' );
415 if ( is_array( $optionRow ) ) {
416 $out .= Xml::tags(
417 'td',
418 array( 'class' => 'mw-label mw-' . $name . '-label' ),
419 $optionRow[0]
421 $out .= Xml::tags(
422 'td',
423 array( 'class' => 'mw-input' ),
424 $optionRow[1] . $addSubmit
426 } else {
427 $out .= Xml::tags(
428 'td',
429 array( 'class' => 'mw-input', 'colspan' => 2 ),
430 $optionRow . $addSubmit
433 $out .= Xml::closeElement( 'tr' );
435 $out .= Xml::closeElement( 'table' );
437 $unconsumed = $opts->getUnconsumedValues();
438 foreach ( $unconsumed as $key => $value ) {
439 $out .= Html::hidden( $key, $value );
442 $t = $this->getPageTitle();
443 $out .= Html::hidden( 'title', $t->getPrefixedText() );
444 $form = Xml::tags( 'form', array( 'action' => wfScript() ), $out );
445 $panel[] = $form;
446 $panelString = implode( "\n", $panel );
448 $this->getOutput()->addHTML(
449 Xml::fieldset(
450 $this->msg( 'recentchanges-legend' )->text(),
451 $panelString,
452 array( 'class' => 'rcoptions' )
456 $this->setBottomText( $opts );
460 * Send the text to be displayed above the options
462 * @param FormOptions $opts Unused
464 function setTopText( FormOptions $opts ) {
465 global $wgContLang;
467 $message = $this->msg( 'recentchangestext' )->inContentLanguage();
468 if ( !$message->isDisabled() ) {
469 $this->getOutput()->addWikiText(
470 Html::rawElement( 'div',
471 array( 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ),
472 "\n" . $message->plain() . "\n"
474 /* $lineStart */ true,
475 /* $interface */ false
481 * Get options to be displayed in a form
483 * @param FormOptions $opts
484 * @return array
486 function getExtraOptions( $opts ) {
487 $opts->consumeValues( array(
488 'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any'
489 ) );
491 $extraOpts = array();
492 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
494 if ( $this->getConfig()->get( 'AllowCategorizedRecentChanges' ) ) {
495 $extraOpts['category'] = $this->categoryFilterForm( $opts );
498 $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
499 if ( count( $tagFilter ) ) {
500 $extraOpts['tagfilter'] = $tagFilter;
503 // Don't fire the hook for subclasses. (Or should we?)
504 if ( $this->getName() === 'Recentchanges' ) {
505 Hooks::run( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
508 return $extraOpts;
512 * Add page-specific modules.
514 protected function addModules() {
515 parent::addModules();
516 $out = $this->getOutput();
517 $out->addModules( 'mediawiki.special.recentchanges' );
521 * Get last modified date, for client caching
522 * Don't use this if we are using the patrol feature, patrol changes don't
523 * update the timestamp
525 * @return string|bool
527 public function checkLastModified() {
528 $dbr = $this->getDB();
529 $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ );
531 return $lastmod;
535 * Creates the choose namespace selection
537 * @param FormOptions $opts
538 * @return string
540 protected function namespaceFilterForm( FormOptions $opts ) {
541 $nsSelect = Html::namespaceSelector(
542 array( 'selected' => $opts['namespace'], 'all' => '' ),
543 array( 'name' => 'namespace', 'id' => 'namespace' )
545 $nsLabel = Xml::label( $this->msg( 'namespace' )->text(), 'namespace' );
546 $invert = Xml::checkLabel(
547 $this->msg( 'invert' )->text(), 'invert', 'nsinvert',
548 $opts['invert'],
549 array( 'title' => $this->msg( 'tooltip-invert' )->text() )
551 $associated = Xml::checkLabel(
552 $this->msg( 'namespace_association' )->text(), 'associated', 'nsassociated',
553 $opts['associated'],
554 array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
557 return array( $nsLabel, "$nsSelect $invert $associated" );
561 * Create an input to filter changes by categories
563 * @param FormOptions $opts
564 * @return array
566 protected function categoryFilterForm( FormOptions $opts ) {
567 list( $label, $input ) = Xml::inputLabelSep( $this->msg( 'rc_categories' )->text(),
568 'categories', 'mw-categories', false, $opts['categories'] );
570 $input .= ' ' . Xml::checkLabel( $this->msg( 'rc_categories_any' )->text(),
571 'categories_any', 'mw-categories_any', $opts['categories_any'] );
573 return array( $label, $input );
577 * Filter $rows by categories set in $opts
579 * @param ResultWrapper $rows Database rows
580 * @param FormOptions $opts
582 function filterByCategories( &$rows, FormOptions $opts ) {
583 $categories = array_map( 'trim', explode( '|', $opts['categories'] ) );
585 if ( !count( $categories ) ) {
586 return;
589 # Filter categories
590 $cats = array();
591 foreach ( $categories as $cat ) {
592 $cat = trim( $cat );
593 if ( $cat == '' ) {
594 continue;
596 $cats[] = $cat;
599 # Filter articles
600 $articles = array();
601 $a2r = array();
602 $rowsarr = array();
603 foreach ( $rows as $k => $r ) {
604 $nt = Title::makeTitle( $r->rc_namespace, $r->rc_title );
605 $id = $nt->getArticleID();
606 if ( $id == 0 ) {
607 continue; # Page might have been deleted...
609 if ( !in_array( $id, $articles ) ) {
610 $articles[] = $id;
612 if ( !isset( $a2r[$id] ) ) {
613 $a2r[$id] = array();
615 $a2r[$id][] = $k;
616 $rowsarr[$k] = $r;
619 # Shortcut?
620 if ( !count( $articles ) || !count( $cats ) ) {
621 return;
624 # Look up
625 $catFind = new CategoryFinder;
626 $catFind->seed( $articles, $cats, $opts['categories_any'] ? 'OR' : 'AND' );
627 $match = $catFind->run();
629 # Filter
630 $newrows = array();
631 foreach ( $match as $id ) {
632 foreach ( $a2r[$id] as $rev ) {
633 $k = $rev;
634 $newrows[$k] = $rowsarr[$k];
637 $rows = $newrows;
641 * Makes change an option link which carries all the other options
643 * @param string $title Title
644 * @param array $override Options to override
645 * @param array $options Current options
646 * @param bool $active Whether to show the link in bold
647 * @return string
649 function makeOptionsLink( $title, $override, $options, $active = false ) {
650 $params = $override + $options;
652 // Bug 36524: false values have be converted to "0" otherwise
653 // wfArrayToCgi() will omit it them.
654 foreach ( $params as &$value ) {
655 if ( $value === false ) {
656 $value = '0';
659 unset( $value );
661 $text = htmlspecialchars( $title );
662 if ( $active ) {
663 $text = '<strong>' . $text . '</strong>';
666 return Linker::linkKnown( $this->getPageTitle(), $text, array(), $params );
670 * Creates the options panel.
672 * @param array $defaults
673 * @param array $nondefaults
674 * @param int $numRows Number of rows in the result to show after this header
675 * @return string
677 function optionsPanel( $defaults, $nondefaults, $numRows ) {
678 $options = $nondefaults + $defaults;
680 $note = '';
681 $msg = $this->msg( 'rclegend' );
682 if ( !$msg->isDisabled() ) {
683 $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n";
686 $lang = $this->getLanguage();
687 $user = $this->getUser();
688 $config = $this->getConfig();
689 if ( $options['from'] ) {
690 $note .= $this->msg( 'rcnotefrom' )
691 ->numParams( $options['limit'] )
692 ->params(
693 $lang->userTimeAndDate( $options['from'], $user ),
694 $lang->userDate( $options['from'], $user ),
695 $lang->userTime( $options['from'], $user )
697 ->numParams( $numRows )
698 ->parse() . '<br />';
701 # Sort data for display and make sure it's unique after we've added user data.
702 $linkLimits = $config->get( 'RCLinkLimits' );
703 $linkLimits[] = $options['limit'];
704 sort( $linkLimits );
705 $linkLimits = array_unique( $linkLimits );
707 $linkDays = $config->get( 'RCLinkDays' );
708 $linkDays[] = $options['days'];
709 sort( $linkDays );
710 $linkDays = array_unique( $linkDays );
712 // limit links
713 $cl = array();
714 foreach ( $linkLimits as $value ) {
715 $cl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
716 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] );
718 $cl = $lang->pipeList( $cl );
720 // day links, reset 'from' to none
721 $dl = array();
722 foreach ( $linkDays as $value ) {
723 $dl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
724 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] );
726 $dl = $lang->pipeList( $dl );
728 // show/hide links
729 $filters = array(
730 'hideminor' => 'rcshowhideminor',
731 'hidebots' => 'rcshowhidebots',
732 'hideanons' => 'rcshowhideanons',
733 'hideliu' => 'rcshowhideliu',
734 'hidepatrolled' => 'rcshowhidepatr',
735 'hidemyself' => 'rcshowhidemine'
738 if ( $config->get( 'RCWatchCategoryMembership' ) ) {
739 $filters['hidecategorization'] = 'rcshowhidecategorization';
742 $showhide = array( 'show', 'hide' );
744 foreach ( $this->getCustomFilters() as $key => $params ) {
745 $filters[$key] = $params['msg'];
747 // Disable some if needed
748 if ( !$user->useRCPatrol() ) {
749 unset( $filters['hidepatrolled'] );
752 $links = array();
753 foreach ( $filters as $key => $msg ) {
754 // The following messages are used here:
755 // rcshowhideminor-show, rcshowhideminor-hide, rcshowhidebots-show, rcshowhidebots-hide,
756 // rcshowhideanons-show, rcshowhideanons-hide, rcshowhideliu-show, rcshowhideliu-hide,
757 // rcshowhidepatr-show, rcshowhidepatr-hide, rcshowhidemine-show, rcshowhidemine-hide,
758 // rcshowhidecategorization-show, rcshowhidecategorization-hide.
759 $linkMessage = $this->msg( $msg . '-' . $showhide[1 - $options[$key]] );
760 // Extensions can define additional filters, but don't need to define the corresponding
761 // messages. If they don't exist, just fall back to 'show' and 'hide'.
762 if ( !$linkMessage->exists() ) {
763 $linkMessage = $this->msg( $showhide[1 - $options[$key]] );
766 $link = $this->makeOptionsLink( $linkMessage->text(),
767 array( $key => 1 - $options[$key] ), $nondefaults );
768 $links[] = "<span class=\"$msg rcshowhideoption\">"
769 . $this->msg( $msg )->rawParams( $link )->escaped() . '</span>';
772 // show from this onward link
773 $timestamp = wfTimestampNow();
774 $now = $lang->userTimeAndDate( $timestamp, $user );
775 $timenow = $lang->userTime( $timestamp, $user );
776 $datenow = $lang->userDate( $timestamp, $user );
777 $pipedLinks = '<span class="rcshowhide">' . $lang->pipeList( $links ) . '</span>';
779 $rclinks = '<span class="rclinks">' . $this->msg( 'rclinks' )->rawParams( $cl, $dl, $pipedLinks )
780 ->parse() . '</span>';
782 $rclistfrom = '<span class="rclistfrom">' . $this->makeOptionsLink(
783 $this->msg( 'rclistfrom' )->rawParams( $now, $timenow, $datenow )->parse(),
784 array( 'from' => $timestamp ),
785 $nondefaults
786 ) . '</span>';
788 return "{$note}$rclinks<br />$rclistfrom";
791 public function isIncludable() {
792 return true;