Merge branch 'bugfix/move-monitoring-menu-renderers-7642'

fixes #7642
This commit is contained in:
Alexander Fuhr 2015-04-20 13:22:55 +02:00
commit e812bed241
6 changed files with 20 additions and 18 deletions

View File

@ -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);

View File

@ -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
));

View File

@ -1,10 +1,11 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Menu;
namespace Icinga\Module\Monitoring\Web\Menu;
use Icinga\Web\Menu as Menu;
use Icinga\Module\Monitoring\Backend\MonitoringBackend;
use Icinga\Web\Menu;
use Icinga\Web\Menu\MenuItemRenderer;
use Icinga\Web\Url;
class MonitoringMenuItemRenderer implements MenuItemRenderer {

View File

@ -1,7 +1,7 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Menu;
namespace Icinga\Module\Monitoring\Web\Menu;
class ProblemMenuItemRenderer extends MonitoringMenuItemRenderer
{

View File

@ -1,9 +1,7 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Menu;
use Icinga\Web\Menu;
namespace Icinga\Module\Monitoring\Web\Menu;
class UnhandledHostMenuItemRenderer extends MonitoringMenuItemRenderer
{

View File

@ -1,9 +1,7 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Menu;
use Icinga\Web\Menu;
namespace Icinga\Module\Monitoring\Web\Menu;
class UnhandledServiceMenuItemRenderer extends MonitoringMenuItemRenderer
{