summaryrefslogtreecommitdiffstats
path: root/lib/private/Search/SearchComposer.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-04 10:00:27 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-04 21:36:22 +0200
commit71b62c4203a25beefeab73f73668919c813e3a50 (patch)
treee75b6b0338ed800ddf88bfe27ce6703045c18e48 /lib/private/Search/SearchComposer.php
parent6eced42b7a40f5b0ea0489244583219d0ee2e7af (diff)
downloadnextcloud-server-71b62c4203a25beefeab73f73668919c813e3a50.tar.gz
nextcloud-server-71b62c4203a25beefeab73f73668919c813e3a50.zip
Show mime icon, bump bundles, make the SearchResultEntry class non-abstract, Fix header search icon, various fixes
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/Search/SearchComposer.php')
-rw-r--r--lib/private/Search/SearchComposer.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/private/Search/SearchComposer.php b/lib/private/Search/SearchComposer.php
index dd4edfc5f40..7ba6296c9de 100644
--- a/lib/private/Search/SearchComposer.php
+++ b/lib/private/Search/SearchComposer.php
@@ -107,22 +107,31 @@ class SearchComposer {
/**
* Get a list of all provider IDs & Names for the consecutive calls to `search`
+ * Sort the list by the order property
*
* @return array
*/
public function getProviders(): array {
$this->loadLazyProviders();
- /**
- * Return an array with the IDs, but strip the associative keys
- */
- return array_values(
+ $providers = array_values(
array_map(function (IProvider $provider) {
return [
'id' => $provider->getId(),
- 'name' => $provider->getName()
+ 'name' => $provider->getName(),
+ 'order' => $provider->getOrder()
];
- }, $this->providers));
+ }, $this->providers)
+ );
+
+ usort($providers, function ($provider1, $provider2) {
+ return $provider1['order'] <=> $provider2['order'];
+ });
+
+ /**
+ * Return an array with the IDs, but strip the associative keys
+ */
+ return $providers;
}
/**