@@ -36,7 +36,7 @@ public static function getByArray(array $item, ?int $parentId, int $articleId):
36
36
{
37
37
$ active = false ;
38
38
if ($ item ['type ' ] === 'intern ' ) {
39
- $ navItem = static ::getByArticleId ($ item ['id ' ], $ articleId );
39
+ $ navItem = static ::getByArticleId ($ item ['id ' ], $ articleId, false );
40
40
$ url = $ navItem ->getUrl ();
41
41
$ active = $ navItem ->isActive ();
42
42
$ id = $ item ['id ' ];
@@ -93,17 +93,17 @@ public function getArticle(): ?Article
93
93
}
94
94
95
95
96
- public static function getByArticleId (int $ id , int $ currentId ): ?self
96
+ public static function getByArticleId (int $ id , int $ currentId, bool $ verifyVisibility = true ): ?self
97
97
{
98
98
$ article = rex_article::get ($ id );
99
99
100
100
if ($ article instanceof rex_article) {
101
- return static ::getByArticle ($ article , $ currentId );
101
+ return static ::getByArticle ($ article , $ currentId, $ verifyVisibility );
102
102
}
103
103
throw new \Exception ("Article with id $ id not found " );
104
104
}
105
105
106
- public static function getByArticle (rex_article $ article , ?int $ currentId ): ?self
106
+ public static function getByArticle (rex_article $ article , ?int $ currentId, bool $ verifyVisibility = true ): ?self
107
107
{
108
108
$ id = $ article ->getId ();
109
109
$ label = $ article ->getName ();
@@ -124,6 +124,7 @@ public static function getByArticle(rex_article $article, ?int $currentId): ?sel
124
124
new \rex_extension_point ('GRAPHQL_PARSE_ARTICLE_NAVIGATION_ITEM ' , $ self , [
125
125
'article ' => $ article ,
126
126
'currentId ' => $ currentId ,
127
+ 'verifyVisibility ' => $ verifyVisibility ,
127
128
])
128
129
);
129
130
}
0 commit comments