DataList: Add edit and add methods

This commit is contained in:
Alexander Fuhr 2015-07-03 14:20:13 +02:00
parent cfbe065b86
commit a594116fe5
2 changed files with 13 additions and 2 deletions

View File

@ -4,11 +4,21 @@ use Icinga\Module\Director\Web\Controller\ActionController;
class Director_DatalistController extends ActionController
{
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(
'url' => 'director/data/addlist',
'url' => 'director/datalist/add',
'label' => $this->view->title,
))->activate('addlist');
@ -19,6 +29,7 @@ class Director_DatalistController extends ActionController
if ($id = $this->params->get('id')) {
$form->loadObject($id);
}
$form->handleRequest();
$this->render('object/form', null, true);

View File

@ -17,7 +17,7 @@ class DatalistTable extends QuickTable
protected function getActionUrl($row)
{
return $this->url('director/datalist', array('id' => $row->id));
return $this->url('director/datalist/edit', array('id' => $row->id));
}
public function getTitles()