show/activitylog: prepare diff object

This commit is contained in:
Thomas Gelf 2015-09-14 16:26:51 +02:00
parent 7bc59c010e
commit 02d0ea0cb7
1 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,7 @@
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
use Icinga\Module\Director\Objects\IcingaObject;
use Icinga\Module\Director\ConfigDiff;
use Icinga\Module\Director\Util;
use Icinga\Module\Director\Web\Controller\ActionController;
@ -30,6 +31,14 @@ class Director_ShowController extends ActionController
$new = $this->createObject($entry->object_type, $entry->new_properties);
}
if ($old && $new) {
$d = ConfigDiff::create($old, $new);
$this->view->diff = strtr(
$d->renderHtml(),
array('\\n' => "\\n\n")
);
}
$this->view->entry = $entry;
$this->view->newObject = $new;
$this->view->oldObject = $old;