diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2020-08-05 14:17:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 14:17:42 +0200 |
commit | a4d511d82767f54af086b366a6c08bc927cb870c (patch) | |
tree | df4b2e2fe552da5cf52e70ea04baef4e8658d421 /lib/public | |
parent | 05813561691aca15116334464a64e8be054ddcbf (diff) | |
parent | 71b62c4203a25beefeab73f73668919c813e3a50 (diff) | |
download | nextcloud-server-a4d511d82767f54af086b366a6c08bc927cb870c.tar.gz nextcloud-server-a4d511d82767f54af086b366a6c08bc927cb870c.zip |
Merge pull request #22099 from nextcloud/fix/unified-search
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/INavigationManager.php | 7 | ||||
-rw-r--r-- | lib/public/Search/IProvider.php | 10 | ||||
-rw-r--r-- | lib/public/Search/SearchResult.php | 8 | ||||
-rw-r--r-- | lib/public/Search/SearchResultEntry.php (renamed from lib/public/Search/ASearchResultEntry.php) | 14 |
4 files changed, 28 insertions, 11 deletions
diff --git a/lib/public/INavigationManager.php b/lib/public/INavigationManager.php index 198a9b11a3e..ac0d27eb5a1 100644 --- a/lib/public/INavigationManager.php +++ b/lib/public/INavigationManager.php @@ -82,6 +82,13 @@ interface INavigationManager { public function setActiveEntry($appId); /** + * Get the current navigation entry of the currently running app + * @return string + * @since 20.0.0 + */ + public function getActiveEntry(); + + /** * Get a list of navigation entries * * @param string $type type of the navigation entries diff --git a/lib/public/Search/IProvider.php b/lib/public/Search/IProvider.php index bdff0a66e0e..66db62c6829 100644 --- a/lib/public/Search/IProvider.php +++ b/lib/public/Search/IProvider.php @@ -65,6 +65,16 @@ interface IProvider { public function getName(): string; /** + * Get the search provider order + * The lower the int, the higher it will be sorted (0 will be before 10) + * + * @return int + * + * @since 20.0.0 + */ + public function getOrder(): int; + + /** * Find matching search entries in an app * * Search results can either be a complete list of all the matches the app can diff --git a/lib/public/Search/SearchResult.php b/lib/public/Search/SearchResult.php index 7abb5b9f188..8dbbcd96c26 100644 --- a/lib/public/Search/SearchResult.php +++ b/lib/public/Search/SearchResult.php @@ -38,7 +38,7 @@ final class SearchResult implements JsonSerializable { /** @var bool */ private $isPaginated; - /** @var ASearchResultEntry[] */ + /** @var SearchResultEntry[] */ private $entries; /** @var int|string|null */ @@ -47,7 +47,7 @@ final class SearchResult implements JsonSerializable { /** * @param string $name the translated name of the result section or group, e.g. "Mail" * @param bool $isPaginated - * @param ASearchResultEntry[] $entries + * @param SearchResultEntry[] $entries * @param null $cursor * * @since 20.0.0 @@ -63,7 +63,7 @@ final class SearchResult implements JsonSerializable { } /** - * @param ASearchResultEntry[] $entries + * @param SearchResultEntry[] $entries * * @return static * @@ -78,7 +78,7 @@ final class SearchResult implements JsonSerializable { } /** - * @param ASearchResultEntry[] $entries + * @param SearchResultEntry[] $entries * @param int|string $cursor * * @return static diff --git a/lib/public/Search/ASearchResultEntry.php b/lib/public/Search/SearchResultEntry.php index 584ae79de4d..a3d0d98560d 100644 --- a/lib/public/Search/ASearchResultEntry.php +++ b/lib/public/Search/SearchResultEntry.php @@ -34,7 +34,7 @@ use JsonSerializable; * The app providing the results has to extend this class for customization. In * most cases apps do not have to add any additional code. * - * @example ``class MailResultEntry extends ASearchResultEntry {}` + * @example ``class MailResultEntry extends SearchResultEntry {}` * * This approach was chosen over a final class as it allows Nextcloud to later * add new optional properties of an entry without having to break the usage of @@ -42,7 +42,7 @@ use JsonSerializable; * * @since 20.0.0 */ -abstract class ASearchResultEntry implements JsonSerializable { +class SearchResultEntry implements JsonSerializable { /** * @var string @@ -72,7 +72,7 @@ abstract class ASearchResultEntry implements JsonSerializable { * @var string * @since 20.0.0 */ - protected $iconClass; + protected $icon; /** * @var boolean @@ -85,7 +85,7 @@ abstract class ASearchResultEntry implements JsonSerializable { * @param string $title a main title of the entry * @param string $subline the secondary line of the entry * @param string $resourceUrl the URL where the user can find the detail, like a deep link inside the app - * @param string $iconClass the icon class fallback + * @param string $icon the icon class or url to the icon * @param boolean $rounded is the thumbnail rounded * * @since 20.0.0 @@ -94,13 +94,13 @@ abstract class ASearchResultEntry implements JsonSerializable { string $title, string $subline, string $resourceUrl, - string $iconClass = '', + string $icon = '', bool $rounded = false) { $this->thumbnailUrl = $thumbnailUrl; $this->title = $title; $this->subline = $subline; $this->resourceUrl = $resourceUrl; - $this->iconClass = $iconClass; + $this->icon = $icon; $this->rounded = $rounded; } @@ -115,7 +115,7 @@ abstract class ASearchResultEntry implements JsonSerializable { 'title' => $this->title, 'subline' => $this->subline, 'resourceUrl' => $this->resourceUrl, - 'iconClass' => $this->iconClass, + 'icon' => $this->icon, 'rounded' => $this->rounded, ]; } |