Signed-off-by: Joas Schilling <coding@schilljs.com>
*/
private function isNavigationItem($data): bool {
// Allow settings navigation items with no route entry
- if ($data['type'] === 'settings') {
+ $type = $data['type'] ?? 'link';
+ if ($type === 'settings') {
return isset($data['name']);
}
return isset($data['name'], $data['route']);
if (!isset($nav['name'])) {
continue;
}
- if (!isset($nav['route'])) {
- // Allow settings navigation items with no route entry, all other types require one
- if ($nav['type'] !== 'settings') {
- continue;
- }
+ // Allow settings navigation items with no route entry, all other types require one
+ if (!isset($nav['route']) && $nav['type'] !== 'settings') {
+ continue;
}
$role = isset($nav['@attributes']['role']) ? $nav['@attributes']['role'] : 'all';
if ($role === 'admin' && !$this->isAdmin()) {