diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php
index e5e5ce30..d192e7ce 100644
--- a/application/controllers/ConfigController.php
+++ b/application/controllers/ConfigController.php
@@ -4,6 +4,7 @@ use Icinga\Module\Director\ActionController;
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
use Icinga\Module\Director\Util;
+use Icinga\Web\Url;
class Director_ConfigController extends ActionController
{
@@ -14,8 +15,10 @@ class Director_ConfigController extends ActionController
public function storeAction()
{
- /** @var IcingaConfig $config */
$config = IcingaConfig::generate($this->db());
- $this->view->id = $config->getHexChecksum();
+ $this->redirectNow(
+ Url::fromPath('director/config/show',
+ array('checksum' => $config->getHexChecksum()))
+ );
}
}
diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php
index 7ce29afc..b8b7223f 100644
--- a/application/controllers/ListController.php
+++ b/application/controllers/ListController.php
@@ -182,6 +182,7 @@ class Director_ListController extends ActionController
public function activitylogAction()
{
+ $this->setConfigTabs()->activate('activitylog');
$this->view->title = $this->translate('Activity Log');
$this->view->table = $this->loadTable('activityLog')->setConnection($this->db());
$this->render('table');
@@ -189,6 +190,12 @@ class Director_ListController extends ActionController
public function generatedconfigAction()
{
+ $this->view->addLink = $this->view->qlink(
+ $this->translate('Generate'),
+ 'director/config/store'
+ );
+
+ $this->setConfigTabs()->activate('generatedconfig');
$this->view->title = $this->translate('Generated Configs');
$this->view->table = $this->loadTable('generatedConfig')->setConnection($this->db());
$this->render('table');
diff --git a/application/views/scripts/list/table.phtml b/application/views/scripts/list/table.phtml
index 1ad5c254..a0ca6479 100644
--- a/application/views/scripts/list/table.phtml
+++ b/application/views/scripts/list/table.phtml
@@ -1,6 +1,9 @@
-
+
+= $this->tabs ?>
= $this->escape($this->title) ?>
+
= $this->addLink ?>
+
diff --git a/configuration.php b/configuration.php
index 8406cccf..79b32d93 100644
--- a/configuration.php
+++ b/configuration.php
@@ -1,5 +1,8 @@
providePermission('director/templates', 'Allow to modify templates');
+
$section = $this->menuSection($this->translate('Icinga Director'));
$section->setIcon('cubes');
@@ -39,12 +42,7 @@ $section->add($this->translate('Endpoints'))
->setUrl('director/list/endpoints');
// INTERNAL
-$section->add($this->translate('Activity Log'))
- ->setUrl('director/list/activitylog')
- ->setPriority(900);
-$section->add($this->translate('Show configs'))
+$section->add($this->translate('Config'))
->setUrl('director/list/generatedconfig')
->setPriority(902);
-$section->add($this->translate('Store config'))
- ->setUrl('director/config/store')
- ->setPriority(902);
+
diff --git a/library/Director/ActionController.php b/library/Director/ActionController.php
index 95f3871f..323ea5ae 100644
--- a/library/Director/ActionController.php
+++ b/library/Director/ActionController.php
@@ -33,6 +33,18 @@ abstract class ActionController extends Controller
return TableLoader::load($name, $this->Module());
}
+ protected function setConfigTabs()
+ {
+ $this->view->tabs = Widget::create('tabs')->add('generatedconfig', array(
+ 'label' => $this->translate('Configs'),
+ 'url' => 'director/list/generatedconfig')
+ )->add('activitylog', array(
+ 'label' => $this->translate('Activity Log'),
+ 'url' => 'director/list/activitylog')
+ );
+ return $this->view->tabs;
+ }
+
protected function setIcingaTabs()
{
$this->view->tabs = Widget::create('tabs')->add('services', array(
diff --git a/schema/mysql-changes/upgrade_13.sql b/schema/mysql-changes/upgrade_13.sql
index a6d01384..96b0aad1 100644
--- a/schema/mysql-changes/upgrade_13.sql
+++ b/schema/mysql-changes/upgrade_13.sql
@@ -14,4 +14,5 @@ CREATE TABLE icinga_user_inheritance (
REFERENCES icinga_user (id)
ON DELETE RESTRICT
ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
diff --git a/schema/mysql-changes/upgrade_14.sql b/schema/mysql-changes/upgrade_14.sql
index 83fdc63c..506f7793 100644
--- a/schema/mysql-changes/upgrade_14.sql
+++ b/schema/mysql-changes/upgrade_14.sql
@@ -14,4 +14,5 @@ CREATE TABLE icinga_timeperiod_inheritance (
REFERENCES icinga_timeperiod (id)
ON DELETE RESTRICT
ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+