mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-05-03 22:30:10 +02:00
UserGroupBackendForm: Fix that autosubmit do not have any effect
refs #7343
This commit is contained in:
parent
cacd97fb46
commit
7ebf185036
@ -13,6 +13,13 @@ use Icinga\Forms\ConfigForm;
|
|||||||
*/
|
*/
|
||||||
class UserGroupBackendForm extends ConfigForm
|
class UserGroupBackendForm extends ConfigForm
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* The backend to load when displaying the form for the first time
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $backendToLoad;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize this form
|
* Initialize this form
|
||||||
*/
|
*/
|
||||||
@ -53,10 +60,7 @@ class UserGroupBackendForm extends ConfigForm
|
|||||||
throw new NotFoundError('No user group backend called "%s" found', $name);
|
throw new NotFoundError('No user group backend called "%s" found', $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->config->getSection($name)->toArray();
|
$this->backendToLoad = $name;
|
||||||
$data['type'] = $data['backend'];
|
|
||||||
$data['name'] = $name;
|
|
||||||
$this->populate($data);
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +191,8 @@ class UserGroupBackendForm extends ConfigForm
|
|||||||
'autosubmit' => true,
|
'autosubmit' => true,
|
||||||
'label' => $this->translate('Backend Type'),
|
'label' => $this->translate('Backend Type'),
|
||||||
'description' => $this->translate('The type of this user group backend'),
|
'description' => $this->translate('The type of this user group backend'),
|
||||||
'multiOptions' => $backendTypes
|
'multiOptions' => $backendTypes,
|
||||||
|
'value' => $backendType
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -195,4 +200,17 @@ class UserGroupBackendForm extends ConfigForm
|
|||||||
$backendForm->createElements($formData);
|
$backendForm->createElements($formData);
|
||||||
$this->addElements($backendForm->getElements());
|
$this->addElements($backendForm->getElements());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Populate the configuration of the backend to load
|
||||||
|
*/
|
||||||
|
public function onRequest()
|
||||||
|
{
|
||||||
|
if ($this->backendToLoad) {
|
||||||
|
$data = $this->config->getSection($this->backendToLoad)->toArray();
|
||||||
|
$data['type'] = $data['backend'];
|
||||||
|
$data['name'] = $this->backendToLoad;
|
||||||
|
$this->populate($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user