icingaweb2-module-director/application/controllers/DatalistController.php

38 lines
959 B
PHP
Raw Normal View History

<?php
use Icinga\Module\Director\Web\Controller\ActionController;
class Director_DatalistController extends ActionController
{
2015-07-03 14:20:13 +02:00
public function addAction()
{
$this->forward('index', 'datalist', 'director');
}
public function editAction()
{
$this->forward('index', 'datalist', 'director');
}
public function indexAction()
{
$this->view->title = $this->translate('Add list');
$this->getTabs()->add('addlist', array(
2015-07-03 14:20:13 +02:00
'url' => 'director/datalist/add',
'label' => $this->view->title,
))->activate('addlist');
$form = $this->view->form = $this->loadForm('directorDatalist')
->setSuccessUrl('director/list/datalist')
->setDb($this->db());
if ($id = $this->params->get('id')) {
$form->loadObject($id);
}
2015-07-03 14:20:13 +02:00
$form->handleRequest();
$this->render('object/form', null, true);
}
}