mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
DirectorObjectForm: improve import handling
This commit is contained in:
parent
6187777d08
commit
2643b6ae8c
@ -116,10 +116,16 @@ abstract class DirectorObjectForm extends QuickForm
|
|||||||
|
|
||||||
if ($object->supportsImports()) {
|
if ($object->supportsImports()) {
|
||||||
if (array_key_exists('imports', $values)) {
|
if (array_key_exists('imports', $values)) {
|
||||||
$object->imports()->set(
|
$value = $values['imports'];
|
||||||
preg_split('/\s*,\s*/', $values['imports'], -1, PREG_SPLIT_NO_EMPTY)
|
|
||||||
);
|
// TODO: Compat for comma separated string, check if still needed
|
||||||
|
if (! is_array($value)) {
|
||||||
|
$value = preg_split('/\s*,\s*/', $value, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
}
|
||||||
|
|
||||||
|
$object->imports()->set($value);
|
||||||
$handled['imports'] = true;
|
$handled['imports'] = true;
|
||||||
|
$object->clearImportedObjects();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,10 +274,12 @@ abstract class DirectorObjectForm extends QuickForm
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->object->supportsImports()) {
|
if ($object->supportsImports()) {
|
||||||
$this->getElement('imports')->setValue(
|
$el = $this->getElement('imports');
|
||||||
implode(', ', $this->object->imports()->listImportNames())
|
if ($el) {
|
||||||
);
|
$el->setMultiOptions($this->enumAllowedTemplates());
|
||||||
|
$el->setValue($object->imports()->listImportNames());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->object->supportsCustomVars()) {
|
if ($this->object->supportsCustomVars()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user