aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/NavigationManager.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-09-25 15:02:23 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-09-25 15:02:23 +0200
commitac19ba9c662697b568d28c4c674ee5d3025eb16c (patch)
treeac50ca70216791b32e8de1af7ef63da9b05f0bae /lib/private/NavigationManager.php
parentbbfa9d1440e41ae9f933bcf37e30a0bc2043dd10 (diff)
downloadnextcloud-server-ac19ba9c662697b568d28c4c674ee5d3025eb16c.tar.gz
nextcloud-server-ac19ba9c662697b568d28c4c674ee5d3025eb16c.zip
Read apporder from configuration value
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/NavigationManager.php')
-rw-r--r--lib/private/NavigationManager.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index ac6f16190dc..ef6e6f4cb74 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -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';