mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
CommandArguments: no more view script
This commit is contained in:
parent
126dd29ecc
commit
b390dd152e
@ -10,36 +10,35 @@ class CommandController extends ObjectController
|
|||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
parent::init();
|
parent::init();
|
||||||
if ($this->object && ! $this->object->isExternal()) {
|
$o = $this->object;
|
||||||
$this->getTabs()->add('arguments', array(
|
if ($o && ! $o->isExternal()) {
|
||||||
|
$this->tabs()->add('arguments', [
|
||||||
'url' => 'director/command/arguments',
|
'url' => 'director/command/arguments',
|
||||||
'urlParams' => array('name' => $this->object->object_name),
|
'urlParams' => ['name' => $o->getObjectName()],
|
||||||
'label' => 'Arguments'
|
'label' => 'Arguments'
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function argumentsAction()
|
public function argumentsAction()
|
||||||
{
|
{
|
||||||
$this->gracefullyActivateTab('arguments');
|
$p = $this->params;
|
||||||
$this->view->title = sprintf(
|
$o = $this->object;
|
||||||
$this->translate('Command arguments: %s'),
|
$this->tabs()->activate('arguments');
|
||||||
$this->object->object_name
|
$this->setTitle($this->translate('Command arguments: %s'), $o->getObjectName());
|
||||||
);
|
|
||||||
|
|
||||||
$this->view->table = $this
|
/** @var \Icinga\Module\Director\Forms\IcingaCommandArgumentForm $form */
|
||||||
->loadTable('icingaCommandArgument')
|
$form = $this->loadForm('icingaCommandArgument')->setCommandObject($o);
|
||||||
->setCommandObject($this->object)
|
if ($id = $p->shift('argument_id')) {
|
||||||
->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->loadObject($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$form->handleRequest();
|
$form->handleRequest();
|
||||||
|
|
||||||
|
$filter = Filter::where('command', $p->get('name'));
|
||||||
|
$table = $this->loadTable('icingaCommandArgument')
|
||||||
|
->setCommandObject($o)
|
||||||
|
->setFilter($filter);
|
||||||
|
|
||||||
|
$this->content()->add([$form, $table]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,9 @@ namespace Icinga\Module\Director\Tables;
|
|||||||
|
|
||||||
use Icinga\Module\Director\Objects\IcingaCommand;
|
use Icinga\Module\Director\Objects\IcingaCommand;
|
||||||
use Icinga\Module\Director\Web\Table\QuickTable;
|
use Icinga\Module\Director\Web\Table\QuickTable;
|
||||||
|
use ipl\Html\ValidHtml;
|
||||||
|
|
||||||
class IcingaCommandArgumentTable extends QuickTable
|
class IcingaCommandArgumentTable extends QuickTable implements ValidHtml
|
||||||
{
|
{
|
||||||
protected $commandObject;
|
protected $commandObject;
|
||||||
|
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
<div class="controls">
|
|
||||||
<?= $this->tabs ?>
|
|
||||||
<h1><?= $this->escape($this->title) ?></h1>
|
|
||||||
<span class="action-links" data-base-target="_next">
|
|
||||||
<?= $this->addLink ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<?= $this->form ?>
|
|
||||||
<?= $this->table->render() ?>
|
|
||||||
</div>
|
|
Loading…
x
Reference in New Issue
Block a user