summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-08-05 09:49:18 +0200
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>2020-08-05 12:52:16 +0000
commitea8f68bea6957ae459ff1ba6849b25354b3f0093 (patch)
treeb6523d1ad1c01e55622fd31bfcfb27daabec0593 /apps
parentd98f7c1bd83fc03fd297ebeac6279ffe17316950 (diff)
downloadnextcloud-server-ea8f68bea6957ae459ff1ba6849b25354b3f0093.tar.gz
nextcloud-server-ea8f68bea6957ae459ff1ba6849b25354b3f0093.zip
Hand in the route and the parameters of the request
Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/comments/lib/Search/CommentsSearchProvider.php6
-rw-r--r--apps/dav/lib/Search/ContactsSearchProvider.php7
-rw-r--r--apps/dav/lib/Search/EventsSearchProvider.php5
-rw-r--r--apps/dav/lib/Search/TasksSearchProvider.php5
-rw-r--r--apps/files/lib/Search/FilesSearchProvider.php6
-rw-r--r--apps/settings/lib/Search/SectionSearch.php5
6 files changed, 25 insertions, 9 deletions
diff --git a/apps/comments/lib/Search/CommentsSearchProvider.php b/apps/comments/lib/Search/CommentsSearchProvider.php
index bab10a58eeb..e6443c20a2f 100644
--- a/apps/comments/lib/Search/CommentsSearchProvider.php
+++ b/apps/comments/lib/Search/CommentsSearchProvider.php
@@ -77,7 +77,11 @@ class CommentsSearchProvider implements IProvider {
/**
* @inheritDoc
*/
- public function getOrder(string $from): int {
+ public function getOrder(string $route, array $routeParameters): int {
+ if ($route === 'files.View.index') {
+ // Files first
+ return 0;
+ }
return 10;
}
diff --git a/apps/dav/lib/Search/ContactsSearchProvider.php b/apps/dav/lib/Search/ContactsSearchProvider.php
index 82fa44a7a26..f97ba2cf634 100644
--- a/apps/dav/lib/Search/ContactsSearchProvider.php
+++ b/apps/dav/lib/Search/ContactsSearchProvider.php
@@ -96,8 +96,11 @@ class ContactsSearchProvider implements IProvider {
/**
* @inheritDoc
*/
- public function getOrder(string $from): int {
- return 7;
+ public function getOrder(string $route, array $routeParameters): int {
+ if ($route === 'contacts.Page.index') {
+ return -1;
+ }
+ return 20;
}
/**
diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php
index c9ce11a297d..619775aa193 100644
--- a/apps/dav/lib/Search/EventsSearchProvider.php
+++ b/apps/dav/lib/Search/EventsSearchProvider.php
@@ -82,7 +82,10 @@ class EventsSearchProvider extends ACalendarSearchProvider {
/**
* @inheritDoc
*/
- public function getOrder(string $from): int {
+ public function getOrder(string $route, array $routeParameters): int {
+ if ($route === 'calendar.View.index') {
+ return -1;
+ }
return 10;
}
diff --git a/apps/dav/lib/Search/TasksSearchProvider.php b/apps/dav/lib/Search/TasksSearchProvider.php
index 6c07cfd00f3..adc1197aa18 100644
--- a/apps/dav/lib/Search/TasksSearchProvider.php
+++ b/apps/dav/lib/Search/TasksSearchProvider.php
@@ -74,7 +74,10 @@ class TasksSearchProvider extends ACalendarSearchProvider {
/**
* @inheritDoc
*/
- public function getOrder(string $from): int {
+ public function getOrder(string $route, array $routeParameters): int {
+ if ($route === 'tasks.Page.index') {
+ return -1;
+ }
return 10;
}
diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php
index ce6f705f72c..e221dab0ab1 100644
--- a/apps/files/lib/Search/FilesSearchProvider.php
+++ b/apps/files/lib/Search/FilesSearchProvider.php
@@ -77,7 +77,11 @@ class FilesSearchProvider implements IProvider {
/**
* @inheritDoc
*/
- public function getOrder(string $from): int {
+ public function getOrder(string $route, array $routeParameters): int {
+ if ($route === 'files.View.index') {
+ // Before comments
+ return -5;
+ }
return 5;
}
diff --git a/apps/settings/lib/Search/SectionSearch.php b/apps/settings/lib/Search/SectionSearch.php
index d949d93fb61..795b9f7e9f7 100644
--- a/apps/settings/lib/Search/SectionSearch.php
+++ b/apps/settings/lib/Search/SectionSearch.php
@@ -75,9 +75,8 @@ class SectionSearch implements IProvider {
/**
* @inheritDoc
*/
- public function getOrder(string $from): int {
- if (strpos($from, $this->urlGenerator->linkToRoute('settings.PersonalSettings.index') === 0)
- || strpos($from, $this->urlGenerator->linkToRoute('settings.AdminSettings.index')) === 0) {
+ public function getOrder(string $route, array $routeParameters): int {
+ if ($route === 'settings.PersonalSettings.index' || $route === 'settings.AdminSettings.index') {
return -1;
}
return 20;