Skip to content

Commit

Permalink
monitoring/show: use global hasPreviews check once
Browse files Browse the repository at this point in the history
refs #6932
  • Loading branch information
Thomas-Gelf committed Sep 4, 2014
1 parent f91892c commit 05a64ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/monitoring/application/controllers/ShowController.php
Expand Up @@ -48,6 +48,9 @@ public function init()
}
if (Hook::has('grapher')) {
$this->grapher = Hook::first('grapher');
if (! $this->grapher->hasPreviews()) {
$this->grapher = null;
}
}

$this->createTabs();
Expand All @@ -64,7 +67,7 @@ public function serviceAction()
. ' on ' . $o->host_name;
$this->getTabs()->activate('service');
$o->populate();
if ($this->grapher && $this->grapher->hasPreviews($o)) {
if ($this->grapher) {
$this->view->grapherHtml = $this->grapher->getPreviewHtml($o);
}
}
Expand All @@ -79,7 +82,7 @@ public function hostAction()
$this->getTabs()->activate('host');
$this->view->title = $o->host_name;
$o->populate();
if ($this->grapher && $this->grapher->hasPreviews($o)) {
if ($this->grapher) {
$this->view->grapherHtml = $this->grapher->getPreviewHtml($o);
}
}
Expand Down

0 comments on commit 05a64ce

Please sign in to comment.