X-Git-Url: http://git.cyclocoop.org/fichier?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRecentchanges.php;h=b6398cb567959c56de0abf2006104d897ac9a398;hb=6f5751aa3a3a2ec981d7aebd45791a18dbd8b4e3;hp=7be95fa84221184824d97185e35ba469033fb971;hpb=734ca2b4d2a1246fb0ea1e54b861ab423ab5e257;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 7be95fa842..b6398cb567 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -21,6 +21,8 @@ * @ingroup SpecialPage */ +use MediaWiki\MediaWikiServices; + /** * A special page that lists last changes made to the wiki * @@ -324,12 +326,23 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $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' ) @@ -344,14 +357,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage { 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' + MediaWikiServices::getInstance()->getWatchedItemStore()->countWatchers( + new TitleValue( (int)$obj->rc_namespace, $obj->rc_title ) ); } $rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title]; @@ -366,7 +373,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $rclistOutput .= $list->endRecentChangesList(); if ( $rows->numRows() === 0 ) { - $this->getOutput()->addHtml( + $this->getOutput()->addHTML( '
' . $this->msg( 'recentchanges-noresult' )->parse() . '
' @@ -399,7 +406,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { $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 ) {