Only show article list menu item if user can access any catgory
authorMatthias Schmidt <gravatronics@live.com>
Sun, 7 Jul 2019 12:04:14 +0000 (14:04 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 7 Jul 2019 12:04:24 +0000 (14:04 +0200)
Close #2960

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

index 6240d4713710b27a5d089b48c921898816bc9d0a..aef47baae307a8fc6b127d1dba14f5c400dd5070 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\page\handler;
+use wcf\data\article\category\ArticleCategory;
 use wcf\data\article\ViewableArticle;
 
 /**
@@ -19,4 +20,13 @@ class ArticleListPageHandler extends AbstractMenuPageHandler {
        public function getOutstandingItemCount(/** @noinspection PhpUnusedParameterInspection */$objectID = null) {
                return ARTICLE_ENABLE_VISIT_TRACKING ? ViewableArticle::getUnreadArticles() : 0;
        }
+       
+       /** @noinspection PhpMissingParentCallCommonInspection */
+       /**
+        * @inheritDoc
+        * @since       5.2
+        */
+       public function isVisible($objectID = null) {
+               return !empty(ArticleCategory::getAccessibleCategoryIDs());
+       }
 }