public function getDefaultOptions() {
$opts = parent::getDefaultOptions();
$user = $this->getUser();
- $config = $this->getConfig();
$opts->add( 'days', $user->getIntOption( 'rcdays' ) );
$opts->add( 'limit', $user->getIntOption( 'rclimit' ) );
$list = ChangesList::newFromContext( $this->getContext() );
$list->initChangesListRows( $rows );
+ $userShowHiddenCats = $this->getUser()->getBoolOption( 'showhiddencats' );
$rclistOutput = $list->beginRecentChangesList();
foreach ( $rows as $obj ) {
if ( $limit == 0 ) {
break;
}
$rc = RecentChange::newFromRow( $obj );
+
+ # Skip CatWatch entries for hidden cats based on user preference
+ if (
+ $rc->getAttribute( 'rc_type' ) == RC_CATEGORIZE &&
+ !$userShowHiddenCats &&
+ $rc->getParam( 'hidden-cat' )
+ ) {
+ continue;
+ }
+
$rc->counter = $counter++;
# Check if the page has been updated since the last visit
if ( $this->getConfig()->get( 'ShowUpdatedMarker' )
if ( $showWatcherCount && $obj->rc_namespace >= 0 ) {
if ( !isset( $watcherCache[$obj->rc_namespace][$obj->rc_title] ) ) {
$watcherCache[$obj->rc_namespace][$obj->rc_title] =
- $dbr->selectField(
- 'watchlist',
- 'COUNT(*)',
- [
- 'wl_namespace' => $obj->rc_namespace,
- 'wl_title' => $obj->rc_title,
- ],
- __METHOD__ . '-watchers'
+ WatchedItemStore::getDefaultInstance()->countWatchers(
+ new TitleValue( (int)$obj->rc_namespace, $obj->rc_title )
);
}
$rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
$rclistOutput .= $list->endRecentChangesList();
if ( $rows->numRows() === 0 ) {
- $this->getOutput()->addHtml(
+ $this->getOutput()->addHTML(
'<div class="mw-changeslist-empty">' .
$this->msg( 'recentchanges-noresult' )->parse() .
'</div>'
$extraOpts = $this->getExtraOptions( $opts );
$extraOptsCount = count( $extraOpts );
$count = 0;
- $submit = ' ' . Xml::submitbutton( $this->msg( 'recentchanges-submit' )->text() );
+ $submit = ' ' . Xml::submitButton( $this->msg( 'recentchanges-submit' )->text() );
$out = Xml::openElement( 'table', [ 'class' => 'mw-recentchanges-table' ] );
foreach ( $extraOpts as $name => $optionRow ) {