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
21 * @ingroup SpecialPage
25 * A special page that lists last changes made to the wiki
27 * @ingroup SpecialPage
29 class SpecialRecentChanges
extends IncludableSpecialPage
{
30 var $rcOptions, $rcSubpage;
31 protected $customFilters;
33 public function __construct( $name = 'Recentchanges' ) {
34 parent
::__construct( $name );
38 * Get a FormOptions object containing the default options
42 public function getDefaultOptions() {
43 $opts = new FormOptions();
45 $opts->add( 'days', $this->getUser()->getIntOption( 'rcdays' ) );
46 $opts->add( 'limit', $this->getUser()->getIntOption( 'rclimit' ) );
47 $opts->add( 'from', '' );
49 $opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) );
50 $opts->add( 'hidebots', true );
51 $opts->add( 'hideanons', false );
52 $opts->add( 'hideliu', false );
53 $opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'hidepatrolled' ) );
54 $opts->add( 'hidemyself', false );
56 $opts->add( 'namespace', '', FormOptions
::INTNULL
);
57 $opts->add( 'invert', false );
58 $opts->add( 'associated', false );
60 $opts->add( 'categories', '' );
61 $opts->add( 'categories_any', false );
62 $opts->add( 'tagfilter', '' );
68 * Create a FormOptions object with options as specified by the user
70 * @param array $parameters
74 public function setup( $parameters ) {
75 $opts = $this->getDefaultOptions();
77 foreach ( $this->getCustomFilters() as $key => $params ) {
78 $opts->add( $key, $params['default'] );
81 $opts->fetchValuesFromRequest( $this->getRequest() );
83 // Give precedence to subpage syntax
84 if ( $parameters !== null ) {
85 $this->parseParameters( $parameters, $opts );
88 $opts->validateIntBounds( 'limit', 0, 5000 );
94 * Get custom show/hide filters
96 * @return array Map of filter URL param names to properties (msg/default)
98 protected function getCustomFilters() {
99 if ( $this->customFilters
=== null ) {
100 $this->customFilters
= array();
101 wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters
) );
104 return $this->customFilters
;
108 * Create a FormOptions object specific for feed requests and return it
110 * @return FormOptions
112 public function feedSetup() {
114 $opts = $this->getDefaultOptions();
115 $opts->fetchValuesFromRequest( $this->getRequest() );
116 $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
122 * Get the current FormOptions for this request
124 public function getOptions() {
125 if ( $this->rcOptions
=== null ) {
126 if ( $this->including() ) {
129 $isFeed = (bool)$this->getRequest()->getVal( 'feed' );
131 $this->rcOptions
= $isFeed ?
$this->feedSetup() : $this->setup( $this->rcSubpage
);
134 return $this->rcOptions
;
138 * Main execution point
140 * @param string $subpage
142 public function execute( $subpage ) {
143 $this->rcSubpage
= $subpage;
144 $feedFormat = $this->including() ?
null : $this->getRequest()->getVal( 'feed' );
146 # 10 seconds server-side caching max
147 $this->getOutput()->setSquidMaxage( 10 );
148 # Check if the client has a cached version
149 $lastmod = $this->checkLastModified( $feedFormat );
150 if ( $lastmod === false ) {
154 $opts = $this->getOptions();
156 $this->outputHeader();
157 $this->addRecentChangesJS();
159 // Fetch results, prepare a batch link existence check query
160 $conds = $this->buildMainQueryConds( $opts );
161 $rows = $this->doMainQuery( $conds, $opts );
162 if ( $rows === false ) {
163 if ( !$this->including() ) {
164 $this->doHeader( $opts );
170 if ( !$feedFormat ) {
171 $batch = new LinkBatch
;
172 foreach ( $rows as $row ) {
173 $batch->add( NS_USER
, $row->rc_user_text
);
174 $batch->add( NS_USER_TALK
, $row->rc_user_text
);
175 $batch->add( $row->rc_namespace
, $row->rc_title
);
180 list( $changesFeed, $formatter ) = $this->getFeedObject( $feedFormat );
181 /** @var ChangesFeed $changesFeed */
182 $changesFeed->execute( $formatter, $rows, $lastmod, $opts );
184 $this->webOutput( $rows, $opts );
191 * Return an array with a ChangesFeed object and ChannelFeed object
193 * @param string $feedFormat Feed's format (either 'rss' or 'atom')
196 public function getFeedObject( $feedFormat ) {
197 $changesFeed = new ChangesFeed( $feedFormat, 'rcfeed' );
198 $formatter = $changesFeed->getFeedObject(
199 $this->msg( 'recentchanges' )->inContentLanguage()->text(),
200 $this->msg( 'recentchanges-feed-description' )->inContentLanguage()->text(),
201 $this->getTitle()->getFullURL()
204 return array( $changesFeed, $formatter );
208 * Process $par and put options found if $opts
209 * Mainly used when including the page
212 * @param FormOptions $opts
214 public function parseParameters( $par, FormOptions
$opts ) {
215 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
216 foreach ( $bits as $bit ) {
217 if ( 'hidebots' === $bit ) {
218 $opts['hidebots'] = true;
220 if ( 'bots' === $bit ) {
221 $opts['hidebots'] = false;
223 if ( 'hideminor' === $bit ) {
224 $opts['hideminor'] = true;
226 if ( 'minor' === $bit ) {
227 $opts['hideminor'] = false;
229 if ( 'hideliu' === $bit ) {
230 $opts['hideliu'] = true;
232 if ( 'hidepatrolled' === $bit ) {
233 $opts['hidepatrolled'] = true;
235 if ( 'hideanons' === $bit ) {
236 $opts['hideanons'] = true;
238 if ( 'hidemyself' === $bit ) {
239 $opts['hidemyself'] = true;
242 if ( is_numeric( $bit ) ) {
243 $opts['limit'] = $bit;
247 if ( preg_match( '/^limit=(\d+)$/', $bit, $m ) ) {
248 $opts['limit'] = $m[1];
250 if ( preg_match( '/^days=(\d+)$/', $bit, $m ) ) {
251 $opts['days'] = $m[1];
253 if ( preg_match( '/^namespace=(\d+)$/', $bit, $m ) ) {
254 $opts['namespace'] = $m[1];
260 * Get last modified date, for client caching
261 * Don't use this if we are using the patrol feature, patrol changes don't
262 * update the timestamp
264 * @param string $feedFormat
265 * @return string|bool
267 public function checkLastModified( $feedFormat ) {
268 $dbr = wfGetDB( DB_SLAVE
);
269 $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__
);
270 if ( $feedFormat ||
!$this->getUser()->useRCPatrol() ) {
271 if ( $lastmod && $this->getOutput()->checkLastModified( $lastmod ) ) {
272 # Client cache fresh and headers sent, nothing more to do.
281 * Return an array of conditions depending of options set in $opts
283 * @param FormOptions $opts
286 public function buildMainQueryConds( FormOptions
$opts ) {
287 $dbr = wfGetDB( DB_SLAVE
);
290 # It makes no sense to hide both anons and logged-in users
291 # Where this occurs, force anons to be shown
293 if ( $opts['hideanons'] && $opts['hideliu'] ) {
294 # Check if the user wants to show bots only
295 if ( $opts['hidebots'] ) {
296 $opts['hideanons'] = false;
299 $opts['hidebots'] = false;
304 $cutoff_unixtime = time() - ( $opts['days'] * 86400 );
305 $cutoff_unixtime = $cutoff_unixtime - ( $cutoff_unixtime %
86400 );
306 $cutoff = $dbr->timestamp( $cutoff_unixtime );
308 $fromValid = preg_match( '/^[0-9]{14}$/', $opts['from'] );
309 if ( $fromValid && $opts['from'] > wfTimestamp( TS_MW
, $cutoff ) ) {
310 $cutoff = $dbr->timestamp( $opts['from'] );
312 $opts->reset( 'from' );
315 $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $cutoff );
317 $hidePatrol = $this->getUser()->useRCPatrol() && $opts['hidepatrolled'];
318 $hideLoggedInUsers = $opts['hideliu'] && !$forcebot;
319 $hideAnonymousUsers = $opts['hideanons'] && !$forcebot;
321 if ( $opts['hideminor'] ) {
322 $conds['rc_minor'] = 0;
324 if ( $opts['hidebots'] ) {
325 $conds['rc_bot'] = 0;
328 $conds['rc_patrolled'] = 0;
331 $conds['rc_bot'] = 1;
333 if ( $hideLoggedInUsers ) {
334 $conds[] = 'rc_user = 0';
336 if ( $hideAnonymousUsers ) {
337 $conds[] = 'rc_user != 0';
340 if ( $opts['hidemyself'] ) {
341 if ( $this->getUser()->getId() ) {
342 $conds[] = 'rc_user != ' . $dbr->addQuotes( $this->getUser()->getId() );
344 $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $this->getUser()->getName() );
348 # Namespace filtering
349 if ( $opts['namespace'] !== '' ) {
350 $selectedNS = $dbr->addQuotes( $opts['namespace'] );
351 $operator = $opts['invert'] ?
'!=' : '=';
352 $boolean = $opts['invert'] ?
'AND' : 'OR';
354 # namespace association (bug 2429)
355 if ( !$opts['associated'] ) {
356 $condition = "rc_namespace $operator $selectedNS";
358 # Also add the associated namespace
359 $associatedNS = $dbr->addQuotes(
360 MWNamespace
::getAssociated( $opts['namespace'] )
362 $condition = "(rc_namespace $operator $selectedNS "
364 . " rc_namespace $operator $associatedNS)";
367 $conds[] = $condition;
376 * @param array $conds
377 * @param FormOptions $opts
378 * @return bool|ResultWrapper Result or false (for Recentchangeslinked only)
380 public function doMainQuery( $conds, $opts ) {
381 $tables = array( 'recentchanges' );
382 $join_conds = array();
383 $query_options = array(
384 'USE INDEX' => array( 'recentchanges' => 'rc_timestamp' )
387 $uid = $this->getUser()->getId();
388 $dbr = wfGetDB( DB_SLAVE
);
389 $limit = $opts['limit'];
390 $namespace = $opts['namespace'];
391 $invert = $opts['invert'];
392 $associated = $opts['associated'];
394 $fields = RecentChange
::selectFields();
395 // JOIN on watchlist for users
396 if ( $uid && $this->getUser()->isAllowed( 'viewmywatchlist' ) ) {
397 $tables[] = 'watchlist';
398 $fields[] = 'wl_user';
399 $fields[] = 'wl_notificationtimestamp';
400 $join_conds['watchlist'] = array( 'LEFT JOIN', array(
403 'wl_namespace=rc_namespace'
406 if ( $this->getUser()->isAllowed( 'rollback' ) ) {
408 $fields[] = 'page_latest';
409 $join_conds['page'] = array( 'LEFT JOIN', 'rc_cur_id=page_id' );
412 ChangeTags
::modifyDisplayQuery(
421 if ( !wfRunHooks( 'SpecialRecentChangesQuery',
422 array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) )
427 // rc_new is not an ENUM, but adding a redundant rc_new IN (0,1) gives mysql enough
428 // knowledge to use an index merge if it wants (it may use some other index though).
432 $conds +
array( 'rc_new' => array( 0, 1 ) ),
434 array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ) +
$query_options,
440 * Send output to the OutputPage object, only called if not used feeds
442 * @param array $rows Database rows
443 * @param FormOptions $opts
445 public function webOutput( $rows, $opts ) {
446 global $wgRCShowWatchingUsers, $wgShowUpdatedMarker, $wgAllowCategorizedRecentChanges;
448 // Build the final data
450 if ( $wgAllowCategorizedRecentChanges ) {
451 $this->filterByCategories( $rows, $opts );
454 $limit = $opts['limit'];
456 $showWatcherCount = $wgRCShowWatchingUsers && $this->getUser()->getOption( 'shownumberswatching' );
457 $watcherCache = array();
459 $dbr = wfGetDB( DB_SLAVE
);
462 $list = ChangesList
::newFromContext( $this->getContext() );
464 $rclistOutput = $list->beginRecentChangesList();
465 foreach ( $rows as $obj ) {
469 $rc = RecentChange
::newFromRow( $obj );
470 $rc->counter
= $counter++
;
471 # Check if the page has been updated since the last visit
472 if ( $wgShowUpdatedMarker && !empty( $obj->wl_notificationtimestamp
) ) {
473 $rc->notificationtimestamp
= ( $obj->rc_timestamp
>= $obj->wl_notificationtimestamp
);
475 $rc->notificationtimestamp
= false; // Default
477 # Check the number of users watching the page
478 $rc->numberofWatchingusers
= 0; // Default
479 if ( $showWatcherCount && $obj->rc_namespace
>= 0 ) {
480 if ( !isset( $watcherCache[$obj->rc_namespace
][$obj->rc_title
] ) ) {
481 $watcherCache[$obj->rc_namespace
][$obj->rc_title
] =
486 'wl_namespace' => $obj->rc_namespace
,
487 'wl_title' => $obj->rc_title
,
489 __METHOD__
. '-watchers'
492 $rc->numberofWatchingusers
= $watcherCache[$obj->rc_namespace
][$obj->rc_title
];
495 $changeLine = $list->recentChangesLine( $rc, !empty( $obj->wl_user
), $counter );
496 if ( $changeLine !== false ) {
497 $rclistOutput .= $changeLine;
501 $rclistOutput .= $list->endRecentChangesList();
505 if ( !$this->including() ) {
506 // Output options box
507 $this->doHeader( $opts );
510 // And now for the content
511 $feedQuery = $this->getFeedQuery();
512 if ( $feedQuery !== '' ) {
513 $this->getOutput()->setFeedAppendQuery( $feedQuery );
515 $this->getOutput()->setFeedAppendQuery( false );
518 if ( $rows->numRows() === 0 ) {
519 $this->getOutput()->wrapWikiMsg(
520 "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
523 $this->getOutput()->addHTML( $rclistOutput );
528 * Get the query string to append to feed link URLs.
532 public function getFeedQuery() {
535 $this->getOptions()->validateIntBounds( 'limit', 0, $wgFeedLimit );
536 $options = $this->getOptions()->getChangedValues();
538 // wfArrayToCgi() omits options set to null or false
539 foreach ( $options as &$value ) {
540 if ( $value === false ) {
546 return wfArrayToCgi( $options );
550 * Return the text to be displayed above the changes
552 * @param FormOptions $opts
553 * @return string XHTML
555 public function doHeader( $opts ) {
558 $this->setTopText( $opts );
560 $defaults = $opts->getAllValues();
561 $nondefaults = $opts->getChangedValues();
564 $panel[] = $this->optionsPanel( $defaults, $nondefaults );
567 $extraOpts = $this->getExtraOptions( $opts );
568 $extraOptsCount = count( $extraOpts );
570 $submit = ' ' . Xml
::submitbutton( $this->msg( 'allpagessubmit' )->text() );
572 $out = Xml
::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
573 foreach ( $extraOpts as $name => $optionRow ) {
574 # Add submit button to the last row only
576 $addSubmit = ( $count === $extraOptsCount ) ?
$submit : '';
578 $out .= Xml
::openElement( 'tr' );
579 if ( is_array( $optionRow ) ) {
582 array( 'class' => 'mw-label mw-' . $name . '-label' ),
587 array( 'class' => 'mw-input' ),
588 $optionRow[1] . $addSubmit
593 array( 'class' => 'mw-input', 'colspan' => 2 ),
594 $optionRow . $addSubmit
597 $out .= Xml
::closeElement( 'tr' );
599 $out .= Xml
::closeElement( 'table' );
601 $unconsumed = $opts->getUnconsumedValues();
602 foreach ( $unconsumed as $key => $value ) {
603 $out .= Html
::hidden( $key, $value );
606 $t = $this->getTitle();
607 $out .= Html
::hidden( 'title', $t->getPrefixedText() );
608 $form = Xml
::tags( 'form', array( 'action' => $wgScript ), $out );
610 $panelString = implode( "\n", $panel );
612 $this->getOutput()->addHTML(
614 $this->msg( 'recentchanges-legend' )->text(),
616 array( 'class' => 'rcoptions' )
620 $this->setBottomText( $opts );
624 * Get options to be displayed in a form
626 * @param FormOptions $opts
629 function getExtraOptions( $opts ) {
630 $opts->consumeValues( array(
631 'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any'
634 $extraOpts = array();
635 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
637 global $wgAllowCategorizedRecentChanges;
638 if ( $wgAllowCategorizedRecentChanges ) {
639 $extraOpts['category'] = $this->categoryFilterForm( $opts );
642 $tagFilter = ChangeTags
::buildTagFilterSelector( $opts['tagfilter'] );
643 if ( count( $tagFilter ) ) {
644 $extraOpts['tagfilter'] = $tagFilter;
647 // Don't fire the hook for subclasses. (Or should we?)
648 if ( $this->getName() === 'Recentchanges' ) {
649 wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
656 * Send the text to be displayed above the options
658 * @param FormOptions $opts Unused
660 function setTopText( FormOptions
$opts ) {
663 $message = $this->msg( 'recentchangestext' )->inContentLanguage();
664 if ( !$message->isDisabled() ) {
665 $this->getOutput()->addWikiText(
666 Html
::rawElement( 'p',
667 array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ),
668 "\n" . $message->plain() . "\n"
670 /* $lineStart */ false,
671 /* $interface */ false
677 * Send the text to be displayed after the options, for use in subclasses.
679 * @param FormOptions $opts
681 function setBottomText( FormOptions
$opts ) {
685 * Creates the choose namespace selection
687 * @todo Uses radio buttons (HASHAR)
688 * @param FormOptions $opts
691 protected function namespaceFilterForm( FormOptions
$opts ) {
692 $nsSelect = Html
::namespaceSelector(
693 array( 'selected' => $opts['namespace'], 'all' => '' ),
694 array( 'name' => 'namespace', 'id' => 'namespace' )
696 $nsLabel = Xml
::label( $this->msg( 'namespace' )->text(), 'namespace' );
697 $invert = Xml
::checkLabel(
698 $this->msg( 'invert' )->text(), 'invert', 'nsinvert',
700 array( 'title' => $this->msg( 'tooltip-invert' )->text() )
702 $associated = Xml
::checkLabel(
703 $this->msg( 'namespace_association' )->text(), 'associated', 'nsassociated',
705 array( 'title' => $this->msg( 'tooltip-namespace_association' )->text() )
708 return array( $nsLabel, "$nsSelect $invert $associated" );
712 * Create a input to filter changes by categories
714 * @param FormOptions $opts
717 protected function categoryFilterForm( FormOptions
$opts ) {
718 list( $label, $input ) = Xml
::inputLabelSep( $this->msg( 'rc_categories' )->text(),
719 'categories', 'mw-categories', false, $opts['categories'] );
721 $input .= ' ' . Xml
::checkLabel( $this->msg( 'rc_categories_any' )->text(),
722 'categories_any', 'mw-categories_any', $opts['categories_any'] );
724 return array( $label, $input );
728 * Filter $rows by categories set in $opts
730 * @param array $rows Database rows
731 * @param FormOptions $opts
733 function filterByCategories( &$rows, FormOptions
$opts ) {
734 $categories = array_map( 'trim', explode( '|', $opts['categories'] ) );
736 if ( !count( $categories ) ) {
742 foreach ( $categories as $cat ) {
754 foreach ( $rows as $k => $r ) {
755 $nt = Title
::makeTitle( $r->rc_namespace
, $r->rc_title
);
756 $id = $nt->getArticleID();
758 continue; # Page might have been deleted...
760 if ( !in_array( $id, $articles ) ) {
763 if ( !isset( $a2r[$id] ) ) {
771 if ( !count( $articles ) ||
!count( $cats ) ) {
776 $c = new Categoryfinder
;
777 $c->seed( $articles, $cats, $opts['categories_any'] ?
'OR' : 'AND' );
782 foreach ( $match as $id ) {
783 foreach ( $a2r[$id] as $rev ) {
785 $newrows[$k] = $rowsarr[$k];
792 * Makes change an option link which carries all the other options
794 * @param string $title Title
795 * @param array $override Options to override
796 * @param array $options Current options
797 * @param bool $active Whether to show the link in bold
800 function makeOptionsLink( $title, $override, $options, $active = false ) {
801 $params = $override +
$options;
803 // Bug 36524: false values have be converted to "0" otherwise
804 // wfArrayToCgi() will omit it them.
805 foreach ( $params as &$value ) {
806 if ( $value === false ) {
812 $text = htmlspecialchars( $title );
814 $text = '<strong>' . $text . '</strong>';
817 return Linker
::linkKnown( $this->getTitle(), $text, array(), $params );
821 * Creates the options panel.
823 * @param array $defaults
824 * @param array $nondefaults
827 function optionsPanel( $defaults, $nondefaults ) {
828 global $wgRCLinkLimits, $wgRCLinkDays;
830 $options = $nondefaults +
$defaults;
833 $msg = $this->msg( 'rclegend' );
834 if ( !$msg->isDisabled() ) {
835 $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n";
838 $lang = $this->getLanguage();
839 $user = $this->getUser();
840 if ( $options['from'] ) {
841 $note .= $this->msg( 'rcnotefrom' )->numParams( $options['limit'] )->params(
842 $lang->userTimeAndDate( $options['from'], $user ),
843 $lang->userDate( $options['from'], $user ),
844 $lang->userTime( $options['from'], $user ) )->parse() . '<br />';
847 # Sort data for display and make sure it's unique after we've added user data.
848 $linkLimits = $wgRCLinkLimits;
849 $linkLimits[] = $options['limit'];
851 $linkLimits = array_unique( $linkLimits );
853 $linkDays = $wgRCLinkDays;
854 $linkDays[] = $options['days'];
856 $linkDays = array_unique( $linkDays );
860 foreach ( $linkLimits as $value ) {
861 $cl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
862 array( 'limit' => $value ), $nondefaults, $value == $options['limit'] );
864 $cl = $lang->pipeList( $cl );
866 // day links, reset 'from' to none
868 foreach ( $linkDays as $value ) {
869 $dl[] = $this->makeOptionsLink( $lang->formatNum( $value ),
870 array( 'days' => $value, 'from' => '' ), $nondefaults, $value == $options['days'] );
872 $dl = $lang->pipeList( $dl );
875 $showhide = array( $this->msg( 'show' )->text(), $this->msg( 'hide' )->text() );
877 'hideminor' => 'rcshowhideminor',
878 'hidebots' => 'rcshowhidebots',
879 'hideanons' => 'rcshowhideanons',
880 'hideliu' => 'rcshowhideliu',
881 'hidepatrolled' => 'rcshowhidepatr',
882 'hidemyself' => 'rcshowhidemine'
884 foreach ( $this->getCustomFilters() as $key => $params ) {
885 $filters[$key] = $params['msg'];
887 // Disable some if needed
888 if ( !$user->useRCPatrol() ) {
889 unset( $filters['hidepatrolled'] );
893 foreach ( $filters as $key => $msg ) {
894 $link = $this->makeOptionsLink( $showhide[1 - $options[$key]],
895 array( $key => 1 - $options[$key] ), $nondefaults );
896 $links[] = $this->msg( $msg )->rawParams( $link )->escaped();
899 // show from this onward link
900 $timestamp = wfTimestampNow();
901 $now = $lang->userTimeAndDate( $timestamp, $user );
902 $tl = $this->makeOptionsLink(
903 $now, array( 'from' => $timestamp ), $nondefaults
906 $rclinks = $this->msg( 'rclinks' )->rawParams( $cl, $dl, $lang->pipeList( $links ) )
908 $rclistfrom = $this->msg( 'rclistfrom' )->rawParams( $tl )->parse();
910 return "{$note}$rclinks<br />$rclistfrom";
914 * Add JavaScript to the page
916 function addRecentChangesJS() {
917 $this->getOutput()->addModules( array(
918 'mediawiki.special.recentchanges',
922 protected function getGroupName() {