Skip to content

Commit bd9d1ba

Browse files
committed
navigation hiding verification parameter added
1 parent ec832f2 commit bd9d1ba

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/Type/Navigation/NavigationItem.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function getByArray(array $item, ?int $parentId, int $articleId):
3636
{
3737
$active = false;
3838
if ($item['type'] === 'intern') {
39-
$navItem = static::getByArticleId($item['id'], $articleId);
39+
$navItem = static::getByArticleId($item['id'], $articleId, false);
4040
$url = $navItem->getUrl();
4141
$active = $navItem->isActive();
4242
$id = $item['id'];
@@ -93,17 +93,17 @@ public function getArticle(): ?Article
9393
}
9494

9595

96-
public static function getByArticleId(int $id, int $currentId): ?self
96+
public static function getByArticleId(int $id, int $currentId, bool $verifyVisibility = true): ?self
9797
{
9898
$article = rex_article::get($id);
9999

100100
if ($article instanceof rex_article) {
101-
return static::getByArticle($article, $currentId);
101+
return static::getByArticle($article, $currentId, $verifyVisibility);
102102
}
103103
throw new \Exception("Article with id $id not found");
104104
}
105105

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
107107
{
108108
$id = $article->getId();
109109
$label = $article->getName();
@@ -124,6 +124,7 @@ public static function getByArticle(rex_article $article, ?int $currentId): ?sel
124124
new \rex_extension_point('GRAPHQL_PARSE_ARTICLE_NAVIGATION_ITEM', $self, [
125125
'article' => $article,
126126
'currentId' => $currentId,
127+
'verifyVisibility' => $verifyVisibility,
127128
])
128129
);
129130
}

0 commit comments

Comments
 (0)