mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
DatalistentryController: remove obsolete controller
This commit is contained in:
parent
4c44b46a82
commit
7760c0f62e
@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\Controllers;
|
||||
|
||||
use Icinga\Module\Director\Web\Controller\ActionController;
|
||||
|
||||
class DatalistentryController extends ActionController
|
||||
{
|
||||
public function addAction()
|
||||
{
|
||||
$this->indexAction();
|
||||
}
|
||||
|
||||
public function editAction()
|
||||
{
|
||||
$this->indexAction(true);
|
||||
}
|
||||
|
||||
public function indexAction($edit = false)
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$listId = $this->params->get('list_id');
|
||||
$this->view->lastId = $listId;
|
||||
|
||||
if ($this->params->get('list_id') && $entryName = $this->params->get('entry_name')) {
|
||||
$edit = true;
|
||||
}
|
||||
|
||||
if ($edit) {
|
||||
$this->view->title = $this->translate('Edit entry');
|
||||
$this->getTabs()->add('editentry', array(
|
||||
'url' => 'director/datalistentry/edit' . '?list_id=' . $listId . '&entry_name=' . $entryName,
|
||||
'label' => $this->view->title,
|
||||
))->activate('editentry');
|
||||
} else {
|
||||
$this->view->title = $this->translate('Add entry');
|
||||
$this->getTabs()->add('addlistentry', array(
|
||||
'url' => 'director/datalistentry/add' . '?list_id=' . $listId,
|
||||
'label' => $this->view->title,
|
||||
))->activate('addlistentry');
|
||||
}
|
||||
|
||||
$form = $this->view->form = $this->loadForm('directorDatalistentry')
|
||||
->setListId($listId)
|
||||
->setSuccessUrl('director/datalistentry' . '?list_id=' . $listId)
|
||||
->setDb($this->db());
|
||||
|
||||
if ($request->isPost()) {
|
||||
$listId = $request->getParam('list_id');
|
||||
$entryName = $request->getParam('entry_name');
|
||||
}
|
||||
|
||||
if ($edit) {
|
||||
$form->loadObject(array('list_id' => $listId, 'entry_name' => $entryName));
|
||||
if ($el = $form->getElement('entry_name')) {
|
||||
// TODO: Doesn't work without setup
|
||||
$el->setAttribs(array('readonly' => true));
|
||||
}
|
||||
}
|
||||
|
||||
$form->handleRequest();
|
||||
|
||||
$this->render('object/form', null, true);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user