Command templates and more

This commit is contained in:
Thomas Gelf 2015-08-03 13:42:19 +02:00
parent 9946bed438
commit b90c93ebdc
4 changed files with 52 additions and 3 deletions

View File

@ -2,6 +2,40 @@
use Icinga\Module\Director\Web\Controller\ObjectController;
use Icinga\Data\Filter\Filter;
class Director_CommandController extends ObjectController
{
public function init()
{
parent::init();
if ($this->object) {
$this->getTabs()->add('arguments', array(
'url' => 'director/command/arguments',
'urlParams' => array('name' => $this->object->object_name),
'label' => 'Arguments'
));
}
}
public function argumentsAction()
{
$this->getTabs()->activate('arguments');
$this->view->title = $this->translate('Command arguments');
$this->view->table = $this
->loadTable('icingaCommandArgument')
->setCommandObject($this->object)
->setFilter(Filter::where('command', $this->params->get('name')));
$form = $this->view->form = $this
->loadForm('icingaCommandArgument')
->setCommandObject($this->object);
if ($id = $this->params->shift('argument_id')) {
$form->loadObject($id);
}
$form->handleRequest();
}
}

View File

@ -0,0 +1,7 @@
<?php
use Icinga\Module\Director\Web\Controller\ObjectsController;
class Director_CommandtemplatesController extends ObjectsController
{
}

View File

@ -0,0 +1,11 @@
<div class="controls">
<?= $this->tabs ?>
<h1><?= $this->escape($this->title) ?></h1>
<span data-base-target="_next">
<?= $this->addLink ?>
</div>
<div class="content">
<?= $this->form ?>
<?= $this->table->render() ?>
</div>

View File

@ -7,8 +7,6 @@ abstract class ObjectsController extends ActionController
protected $dummy;
protected $globalTypes = array(
'Command',
'CommandArgument',
'TimePeriod',
'Zone',
'Endpoint'
@ -34,7 +32,6 @@ abstract class ObjectsController extends ActionController
return;
}
$object = $this->dummyObject();
if ($object->isGroup()) {
$type = substr($type, 0, -5);