From a9461ada54cb0485f11c8a1328f7b28202536a78 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 28 Nov 2016 14:56:17 +0100 Subject: [PATCH] Only render a menu item when it's not empty A menu item is not empty when it either has children or a defined URL. --- library/Icinga/Web/Navigation/NavigationItem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Navigation/NavigationItem.php b/library/Icinga/Web/Navigation/NavigationItem.php index 0f31a4209..12979bd75 100644 --- a/library/Icinga/Web/Navigation/NavigationItem.php +++ b/library/Icinga/Web/Navigation/NavigationItem.php @@ -340,7 +340,7 @@ class NavigationItem implements IteratorAggregate */ public function hasChildren() { - return !$this->getChildren()->isEmpty(); + return ! $this->getChildren()->isEmpty(); } /** @@ -791,7 +791,7 @@ class NavigationItem implements IteratorAggregate public function getRender() { if ($this->render === null) { - return true; + return $this->getUrl() !== null; } return $this->render;