mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Read apporder from configuration value
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
bbfa9d1440
commit
ac19ba9c66
1 changed files with 6 additions and 2 deletions
|
|
@ -285,11 +285,15 @@ class NavigationManager implements INavigationManager {
|
|||
}
|
||||
|
||||
if ($this->userSession->isLoggedIn()) {
|
||||
$apps = $this->appManager->getEnabledAppsForUser($this->userSession->getUser());
|
||||
$user = $this->userSession->getUser();
|
||||
$apps = $this->appManager->getEnabledAppsForUser($user);
|
||||
$customOrders = json_decode($this->config->getUserValue($user->getUID(), 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR);
|
||||
} else {
|
||||
$apps = $this->appManager->getInstalledApps();
|
||||
$customOrders = [];
|
||||
}
|
||||
|
||||
|
||||
foreach ($apps as $app) {
|
||||
if (!$this->userSession->isLoggedIn() && !$this->appManager->isEnabledForUser($app, $this->userSession->getUser())) {
|
||||
continue;
|
||||
|
|
@ -315,7 +319,7 @@ class NavigationManager implements INavigationManager {
|
|||
}
|
||||
$l = $this->l10nFac->get($app);
|
||||
$id = $nav['id'] ?? $app . ($key === 0 ? '' : $key);
|
||||
$order = isset($nav['order']) ? $nav['order'] : 100;
|
||||
$order = $customOrders[$app][$key] ?? $nav['order'] ?? 100;
|
||||
$type = $nav['type'];
|
||||
$route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : '';
|
||||
$icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg';
|
||||
|
|
|
|||
Loading…
Reference in a new issue