mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-19 03:44:30 +02:00
55 lines
1.7 KiB
PHP
55 lines
1.7 KiB
PHP
<?php
|
|
|
|
use Icinga\Module\Director\ActionController;
|
|
|
|
class Director_ObjectController extends ActionController
|
|
{
|
|
public function hostAction()
|
|
{
|
|
$this->view->form = $this->loadForm('icingaHost')
|
|
->setDb($this->db())
|
|
->setSuccessUrl('director/list/hosts');
|
|
|
|
if ($id = $this->params->get('id')) {
|
|
$this->view->form->loadObject($id);
|
|
$this->view->title = $this->translate('Modify Icinga Host');
|
|
} else {
|
|
$this->view->title = $this->translate('Add new Icinga Host');
|
|
}
|
|
$this->view->form->handleRequest();
|
|
$this->render('form');
|
|
}
|
|
|
|
public function commandAction()
|
|
{
|
|
$this->view->form = $this->loadForm('icingaCommand')
|
|
->setDb($this->db())
|
|
->setSuccessUrl('director/list/commands');
|
|
|
|
if ($id = $this->params->get('id')) {
|
|
$this->view->form->loadObject($id);
|
|
$this->view->title = $this->translate('Modify Icinga Command');
|
|
} else {
|
|
$this->view->title = $this->translate('Add new Icinga Command');
|
|
}
|
|
$this->view->form->handleRequest();
|
|
$this->render('form');
|
|
}
|
|
|
|
public function zoneAction()
|
|
{
|
|
$this->view->form = $this->loadForm('icingaZone')
|
|
->setDb($this->db())
|
|
->setSuccessUrl('director/list/zones');
|
|
|
|
if ($id = $this->params->get('id')) {
|
|
$this->view->title = $this->translate('Modify Icinga Zone');
|
|
$this->view->form->loadObject($id);
|
|
} else {
|
|
$this->view->title = $this->translate('Add new Icinga Zone');
|
|
}
|
|
$this->view->form->handleRequest();
|
|
$this->render('form');
|
|
}
|
|
}
|