diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2023-11-29 11:50:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 11:50:43 +0100 |
commit | 81b45630393dfa7c3f28689f712b6540ee35fbbb (patch) | |
tree | 49e6789548d0e64fb2cf8a87c5534edad93ebbef /apps | |
parent | d6a411b4b424f63d8c7153f559fe2305edffdcd1 (diff) | |
parent | 761b042e846973af6d06ef1b221f647869255800 (diff) | |
download | nextcloud-server-81b45630393dfa7c3f28689f712b6540ee35fbbb.tar.gz nextcloud-server-81b45630393dfa7c3f28689f712b6540ee35fbbb.zip |
Merge pull request #41837 from nextcloud/backport/41738/stable28
[stable28] feat(dav): hide search providers if their respective app is not activated
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Search/ContactsSearchProvider.php | 9 | ||||
-rw-r--r-- | apps/dav/lib/Search/EventsSearchProvider.php | 9 | ||||
-rw-r--r-- | apps/dav/lib/Search/TasksSearchProvider.php | 9 |
3 files changed, 15 insertions, 12 deletions
diff --git a/apps/dav/lib/Search/ContactsSearchProvider.php b/apps/dav/lib/Search/ContactsSearchProvider.php index 265f4958efb..2a0e70bf045 100644 --- a/apps/dav/lib/Search/ContactsSearchProvider.php +++ b/apps/dav/lib/Search/ContactsSearchProvider.php @@ -83,11 +83,12 @@ class ContactsSearchProvider implements IFilteringProvider { return $this->l10n->t('Contacts'); } - public function getOrder(string $route, array $routeParameters): int { - if ($route === 'contacts.Page.index') { - return -1; + public function getOrder(string $route, array $routeParameters): ?int { + if ($this->appManager->isEnabledForUser('contacts')) { + return $route === 'contacts.Page.index' ? -1 : 25; } - return 25; + + return null; } public function search(IUser $user, ISearchQuery $query): SearchResult { diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index 0cf01742672..dd87f486a1d 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -89,11 +89,12 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering /** * @inheritDoc */ - public function getOrder(string $route, array $routeParameters): int { - if ($route === 'calendar.View.index') { - return -1; + public function getOrder(string $route, array $routeParameters): ?int { + if ($this->appManager->isEnabledForUser('calendar')) { + return $route === 'calendar.View.index' ? -1 : 30; } - return 30; + + return null; } /** diff --git a/apps/dav/lib/Search/TasksSearchProvider.php b/apps/dav/lib/Search/TasksSearchProvider.php index 91692ea1c2a..5cb64556457 100644 --- a/apps/dav/lib/Search/TasksSearchProvider.php +++ b/apps/dav/lib/Search/TasksSearchProvider.php @@ -77,11 +77,12 @@ class TasksSearchProvider extends ACalendarSearchProvider { /** * @inheritDoc */ - public function getOrder(string $route, array $routeParameters): int { - if ($route === 'tasks.Page.index') { - return -1; + public function getOrder(string $route, array $routeParameters): ?int { + if ($this->appManager->isEnabledForUser('tasks')) { + return $route === 'tasks.Page.index' ? -1 : 35; } - return 35; + + return null; } /** |