Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/make-all-views-dashboard-compliant-…
Browse files Browse the repository at this point in the history
…7876
  • Loading branch information
Johannes Meyer committed Apr 20, 2015
2 parents b68fd93 + e812bed commit da7aa23
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 23 deletions.
17 changes: 11 additions & 6 deletions library/Icinga/Web/Menu.php
Expand Up @@ -117,13 +117,18 @@ public function setProperties($props = null)
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);
Expand Down
Expand Up @@ -50,8 +50,7 @@ foreach ($serviceDescriptions as $service_description): ?>
'service_description' => $service_description
),
array(
'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description),
'data-tooltip-gravity' => 's'
'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description)
),
false
); ?>
Expand Down
6 changes: 3 additions & 3 deletions modules/monitoring/configuration.php
Expand Up @@ -94,17 +94,17 @@
* 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
));
Expand Down
@@ -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 {
Expand Down
@@ -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
{
Expand Down
@@ -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
{
Expand Down
@@ -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
{
Expand Down
16 changes: 13 additions & 3 deletions public/js/icinga/behavior/tooltip.js
Expand Up @@ -31,15 +31,25 @@
$('i[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 });
$('[title]', el).each(function (i, el) {
var $el = $(el);
var delay = 500;
var delay, gravity;
if ($el.data('tooltip-delay') !== undefined) {
delay = $el.data('tooltip-delay');
}
var gravity = $.fn.tipsy.autoNS;
if ($el.data('tooltip-gravity')) {
gravity = $el.data('tooltip-gravity');
}
$el.tipsy({ gravity: gravity, delayIn: delay });
if (delay === undefined &&
gravity === undefined &&
!$el.data('title-rich')) {
// use native tooltips for everything that doesn't
// require specific behavior or html markup
return;
}
delay = delay === undefined ? 500 : delay;
$el.tipsy({
gravity: gravity || $.fn.tipsy.autoNS,
delayIn: delay
});
});

// migrate or remove all orphaned tooltips
Expand Down

0 comments on commit da7aa23

Please sign in to comment.