diff --git a/lib/Util.php b/lib/Util.php index bf176a12f37900cb035f06ce0ce4704b7b585009..f65a83ff0ffa04c27ee4ae606f4b90d46dd6209d 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -78,14 +78,25 @@ class Util { return $onlyOfficeEntries; } public function getOrder() { - $order_raw = $this->config->getUserValue($this->userId, 'ecloud-launcher', 'order'); + $order_raw = $this->config->getUserValue($this->userId, 'murena_launcher', 'order'); // If order raw empty try to get from 'apporder' app config $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); + } + + $isBeta = $this->isBetaUser(); + // Replace rainloop entry with snappymail at same position + if ($isBeta && $this->appManager->isEnabledForUser("snappymail")) { + if (array_keys($order, '/apps/snappymail/')) { + unset($order['/apps/rainloop/']); + } else { + $order[array_search('/apps/rainloop/', $order)] = '/apps/snappymail/'; + } } - $order = json_decode($order_raw); return $order; } public function getAppEntries() { @@ -99,6 +110,10 @@ class Util { $betaGroupName = $this->config->getSystemValue("beta_group_name"); $isBeta = $this->isBetaUser(); foreach ($entries as &$entry) { + // skip rainloop entry if snappymail is enabled + if ($entry["id"] === "rainloop" && $isBeta && $this->appManager->isEnabledForUser("snappymail")) { + continue; + } if (strpos($entry["id"], "external_index") !== 0) { $entry["style"] = ""; $entry["target"] = ""; @@ -132,9 +147,6 @@ class Util { unset($entriesByHref['/apps/dashboard/']); unset($entriesByHref['/apps/ecloud-dashboard/']); unset($entriesByHref['']); - if ($isBeta && array_key_exists("/apps/snappymail/", $entriesByHref)) { - unset($entriesByHref['/apps/rainloop/']); - } $entries = array_values($entriesByHref); return array( 'apps' => $entries );