mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 14:24:41 +02:00
Adjust createbackend-action to suit the new backend form interface
refs #5525
This commit is contained in:
parent
02c3223a82
commit
a78d11345b
@ -84,22 +84,21 @@ class Monitoring_ConfigController extends ModuleActionController
|
|||||||
*/
|
*/
|
||||||
public function createbackendAction()
|
public function createbackendAction()
|
||||||
{
|
{
|
||||||
$form = new CreateBackendForm();
|
$form = new BackendForm();
|
||||||
$form->setRequest($this->getRequest());
|
$request = $this->getRequest();
|
||||||
if ($form->isSubmittedAndValid()) {
|
if ($request->isPost() && $form->isValid($request->getPost())) {
|
||||||
$configArray = $this->Config('backends')->toArray();
|
list($name, $config) = $form->getBackendConfig();
|
||||||
$configArray[$form->getBackendName()] = $form->getConfig();
|
$backendsConfig = $this->Config('backends')->toArray();
|
||||||
|
$backendsConfig[$name] = $config;
|
||||||
if ($this->writeConfiguration(new Zend_Config($configArray), 'backends')) {
|
if ($this->writeConfiguration($backendsConfig, 'backends')) {
|
||||||
Notification::success('Backend Creation Succeeded');
|
Notification::success(sprintf($this->translate('Backend "%s" created successfully.'), $name));
|
||||||
$this->redirectNow('monitoring/config');
|
$this->redirectNow('monitoring/config');
|
||||||
} else {
|
} else {
|
||||||
$this->render('show-configuration');
|
$this->render('show-configuration');
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
$this->render('editbackend');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
<h4><?= $this->translate('Add New Backend'); ?></h4>
|
||||||
|
<?= $form; ?>
|
Loading…
x
Reference in New Issue
Block a user