Add outstanding item count for article category pages
authorJoshua Rüsweg <josh@bastelstu.be>
Wed, 29 Aug 2018 14:48:09 +0000 (16:48 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Wed, 29 Aug 2018 14:48:09 +0000 (16:48 +0200)
See #2648

wcfsetup/install/files/lib/system/page/handler/CategoryArticleListPageHandler.class.php

index 443dc4eff6549ea756166e875e7c5cfc144ee6d9..881178dce78e50b3a392c5e50c3785ebcf2d2c39 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\page\handler;
 use wcf\data\article\category\ArticleCategory;
+use wcf\data\article\ViewableArticle;
 
 /**
  * Menu page handler for the category article list page.
@@ -20,4 +21,12 @@ class CategoryArticleListPageHandler extends AbstractLookupPageHandler implement
        protected function getDecoratedCategoryClass() {
                return ArticleCategory::class;
        }
+       
+       /**
+        * @inheritDoc
+        * @since       3.2
+        */
+       public function getOutstandingItemCount($objectID = null) {
+               return ARTICLE_ENABLE_VISIT_TRACKING ? ViewableArticle::getUnreadArticlesForCategory($objectID) : 0;
+       }
 }