diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-08-04 10:00:27 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-08-04 21:36:22 +0200 |
commit | 71b62c4203a25beefeab73f73668919c813e3a50 (patch) | |
tree | e75b6b0338ed800ddf88bfe27ce6703045c18e48 /apps/settings/lib | |
parent | 6eced42b7a40f5b0ea0489244583219d0ee2e7af (diff) | |
download | nextcloud-server-71b62c4203a25beefeab73f73668919c813e3a50.tar.gz nextcloud-server-71b62c4203a25beefeab73f73668919c813e3a50.zip |
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 'apps/settings/lib')
-rw-r--r-- | apps/settings/lib/Search/SectionResult.php | 29 | ||||
-rw-r--r-- | apps/settings/lib/Search/SectionSearch.php | 30 |
2 files changed, 22 insertions, 37 deletions
diff --git a/apps/settings/lib/Search/SectionResult.php b/apps/settings/lib/Search/SectionResult.php deleted file mode 100644 index d7e4e6b21fb..00000000000 --- a/apps/settings/lib/Search/SectionResult.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -declare(strict_types=1); -/** - * @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -namespace OCA\Settings\Search; - -use OCP\Search\ASearchResultEntry; - -class SectionResult extends ASearchResultEntry { -} diff --git a/apps/settings/lib/Search/SectionSearch.php b/apps/settings/lib/Search/SectionSearch.php index 818fa055bb4..6e7b930046c 100644 --- a/apps/settings/lib/Search/SectionSearch.php +++ b/apps/settings/lib/Search/SectionSearch.php @@ -30,7 +30,7 @@ use OCP\IUser; use OCP\Search\IProvider; use OCP\Search\ISearchQuery; use OCP\Search\SearchResult; -use OCP\Settings\IIconSection; +use OCP\Search\SearchResultEntry; use OCP\Settings\ISection; use OCP\Settings\IManager; @@ -38,10 +38,13 @@ class SectionSearch implements IProvider { /** @var IManager */ protected $settingsManager; + /** @var IGroupManager */ protected $groupManager; + /** @var IURLGenerator */ protected $urlGenerator; + /** @var IL10N */ protected $l; @@ -72,6 +75,13 @@ class SectionSearch implements IProvider { /** * @inheritDoc */ + public function getOrder(): int { + return 20; + } + + /** + * @inheritDoc + */ public function search(IUser $user, ISearchQuery $query): SearchResult { $isAdmin = $this->groupManager->isAdmin($user->getUID()); @@ -115,16 +125,20 @@ class SectionSearch implements IProvider { continue; } - $iconUrl = ''; - if ($section instanceof IIconSection) { - $iconUrl = $section->getIcon(); - } + /** + * We can't use the icon URL at the moment as they don't invert correctly for dark theme + * $iconUrl = ''; + * if ($section instanceof IIconSection) { + * $iconUrl = $section->getIcon(); + * } + */ - $result[] = new SectionResult( - $iconUrl, + $result[] = new SearchResultEntry( + '', $section->getName(), $subline, - $this->urlGenerator->linkToRouteAbsolute($routeName, ['section' => $section->getID()]) + $this->urlGenerator->linkToRouteAbsolute($routeName, ['section' => $section->getID()]), + 'icon-settings' ); } } |