Force absolute nampesace for module menu item renderer

refs #7642
This commit is contained in:
Alexander Fuhr 2015-04-20 13:21:37 +02:00
parent c43947d666
commit 7bc07c4368
1 changed files with 2 additions and 1 deletions

View File

@ -117,10 +117,11 @@ class Menu implements RecursiveIterator
foreach ($props as $key => $value) {
$method = 'set' . implode('', array_map('ucfirst', explode('_', strtolower($key))));
if ($key === 'renderer') {
$value = '\\' . ltrim($value, '\\');
if (class_exists($value)) {
$value = new $value;
} else {
$class = '\Icinga\Web\Menu\\' . $value;
$class = '\Icinga\Web\Menu' . $value;
if (!class_exists($class)) {
throw new ConfigurationError(
sprintf('ItemRenderer with class "%s" does not exist', $class)