mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +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)
|
public function listAvailableParents($type)
|
||||||
{
|
{
|
||||||
$shared = false;
|
$children = $this->itemToLoad ? $this->getFlattenedChildren($this->itemToLoad) : array();
|
||||||
$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'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$names = array();
|
$names = array();
|
||||||
if ($shared) {
|
|
||||||
foreach ($this->getShareConfig() as $sectionName => $sectionConfig) {
|
foreach ($this->getShareConfig() as $sectionName => $sectionConfig) {
|
||||||
if (
|
if (
|
||||||
$sectionName !== $this->itemToLoad
|
$sectionName !== $this->itemToLoad
|
||||||
@ -211,7 +198,7 @@ class NavigationConfigForm extends ConfigForm
|
|||||||
$names[] = $sectionName;
|
$names[] = $sectionName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
foreach ($this->getUserConfig() as $sectionName => $sectionConfig) {
|
foreach ($this->getUserConfig() as $sectionName => $sectionConfig) {
|
||||||
if (
|
if (
|
||||||
$sectionName !== $this->itemToLoad
|
$sectionName !== $this->itemToLoad
|
||||||
@ -221,7 +208,6 @@ class NavigationConfigForm extends ConfigForm
|
|||||||
$names[] = $sectionName;
|
$names[] = $sectionName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $names;
|
return $names;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user