User: Add method loadNavigationConfig()

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-07 14:01:28 +02:00
parent b1e3519353
commit 6a00eaf34d
1 changed files with 18 additions and 8 deletions

View File

@ -479,6 +479,22 @@ class User
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
*
@ -488,14 +504,8 @@ class User
*/
public function getNavigation($type)
{
$config = Config::fromIni(
Config::resolvePath('preferences')
. DIRECTORY_SEPARATOR
. $this->getUsername()
. DIRECTORY_SEPARATOR
. 'navigation.ini'
)->getConfigObject();
$config->setKeyColumn('name');
$config = $this->loadNavigationConfig();
$config->getConfigObject()->setKeyColumn('name');
$navigation = new Navigation();
if ($type === 'dashboard-pane') {