diff --git a/application/views/scripts/object/show.phtml b/application/views/scripts/object/show.phtml index bc20c9f4..01848a4d 100644 --- a/application/views/scripts/object/show.phtml +++ b/application/views/scripts/object/show.phtml @@ -7,7 +7,7 @@
-disabled === 'y'): ?> +isDisabled): ?>

translate('This object will not be deployed as it has been disabled') ?>

isExternal): ?> diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index be4ff13f..6954c385 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -1123,7 +1123,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer public function renderToConfig(IcingaConfig $config) { - if ($this->isDisabled() || $this->isExternal()) { + if ($this->isExternal()) { return; } @@ -1373,7 +1373,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer public function toConfigString() { - return implode(array( + $str = implode(array( $this->renderObjectHeader(), $this->renderImports(), $this->renderProperties(), @@ -1387,6 +1387,13 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer $this->renderAssignments(), $this->renderSuffix() )); + + if ($this->isDisabled()) { + return "// --- This object has been disabled ---\n// \n// " + . str_replace("\n", "\n// ", $str); + } else { + return $str; + } } public function isGroup()