Skip to content

Commit a3a4259

Browse files
committed
Support admin default order for applications
Signed-off-by: Côme Chilliet <[email protected]>
1 parent ac19ba9 commit a3a4259

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎lib/private/NavigationManager.php‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,16 @@ private function init() {
284284
return;
285285
}
286286

287+
$adminCustomOrders = json_decode($this->config->getSystemValueString('apporder', '[]'), true, flags:JSON_THROW_ON_ERROR);
288+
$forceAdminOrder = $this->config->getSystemValueBool('apporderForce', false);
287289
if ($this->userSession->isLoggedIn()) {
288290
$user = $this->userSession->getUser();
289291
$apps = $this->appManager->getEnabledAppsForUser($user);
290-
$customOrders = json_decode($this->config->getUserValue($user->getUID(), 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR);
292+
if ($forceAdminOrder) {
293+
$customOrders = [];
294+
} else {
295+
$customOrders = json_decode($this->config->getUserValue($user->getUID(), 'core', 'apporder', '[]'), true, flags:JSON_THROW_ON_ERROR);
296+
}
291297
} else {
292298
$apps = $this->appManager->getInstalledApps();
293299
$customOrders = [];
@@ -319,7 +325,7 @@ private function init() {
319325
}
320326
$l = $this->l10nFac->get($app);
321327
$id = $nav['id'] ?? $app . ($key === 0 ? '' : $key);
322-
$order = $customOrders[$app][$key] ?? $nav['order'] ?? 100;
328+
$order = $customOrders[$app][$key] ?? $adminCustomOrders[$app][$key] ?? $nav['order'] ?? 100;
323329
$type = $nav['type'];
324330
$route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : '';
325331
$icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg';

0 commit comments

Comments
 (0)