Command templates and more
This commit is contained in:
parent
9946bed438
commit
b90c93ebdc
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Icinga\Module\Director\Web\Controller\ObjectsController;
|
||||
|
||||
class Director_CommandtemplatesController extends ObjectsController
|
||||
{
|
||||
}
|
|
@ -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>
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue