Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-04 11:00:27 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-04 22:36:22 +0300
commit71b62c4203a25beefeab73f73668919c813e3a50 (patch)
treee75b6b0338ed800ddf88bfe27ce6703045c18e48 /lib/public/Search
parent6eced42b7a40f5b0ea0489244583219d0ee2e7af (diff)
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/public/Search')
-rw-r--r--lib/public/Search/IProvider.php10
-rw-r--r--lib/public/Search/SearchResult.php8
-rw-r--r--lib/public/Search/SearchResultEntry.php (renamed from lib/public/Search/ASearchResultEntry.php)14
3 files changed, 21 insertions, 11 deletions
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,
];
}