From de657cbacc27c86829c58b8b9df9387f4ae00fe7 Mon Sep 17 00:00:00 2001 From: theronakpatel Date: Tue, 3 Jun 2025 11:44:59 +0530 Subject: [PATCH] insert Vault at 6th order if not found in user's order --- appinfo/info.xml | 2 +- lib/Service/AppsService.php | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 89e59e5..e8ec3d4 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Murena Dashboard Murena Dashboard - 7.1.0 + 7.1.1 agpl Murena MurenaDashboard diff --git a/lib/Service/AppsService.php b/lib/Service/AppsService.php index 452b8f9..793cc2b 100644 --- a/lib/Service/AppsService.php +++ b/lib/Service/AppsService.php @@ -98,11 +98,22 @@ class AppsService { $order_raw = !$order_raw ? $this->config->getUserValue($this->userId, 'apporder', 'order') : $order_raw; // If order raw is still empty, return empty array if (!$order_raw) { - return self::DEFAULT_ORDER; + $order = self::DEFAULT_ORDER; + } else { + $order = json_decode($order_raw, true); } - return json_decode($order_raw); + return $this->insertVaultAt6thPlace($order); } - + private function insertVaultAt6thPlace(array $order): array { + $vaultUrl = "https://vault.murena.io"; + + if (!in_array($vaultUrl, $order)) { + array_splice($order, 5, 0, $vaultUrl); // Insert at index 5 (6th position) + } + + return $order; + } + public function getAppEntries() { $entries = array_values($this->navigationManager->getAll()); $order = $this->getAppOrder(); -- GitLab