소스 검색

Merge pull request #41738 from nextcloud/feat/hide-dav-search-provider-if-no-app

tags/v29.0.0beta1
Benjamin Gaussorgues 5 달 전
부모
커밋
e4162798b8
No account linked to committer's email address
3개의 변경된 파일15개의 추가작업 그리고 12개의 파일을 삭제
  1. 5
    4
      apps/dav/lib/Search/ContactsSearchProvider.php
  2. 5
    4
      apps/dav/lib/Search/EventsSearchProvider.php
  3. 5
    4
      apps/dav/lib/Search/TasksSearchProvider.php

+ 5
- 4
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 {

+ 5
- 4
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;
}

/**

+ 5
- 4
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;
}

/**

Loading…
취소
저장