diff --git a/library/Icinga/Web/Widget/Dashboard/Component.php b/library/Icinga/Web/Widget/Dashboard/Component.php index 87f756282..7410c6210 100644 --- a/library/Icinga/Web/Widget/Dashboard/Component.php +++ b/library/Icinga/Web/Widget/Dashboard/Component.php @@ -42,6 +42,13 @@ class Component extends AbstractWidget */ private $pane; + /** + * The disabled option is used to "delete" default dashlets provided by modules + * + * @var bool + */ + private $disabled = false; + /** * The template string used for rendering this widget * @@ -117,6 +124,26 @@ EOD; return $this; } + /** + * Set the disabled property + * + * @param boolean $disabled + */ + public function setDisabled($disabled) + { + $this->disabled = $disabled; + } + + /** + * Get the disabled property + * + * @return boolean + */ + public function getDisabled() + { + return $this->disabled; + } + /** * Return this component's structure as array * @@ -136,6 +163,10 @@ EOD; */ public function render() { + if ($this->disabled === true) { + return ''; + } + $view = $this->view(); $url = clone($this->url); $url->setParam('view', 'compact');