parent
befbc6cd6a
commit
037fee298b
|
@ -401,8 +401,7 @@ class NavigationConfigForm extends ConfigForm
|
||||||
if ($ownerName === $this->getUser()->getUsername()) {
|
if ($ownerName === $this->getUser()->getUsername()) {
|
||||||
$exists = $this->getUserConfig()->hasSection($name);
|
$exists = $this->getUserConfig()->hasSection($name);
|
||||||
} else {
|
} else {
|
||||||
$owner = new User($ownerName);
|
$exists = Config::navigation($itemConfig->type, $ownerName)->hasSection($name);
|
||||||
$exists = $owner->loadNavigationConfig()->hasSection($name);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$exists = (bool) $this->getShareConfig()
|
$exists = (bool) $this->getShareConfig()
|
||||||
|
@ -537,8 +536,7 @@ class NavigationConfigForm extends ConfigForm
|
||||||
if (! $itemConfig->owner || $itemConfig->owner === $this->getUser()->getUsername()) {
|
if (! $itemConfig->owner || $itemConfig->owner === $this->getUser()->getUsername()) {
|
||||||
$config = $this->getUserConfig();
|
$config = $this->getUserConfig();
|
||||||
} else {
|
} else {
|
||||||
$owner = new User($itemConfig->owner);
|
$config = Config::navigation($itemConfig->type, $itemConfig->owner);
|
||||||
$config = $owner->loadNavigationConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($children as $child) {
|
foreach ($children as $child) {
|
||||||
|
|
|
@ -479,22 +479,6 @@ class User
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Load and return this user's navigation configuration
|
|
||||||
*
|
|
||||||
* @return Config
|
|
||||||
*/
|
|
||||||
public function loadNavigationConfig()
|
|
||||||
{
|
|
||||||
return Config::fromIni(
|
|
||||||
Config::resolvePath('preferences')
|
|
||||||
. DIRECTORY_SEPARATOR
|
|
||||||
. $this->getUsername()
|
|
||||||
. DIRECTORY_SEPARATOR
|
|
||||||
. 'navigation.ini'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load and return this user's configured navigation of the given type
|
* Load and return this user's configured navigation of the given type
|
||||||
*
|
*
|
||||||
|
@ -504,12 +488,12 @@ class User
|
||||||
*/
|
*/
|
||||||
public function getNavigation($type)
|
public function getNavigation($type)
|
||||||
{
|
{
|
||||||
$config = $this->loadNavigationConfig();
|
$config = Config::navigation($type === 'dashboard-pane' ? 'dashlet' : $type);
|
||||||
$config->getConfigObject()->setKeyColumn('name');
|
$config->getConfigObject()->setKeyColumn('name');
|
||||||
|
|
||||||
if ($type === 'dashboard-pane') {
|
if ($type === 'dashboard-pane') {
|
||||||
$panes = array();
|
$panes = array();
|
||||||
foreach ($config->select()->where('type', 'dashlet') as $dashletName => $dashletConfig) {
|
foreach ($config as $dashletName => $dashletConfig) {
|
||||||
// TODO: Throw ConfigurationError if pane or url is missing
|
// TODO: Throw ConfigurationError if pane or url is missing
|
||||||
$panes[$dashletConfig->pane][$dashletName] = $dashletConfig->url;
|
$panes[$dashletConfig->pane][$dashletName] = $dashletConfig->url;
|
||||||
}
|
}
|
||||||
|
@ -525,7 +509,7 @@ class User
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$navigation = Navigation::fromConfig($config->select()->where('type', $type));
|
$navigation = Navigation::fromConfig($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $navigation;
|
return $navigation;
|
||||||
|
|
Loading…
Reference in New Issue