diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index e95f14c88..bca1e17d1 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -117,13 +117,18 @@ class Menu implements RecursiveIterator foreach ($props as $key => $value) { $method = 'set' . implode('', array_map('ucfirst', explode('_', strtolower($key)))); if ($key === 'renderer') { - $class = '\Icinga\Web\Menu\\' . $value; - if (!class_exists($class)) { - throw new ConfigurationError( - sprintf('ItemRenderer with class "%s" does not exist', $class) - ); + $value = '\\' . ltrim($value, '\\'); + if (class_exists($value)) { + $value = new $value; + } else { + $class = '\Icinga\Web\Menu' . $value; + if (!class_exists($class)) { + throw new ConfigurationError( + sprintf('ItemRenderer with class "%s" does not exist', $class) + ); + } + $value = new $class; } - $value = new $class; } if (method_exists($this, $method)) { $this->{$method}($value); diff --git a/modules/monitoring/configuration.php b/modules/monitoring/configuration.php index 05fa86148..a7f8047c4 100644 --- a/modules/monitoring/configuration.php +++ b/modules/monitoring/configuration.php @@ -94,17 +94,17 @@ $this->provideSearchUrl($this->translate('Servicegroups'), 'monitoring/list/serv * Problems Section */ $section = $this->menuSection($this->translate('Problems'), array( - 'renderer' => 'ProblemMenuItemRenderer', + 'renderer' => 'Icinga\Module\Monitoring\Web\Menu\ProblemMenuItemRenderer', 'icon' => 'block', 'priority' => 20 )); $section->add($this->translate('Unhandled Hosts'), array( - 'renderer' => 'UnhandledHostMenuItemRenderer', + 'renderer' => 'Icinga\Module\Monitoring\Web\Menu\UnhandledHostMenuItemRenderer', 'url' => 'monitoring/list/hosts?host_problem=1&host_handled=0', 'priority' => 30 )); $section->add($this->translate('Unhandled Services'), array( - 'renderer' => 'UnhandledServiceMenuItemRenderer', + 'renderer' => 'Icinga\Module\Monitoring\Web\Menu\UnhandledServiceMenuItemRenderer', 'url' => 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity', 'priority' => 40 )); diff --git a/library/Icinga/Web/Menu/MonitoringMenuItemRenderer.php b/modules/monitoring/library/Monitoring/Web/Menu/MonitoringMenuItemRenderer.php similarity index 96% rename from library/Icinga/Web/Menu/MonitoringMenuItemRenderer.php rename to modules/monitoring/library/Monitoring/Web/Menu/MonitoringMenuItemRenderer.php index 33e1c6a60..7df80e034 100644 --- a/library/Icinga/Web/Menu/MonitoringMenuItemRenderer.php +++ b/modules/monitoring/library/Monitoring/Web/Menu/MonitoringMenuItemRenderer.php @@ -1,10 +1,11 @@