mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-05-03 22:30:10 +02:00
ApplicationConfigForm: Remove not required Form elements
This commit is contained in:
parent
aad2419545
commit
a250202fa3
@ -70,41 +70,10 @@ class ApplicationConfigForm extends Form
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// we do not need this form for setup because we set the database there as default.
|
|
||||||
// this form is only displayed in configuration -> application if preferences backend type of ini is recognized
|
|
||||||
if (isset($formData['global_config_backend']) && $formData['global_config_backend'] === 'ini') {
|
|
||||||
$this->addElement(
|
|
||||||
'select',
|
|
||||||
'global_config_backend',
|
|
||||||
[
|
|
||||||
'required' => true,
|
|
||||||
'autosubmit' => true,
|
|
||||||
'label' => $this->translate('User Preference Storage Type'),
|
|
||||||
'multiOptions' => [
|
|
||||||
'ini' => $this->translate('File System (INI Files)'),
|
|
||||||
'db' => $this->translate('Database')
|
|
||||||
]
|
|
||||||
]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$this->addElement(
|
|
||||||
'hidden',
|
|
||||||
'global_config_backend',
|
|
||||||
[
|
|
||||||
'required' => true,
|
|
||||||
'value' => 'db',
|
|
||||||
'disabled' => true
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! isset($formData['global_config_backend']) || $formData['global_config_backend'] === 'db') {
|
|
||||||
$backends = array();
|
$backends = array();
|
||||||
foreach (ResourceFactory::getResourceConfigs()->toArray() as $name => $resource) {
|
foreach (ResourceFactory::getResourceConfigs()->toArray() as $name => $resource) {
|
||||||
if ($resource['type'] === 'db') {
|
|
||||||
$backends[$name] = $name;
|
$backends[$name] = $name;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'select',
|
'select',
|
||||||
@ -120,7 +89,6 @@ class ApplicationConfigForm extends Form
|
|||||||
'label' => $this->translate('Configuration Database')
|
'label' => $this->translate('Configuration Database')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user