diff --git a/lib/Util.php b/lib/Util.php index b04c4eaba7a1400926238c199559320486bef886..4cdd1198d38a72bae35be8b5c852edf00955e1af 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -77,7 +77,7 @@ class Util $onlyOfficeEntries = array_map(function ($entry) { $entry["type"] = "onlyoffice"; $entry["active"] = false; - $entry["href"] = "/apps/onlyoffice/ajax/new"; + $entry["href"] = "/apps/onlyoffice/ajax/new?type=".$entry["id"]; return $entry; }, $onlyOfficeEntries); @@ -85,7 +85,7 @@ class Util } 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 @@ -99,12 +99,21 @@ class Util { $entries = array_values($this->navigationManager->getAll()); $order = $this->getOrder(); - $external = array(); $entriesByHref = array(); - // slice + if ($this->appManager->isEnabledForUser("onlyoffice")) { + $office_entries = $this->getOnlyOfficeEntries(); + $entries = array_merge($entries , $office_entries); + } foreach ($entries as &$entry) { - $entriesByHref[$entry["href"]] = $entry; + $entriesByHref[$entry["href"]] = $entry; } + + if ($this->appManager->isEnabledForUser("onlyoffice")) { + $office_entries = $this->getOnlyOfficeEntries(); + foreach ($office_entries as &$of_entry) { + $entriesByHref[$of_entry["href"]] = $of_entry; + } + } foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { @@ -132,13 +141,9 @@ class Util } unset($entriesByHref['/apps/dashboard/']); unset($entriesByHref['/apps/ecloud-dashboard/']); + unset($entriesByHref['']); $entries = array_values($entriesByHref); - - if ($this->appManager->isEnabledForUser("onlyoffice")) { - $office_entries = $this->getOnlyOfficeEntries(); - $entries = array_merge($entries, $office_entries); - } - + return array( 'apps' => $entries ); } /** diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index ab295b5bb9c66939b108aa18f17c8952eaa82ce7..a2aee71f91a7f1f8a6587942c03c0dce73a0daaf 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -16,7 +16,8 @@ v-for="entry in entries" :key="entry.message" class="item" - :href="entry.href"> + :href="entry.href" + @click="handleOfficeClick(entry, $event)">
{{ entry.name }}
@@ -26,7 +27,8 @@ v-for="entry in external" :key="entry.message" class="item" - :href="entry.href"> + :href="entry.href" + @click="handleOfficeClick(entry, $event)">
{{ entry.name }}
@@ -36,6 +38,7 @@