mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
NavigationConfigForm: Provide all available parents for non-shared items
refs #5600
This commit is contained in:
parent
9477c53b43
commit
335ed8c74f
@ -185,22 +185,9 @@ class NavigationConfigForm extends ConfigForm
|
||||
*/
|
||||
public function listAvailableParents($type)
|
||||
{
|
||||
$shared = false;
|
||||
$children = array();
|
||||
if ($this->itemToLoad) {
|
||||
$shared = $this->hasBeenShared($this->itemToLoad);
|
||||
$children = $this->getFlattenedChildren($this->itemToLoad);
|
||||
} elseif (($checkbox = $this->getElement('shared')) !== null) {
|
||||
if ($checkbox->isChecked()) {
|
||||
$shared = true;
|
||||
} else {
|
||||
$requestData = $this->getRequestData();
|
||||
$shared = isset($requestData['shared']) && $requestData['shared'];
|
||||
}
|
||||
}
|
||||
$children = $this->itemToLoad ? $this->getFlattenedChildren($this->itemToLoad) : array();
|
||||
|
||||
$names = array();
|
||||
if ($shared) {
|
||||
foreach ($this->getShareConfig() as $sectionName => $sectionConfig) {
|
||||
if (
|
||||
$sectionName !== $this->itemToLoad
|
||||
@ -211,7 +198,7 @@ class NavigationConfigForm extends ConfigForm
|
||||
$names[] = $sectionName;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
foreach ($this->getUserConfig() as $sectionName => $sectionConfig) {
|
||||
if (
|
||||
$sectionName !== $this->itemToLoad
|
||||
@ -221,7 +208,6 @@ class NavigationConfigForm extends ConfigForm
|
||||
$names[] = $sectionName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $names;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user