NavigationConfigForm: Provide proper parents when editing a shared item

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-18 10:40:16 +02:00
parent 91601de398
commit 4b7fbdfa1f
1 changed files with 5 additions and 3 deletions

View File

@ -186,7 +186,11 @@ class NavigationConfigForm extends ConfigForm
public function listAvailableParents($type)
{
$shared = false;
if (($checkbox = $this->getElement('shared')) !== null) {
$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 {
@ -195,8 +199,6 @@ class NavigationConfigForm extends ConfigForm
}
}
$children = $this->itemToLoad ? $this->getFlattenedChildren($this->itemToLoad) : array();
$names = array();
if ($shared) {
foreach ($this->getShareConfig() as $sectionName => $sectionConfig) {