@@ -36,78 +36,78 @@ |
||
| 36 | 36 | |
| 37 | 37 | class LegacyProvider extends Provider { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Search for $query |
|
| 41 | - * |
|
| 42 | - * @param string $query |
|
| 43 | - * @return array An array of OCP\Search\Result's |
|
| 44 | - * @since 7.0.0 |
|
| 45 | - */ |
|
| 46 | - public function search($query): array { |
|
| 47 | - $cm = \OC::$server->getCommentsManager(); |
|
| 48 | - $us = \OC::$server->getUserSession(); |
|
| 49 | - |
|
| 50 | - $user = $us->getUser(); |
|
| 51 | - if (!$user instanceof IUser) { |
|
| 52 | - return []; |
|
| 53 | - } |
|
| 54 | - $uf = \OC::$server->getUserFolder($user->getUID()); |
|
| 55 | - |
|
| 56 | - if ($uf === null) { |
|
| 57 | - return []; |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - $result = []; |
|
| 61 | - $numComments = 50; |
|
| 62 | - $offset = 0; |
|
| 63 | - |
|
| 64 | - while (count($result) < $numComments) { |
|
| 65 | - /** @var IComment[] $comments */ |
|
| 66 | - $comments = $cm->search($query, 'files', '', 'comment', $offset, $numComments); |
|
| 67 | - |
|
| 68 | - foreach ($comments as $comment) { |
|
| 69 | - if ($comment->getActorType() !== 'users') { |
|
| 70 | - continue; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - $displayName = $cm->resolveDisplayName('user', $comment->getActorId()); |
|
| 74 | - |
|
| 75 | - try { |
|
| 76 | - $file = $this->getFileForComment($uf, $comment); |
|
| 77 | - $result[] = new Result($query, |
|
| 78 | - $comment, |
|
| 79 | - $displayName, |
|
| 80 | - $file->getPath() |
|
| 81 | - ); |
|
| 82 | - } catch (NotFoundException $e) { |
|
| 83 | - continue; |
|
| 84 | - } |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - if (count($comments) < $numComments) { |
|
| 88 | - // Didn't find more comments when we tried to get, so there are no more comments. |
|
| 89 | - return $result; |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - $offset += $numComments; |
|
| 93 | - $numComments = 50 - count($result); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - return $result; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - /** |
|
| 100 | - * @param Folder $userFolder |
|
| 101 | - * @param IComment $comment |
|
| 102 | - * @return Node |
|
| 103 | - * @throws NotFoundException |
|
| 104 | - */ |
|
| 105 | - protected function getFileForComment(Folder $userFolder, IComment $comment): Node { |
|
| 106 | - $nodes = $userFolder->getById((int) $comment->getObjectId()); |
|
| 107 | - if (empty($nodes)) { |
|
| 108 | - throw new NotFoundException('File not found'); |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - return array_shift($nodes); |
|
| 112 | - } |
|
| 39 | + /** |
|
| 40 | + * Search for $query |
|
| 41 | + * |
|
| 42 | + * @param string $query |
|
| 43 | + * @return array An array of OCP\Search\Result's |
|
| 44 | + * @since 7.0.0 |
|
| 45 | + */ |
|
| 46 | + public function search($query): array { |
|
| 47 | + $cm = \OC::$server->getCommentsManager(); |
|
| 48 | + $us = \OC::$server->getUserSession(); |
|
| 49 | + |
|
| 50 | + $user = $us->getUser(); |
|
| 51 | + if (!$user instanceof IUser) { |
|
| 52 | + return []; |
|
| 53 | + } |
|
| 54 | + $uf = \OC::$server->getUserFolder($user->getUID()); |
|
| 55 | + |
|
| 56 | + if ($uf === null) { |
|
| 57 | + return []; |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + $result = []; |
|
| 61 | + $numComments = 50; |
|
| 62 | + $offset = 0; |
|
| 63 | + |
|
| 64 | + while (count($result) < $numComments) { |
|
| 65 | + /** @var IComment[] $comments */ |
|
| 66 | + $comments = $cm->search($query, 'files', '', 'comment', $offset, $numComments); |
|
| 67 | + |
|
| 68 | + foreach ($comments as $comment) { |
|
| 69 | + if ($comment->getActorType() !== 'users') { |
|
| 70 | + continue; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + $displayName = $cm->resolveDisplayName('user', $comment->getActorId()); |
|
| 74 | + |
|
| 75 | + try { |
|
| 76 | + $file = $this->getFileForComment($uf, $comment); |
|
| 77 | + $result[] = new Result($query, |
|
| 78 | + $comment, |
|
| 79 | + $displayName, |
|
| 80 | + $file->getPath() |
|
| 81 | + ); |
|
| 82 | + } catch (NotFoundException $e) { |
|
| 83 | + continue; |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + if (count($comments) < $numComments) { |
|
| 88 | + // Didn't find more comments when we tried to get, so there are no more comments. |
|
| 89 | + return $result; |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + $offset += $numComments; |
|
| 93 | + $numComments = 50 - count($result); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + return $result; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + /** |
|
| 100 | + * @param Folder $userFolder |
|
| 101 | + * @param IComment $comment |
|
| 102 | + * @return Node |
|
| 103 | + * @throws NotFoundException |
|
| 104 | + */ |
|
| 105 | + protected function getFileForComment(Folder $userFolder, IComment $comment): Node { |
|
| 106 | + $nodes = $userFolder->getById((int) $comment->getObjectId()); |
|
| 107 | + if (empty($nodes)) { |
|
| 108 | + throw new NotFoundException('File not found'); |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + return array_shift($nodes); |
|
| 112 | + } |
|
| 113 | 113 | } |
@@ -32,101 +32,101 @@ |
||
| 32 | 32 | * @deprecated 20.0.0 |
| 33 | 33 | */ |
| 34 | 34 | class Result extends BaseResult { |
| 35 | - /** |
|
| 36 | - * @deprecated 20.0.0 |
|
| 37 | - */ |
|
| 38 | - public $type = 'comment'; |
|
| 39 | - /** |
|
| 40 | - * @deprecated 20.0.0 |
|
| 41 | - */ |
|
| 42 | - public $comment; |
|
| 43 | - /** |
|
| 44 | - * @deprecated 20.0.0 |
|
| 45 | - */ |
|
| 46 | - public $authorId; |
|
| 47 | - /** |
|
| 48 | - * @deprecated 20.0.0 |
|
| 49 | - */ |
|
| 50 | - public $authorName; |
|
| 51 | - /** |
|
| 52 | - * @deprecated 20.0.0 |
|
| 53 | - */ |
|
| 54 | - public $path; |
|
| 55 | - /** |
|
| 56 | - * @deprecated 20.0.0 |
|
| 57 | - */ |
|
| 58 | - public $fileName; |
|
| 35 | + /** |
|
| 36 | + * @deprecated 20.0.0 |
|
| 37 | + */ |
|
| 38 | + public $type = 'comment'; |
|
| 39 | + /** |
|
| 40 | + * @deprecated 20.0.0 |
|
| 41 | + */ |
|
| 42 | + public $comment; |
|
| 43 | + /** |
|
| 44 | + * @deprecated 20.0.0 |
|
| 45 | + */ |
|
| 46 | + public $authorId; |
|
| 47 | + /** |
|
| 48 | + * @deprecated 20.0.0 |
|
| 49 | + */ |
|
| 50 | + public $authorName; |
|
| 51 | + /** |
|
| 52 | + * @deprecated 20.0.0 |
|
| 53 | + */ |
|
| 54 | + public $path; |
|
| 55 | + /** |
|
| 56 | + * @deprecated 20.0.0 |
|
| 57 | + */ |
|
| 58 | + public $fileName; |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @param string $search |
|
| 62 | - * @param IComment $comment |
|
| 63 | - * @param string $authorName |
|
| 64 | - * @param string $path |
|
| 65 | - * @throws NotFoundException |
|
| 66 | - * @deprecated 20.0.0 |
|
| 67 | - */ |
|
| 68 | - public function __construct(string $search, |
|
| 69 | - IComment $comment, |
|
| 70 | - string $authorName, |
|
| 71 | - string $path) { |
|
| 72 | - parent::__construct( |
|
| 73 | - (int) $comment->getId(), |
|
| 74 | - $comment->getMessage() |
|
| 75 | - /* @todo , [link to file] */ |
|
| 76 | - ); |
|
| 60 | + /** |
|
| 61 | + * @param string $search |
|
| 62 | + * @param IComment $comment |
|
| 63 | + * @param string $authorName |
|
| 64 | + * @param string $path |
|
| 65 | + * @throws NotFoundException |
|
| 66 | + * @deprecated 20.0.0 |
|
| 67 | + */ |
|
| 68 | + public function __construct(string $search, |
|
| 69 | + IComment $comment, |
|
| 70 | + string $authorName, |
|
| 71 | + string $path) { |
|
| 72 | + parent::__construct( |
|
| 73 | + (int) $comment->getId(), |
|
| 74 | + $comment->getMessage() |
|
| 75 | + /* @todo , [link to file] */ |
|
| 76 | + ); |
|
| 77 | 77 | |
| 78 | - $this->comment = $this->getRelevantMessagePart($comment->getMessage(), $search); |
|
| 79 | - $this->authorId = $comment->getActorId(); |
|
| 80 | - $this->authorName = $authorName; |
|
| 81 | - $this->fileName = basename($path); |
|
| 82 | - $this->path = $this->getVisiblePath($path); |
|
| 83 | - } |
|
| 78 | + $this->comment = $this->getRelevantMessagePart($comment->getMessage(), $search); |
|
| 79 | + $this->authorId = $comment->getActorId(); |
|
| 80 | + $this->authorName = $authorName; |
|
| 81 | + $this->fileName = basename($path); |
|
| 82 | + $this->path = $this->getVisiblePath($path); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * @param string $path |
|
| 87 | - * @return string |
|
| 88 | - * @throws NotFoundException |
|
| 89 | - */ |
|
| 90 | - protected function getVisiblePath(string $path): string { |
|
| 91 | - $segments = explode('/', trim($path, '/'), 3); |
|
| 85 | + /** |
|
| 86 | + * @param string $path |
|
| 87 | + * @return string |
|
| 88 | + * @throws NotFoundException |
|
| 89 | + */ |
|
| 90 | + protected function getVisiblePath(string $path): string { |
|
| 91 | + $segments = explode('/', trim($path, '/'), 3); |
|
| 92 | 92 | |
| 93 | - if (!isset($segments[2])) { |
|
| 94 | - throw new NotFoundException('Path not inside visible section'); |
|
| 95 | - } |
|
| 93 | + if (!isset($segments[2])) { |
|
| 94 | + throw new NotFoundException('Path not inside visible section'); |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - return $segments[2]; |
|
| 98 | - } |
|
| 97 | + return $segments[2]; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - /** |
|
| 101 | - * @param string $message |
|
| 102 | - * @param string $search |
|
| 103 | - * @return string |
|
| 104 | - * @throws NotFoundException |
|
| 105 | - */ |
|
| 106 | - protected function getRelevantMessagePart(string $message, string $search): string { |
|
| 107 | - $start = mb_stripos($message, $search); |
|
| 108 | - if ($start === false) { |
|
| 109 | - throw new NotFoundException('Comment section not found'); |
|
| 110 | - } |
|
| 100 | + /** |
|
| 101 | + * @param string $message |
|
| 102 | + * @param string $search |
|
| 103 | + * @return string |
|
| 104 | + * @throws NotFoundException |
|
| 105 | + */ |
|
| 106 | + protected function getRelevantMessagePart(string $message, string $search): string { |
|
| 107 | + $start = mb_stripos($message, $search); |
|
| 108 | + if ($start === false) { |
|
| 109 | + throw new NotFoundException('Comment section not found'); |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | - $end = $start + mb_strlen($search); |
|
| 112 | + $end = $start + mb_strlen($search); |
|
| 113 | 113 | |
| 114 | - if ($start <= 25) { |
|
| 115 | - $start = 0; |
|
| 116 | - $prefix = ''; |
|
| 117 | - } else { |
|
| 118 | - $start -= 25; |
|
| 119 | - $prefix = '…'; |
|
| 120 | - } |
|
| 114 | + if ($start <= 25) { |
|
| 115 | + $start = 0; |
|
| 116 | + $prefix = ''; |
|
| 117 | + } else { |
|
| 118 | + $start -= 25; |
|
| 119 | + $prefix = '…'; |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - if ((mb_strlen($message) - $end) <= 25) { |
|
| 123 | - $end = mb_strlen($message); |
|
| 124 | - $suffix = ''; |
|
| 125 | - } else { |
|
| 126 | - $end += 25; |
|
| 127 | - $suffix = '…'; |
|
| 128 | - } |
|
| 122 | + if ((mb_strlen($message) - $end) <= 25) { |
|
| 123 | + $end = mb_strlen($message); |
|
| 124 | + $suffix = ''; |
|
| 125 | + } else { |
|
| 126 | + $end += 25; |
|
| 127 | + $suffix = '…'; |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - return $prefix . mb_substr($message, $start, $end - $start) . $suffix; |
|
| 131 | - } |
|
| 130 | + return $prefix . mb_substr($message, $start, $end - $start) . $suffix; |
|
| 131 | + } |
|
| 132 | 132 | } |
@@ -36,46 +36,46 @@ |
||
| 36 | 36 | |
| 37 | 37 | class Provider implements IProvider { |
| 38 | 38 | |
| 39 | - /** @var IL10N */ |
|
| 40 | - private $l10n; |
|
| 39 | + /** @var IL10N */ |
|
| 40 | + private $l10n; |
|
| 41 | 41 | |
| 42 | - /** @var IURLGenerator */ |
|
| 43 | - private $urlGenerator; |
|
| 42 | + /** @var IURLGenerator */ |
|
| 43 | + private $urlGenerator; |
|
| 44 | 44 | |
| 45 | - /** @var LegacyProvider */ |
|
| 46 | - private $legacyProvider; |
|
| 45 | + /** @var LegacyProvider */ |
|
| 46 | + private $legacyProvider; |
|
| 47 | 47 | |
| 48 | - public function __construct(IL10N $l10n, |
|
| 49 | - IURLGenerator $urlGenerator, |
|
| 50 | - LegacyProvider $legacyProvider) { |
|
| 51 | - $this->l10n = $l10n; |
|
| 52 | - $this->urlGenerator = $urlGenerator; |
|
| 53 | - $this->legacyProvider = $legacyProvider; |
|
| 54 | - } |
|
| 48 | + public function __construct(IL10N $l10n, |
|
| 49 | + IURLGenerator $urlGenerator, |
|
| 50 | + LegacyProvider $legacyProvider) { |
|
| 51 | + $this->l10n = $l10n; |
|
| 52 | + $this->urlGenerator = $urlGenerator; |
|
| 53 | + $this->legacyProvider = $legacyProvider; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - public function getId(): string { |
|
| 57 | - return 'comments'; |
|
| 58 | - } |
|
| 56 | + public function getId(): string { |
|
| 57 | + return 'comments'; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - public function search(IUser $user, ISearchQuery $query): SearchResult { |
|
| 61 | - return SearchResult::complete( |
|
| 62 | - $this->l10n->t('Comments'), |
|
| 63 | - array_map(function (Result $result) { |
|
| 64 | - $path = $result->path; |
|
| 65 | - $pathInfo = pathinfo($path); |
|
| 66 | - return new CommentsSearchResultEntry( |
|
| 67 | - $this->urlGenerator->linkToRoute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id]), |
|
| 68 | - $result->name, |
|
| 69 | - $path, |
|
| 70 | - $this->urlGenerator->linkToRoute( |
|
| 71 | - 'files.view.index', |
|
| 72 | - [ |
|
| 73 | - 'dir' => $pathInfo['dirname'], |
|
| 74 | - 'scrollto' => $pathInfo['basename'], |
|
| 75 | - ] |
|
| 76 | - ) |
|
| 77 | - ); |
|
| 78 | - }, $this->legacyProvider->search($query->getTerm())) |
|
| 79 | - ); |
|
| 80 | - } |
|
| 60 | + public function search(IUser $user, ISearchQuery $query): SearchResult { |
|
| 61 | + return SearchResult::complete( |
|
| 62 | + $this->l10n->t('Comments'), |
|
| 63 | + array_map(function (Result $result) { |
|
| 64 | + $path = $result->path; |
|
| 65 | + $pathInfo = pathinfo($path); |
|
| 66 | + return new CommentsSearchResultEntry( |
|
| 67 | + $this->urlGenerator->linkToRoute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id]), |
|
| 68 | + $result->name, |
|
| 69 | + $path, |
|
| 70 | + $this->urlGenerator->linkToRoute( |
|
| 71 | + 'files.view.index', |
|
| 72 | + [ |
|
| 73 | + 'dir' => $pathInfo['dirname'], |
|
| 74 | + 'scrollto' => $pathInfo['basename'], |
|
| 75 | + ] |
|
| 76 | + ) |
|
| 77 | + ); |
|
| 78 | + }, $this->legacyProvider->search($query->getTerm())) |
|
| 79 | + ); |
|
| 80 | + } |
|
| 81 | 81 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | public function search(IUser $user, ISearchQuery $query): SearchResult { |
| 61 | 61 | return SearchResult::complete( |
| 62 | 62 | $this->l10n->t('Comments'), |
| 63 | - array_map(function (Result $result) { |
|
| 63 | + array_map(function(Result $result) { |
|
| 64 | 64 | $path = $result->path; |
| 65 | 65 | $pathInfo = pathinfo($path); |
| 66 | 66 | return new CommentsSearchResultEntry( |
@@ -6,23 +6,23 @@ |
||
| 6 | 6 | $baseDir = $vendorDir; |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'OCA\\Comments\\Activity\\Filter' => $baseDir . '/../lib/Activity/Filter.php', |
|
| 10 | - 'OCA\\Comments\\Activity\\Listener' => $baseDir . '/../lib/Activity/Listener.php', |
|
| 11 | - 'OCA\\Comments\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php', |
|
| 12 | - 'OCA\\Comments\\Activity\\Setting' => $baseDir . '/../lib/Activity/Setting.php', |
|
| 13 | - 'OCA\\Comments\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
| 14 | - 'OCA\\Comments\\Capabilities' => $baseDir . '/../lib/Capabilities.php', |
|
| 15 | - 'OCA\\Comments\\Collaboration\\CommentersSorter' => $baseDir . '/../lib/Collaboration/CommentersSorter.php', |
|
| 16 | - 'OCA\\Comments\\Controller\\Notifications' => $baseDir . '/../lib/Controller/Notifications.php', |
|
| 17 | - 'OCA\\Comments\\EventHandler' => $baseDir . '/../lib/EventHandler.php', |
|
| 18 | - 'OCA\\Comments\\JSSettingsHelper' => $baseDir . '/../lib/JSSettingsHelper.php', |
|
| 19 | - 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => $baseDir . '/../lib/Listener/CommentsEntityEventListener.php', |
|
| 20 | - 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir . '/../lib/Listener/LoadAdditionalScripts.php', |
|
| 21 | - 'OCA\\Comments\\Listener\\LoadSidebarScripts' => $baseDir . '/../lib/Listener/LoadSidebarScripts.php', |
|
| 22 | - 'OCA\\Comments\\Notification\\Listener' => $baseDir . '/../lib/Notification/Listener.php', |
|
| 23 | - 'OCA\\Comments\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
| 24 | - 'OCA\\Comments\\Search\\CommentsSearchResultEntry' => $baseDir . '/../lib/Search/CommentsSearchResultEntry.php', |
|
| 25 | - 'OCA\\Comments\\Search\\LegacyProvider' => $baseDir . '/../lib/Search/LegacyProvider.php', |
|
| 26 | - 'OCA\\Comments\\Search\\Provider' => $baseDir . '/../lib/Search/Provider.php', |
|
| 27 | - 'OCA\\Comments\\Search\\Result' => $baseDir . '/../lib/Search/Result.php', |
|
| 9 | + 'OCA\\Comments\\Activity\\Filter' => $baseDir.'/../lib/Activity/Filter.php', |
|
| 10 | + 'OCA\\Comments\\Activity\\Listener' => $baseDir.'/../lib/Activity/Listener.php', |
|
| 11 | + 'OCA\\Comments\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php', |
|
| 12 | + 'OCA\\Comments\\Activity\\Setting' => $baseDir.'/../lib/Activity/Setting.php', |
|
| 13 | + 'OCA\\Comments\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
| 14 | + 'OCA\\Comments\\Capabilities' => $baseDir.'/../lib/Capabilities.php', |
|
| 15 | + 'OCA\\Comments\\Collaboration\\CommentersSorter' => $baseDir.'/../lib/Collaboration/CommentersSorter.php', |
|
| 16 | + 'OCA\\Comments\\Controller\\Notifications' => $baseDir.'/../lib/Controller/Notifications.php', |
|
| 17 | + 'OCA\\Comments\\EventHandler' => $baseDir.'/../lib/EventHandler.php', |
|
| 18 | + 'OCA\\Comments\\JSSettingsHelper' => $baseDir.'/../lib/JSSettingsHelper.php', |
|
| 19 | + 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => $baseDir.'/../lib/Listener/CommentsEntityEventListener.php', |
|
| 20 | + 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir.'/../lib/Listener/LoadAdditionalScripts.php', |
|
| 21 | + 'OCA\\Comments\\Listener\\LoadSidebarScripts' => $baseDir.'/../lib/Listener/LoadSidebarScripts.php', |
|
| 22 | + 'OCA\\Comments\\Notification\\Listener' => $baseDir.'/../lib/Notification/Listener.php', |
|
| 23 | + 'OCA\\Comments\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
| 24 | + 'OCA\\Comments\\Search\\CommentsSearchResultEntry' => $baseDir.'/../lib/Search/CommentsSearchResultEntry.php', |
|
| 25 | + 'OCA\\Comments\\Search\\LegacyProvider' => $baseDir.'/../lib/Search/LegacyProvider.php', |
|
| 26 | + 'OCA\\Comments\\Search\\Provider' => $baseDir.'/../lib/Search/Provider.php', |
|
| 27 | + 'OCA\\Comments\\Search\\Result' => $baseDir.'/../lib/Search/Result.php', |
|
| 28 | 28 | ); |
@@ -6,45 +6,45 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInitComments |
| 8 | 8 | { |
| 9 | - public static $prefixLengthsPsr4 = array ( |
|
| 9 | + public static $prefixLengthsPsr4 = array( |
|
| 10 | 10 | 'O' => |
| 11 | - array ( |
|
| 11 | + array( |
|
| 12 | 12 | 'OCA\\Comments\\' => 13, |
| 13 | 13 | ), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | - public static $prefixDirsPsr4 = array ( |
|
| 16 | + public static $prefixDirsPsr4 = array( |
|
| 17 | 17 | 'OCA\\Comments\\' => |
| 18 | - array ( |
|
| 19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
| 18 | + array( |
|
| 19 | + 0 => __DIR__.'/..'.'/../lib', |
|
| 20 | 20 | ), |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | - public static $classMap = array ( |
|
| 24 | - 'OCA\\Comments\\Activity\\Filter' => __DIR__ . '/..' . '/../lib/Activity/Filter.php', |
|
| 25 | - 'OCA\\Comments\\Activity\\Listener' => __DIR__ . '/..' . '/../lib/Activity/Listener.php', |
|
| 26 | - 'OCA\\Comments\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php', |
|
| 27 | - 'OCA\\Comments\\Activity\\Setting' => __DIR__ . '/..' . '/../lib/Activity/Setting.php', |
|
| 28 | - 'OCA\\Comments\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
| 29 | - 'OCA\\Comments\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php', |
|
| 30 | - 'OCA\\Comments\\Collaboration\\CommentersSorter' => __DIR__ . '/..' . '/../lib/Collaboration/CommentersSorter.php', |
|
| 31 | - 'OCA\\Comments\\Controller\\Notifications' => __DIR__ . '/..' . '/../lib/Controller/Notifications.php', |
|
| 32 | - 'OCA\\Comments\\EventHandler' => __DIR__ . '/..' . '/../lib/EventHandler.php', |
|
| 33 | - 'OCA\\Comments\\JSSettingsHelper' => __DIR__ . '/..' . '/../lib/JSSettingsHelper.php', |
|
| 34 | - 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => __DIR__ . '/..' . '/../lib/Listener/CommentsEntityEventListener.php', |
|
| 35 | - 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalScripts.php', |
|
| 36 | - 'OCA\\Comments\\Listener\\LoadSidebarScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarScripts.php', |
|
| 37 | - 'OCA\\Comments\\Notification\\Listener' => __DIR__ . '/..' . '/../lib/Notification/Listener.php', |
|
| 38 | - 'OCA\\Comments\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
| 39 | - 'OCA\\Comments\\Search\\CommentsSearchResultEntry' => __DIR__ . '/..' . '/../lib/Search/CommentsSearchResultEntry.php', |
|
| 40 | - 'OCA\\Comments\\Search\\LegacyProvider' => __DIR__ . '/..' . '/../lib/Search/LegacyProvider.php', |
|
| 41 | - 'OCA\\Comments\\Search\\Provider' => __DIR__ . '/..' . '/../lib/Search/Provider.php', |
|
| 42 | - 'OCA\\Comments\\Search\\Result' => __DIR__ . '/..' . '/../lib/Search/Result.php', |
|
| 23 | + public static $classMap = array( |
|
| 24 | + 'OCA\\Comments\\Activity\\Filter' => __DIR__.'/..'.'/../lib/Activity/Filter.php', |
|
| 25 | + 'OCA\\Comments\\Activity\\Listener' => __DIR__.'/..'.'/../lib/Activity/Listener.php', |
|
| 26 | + 'OCA\\Comments\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php', |
|
| 27 | + 'OCA\\Comments\\Activity\\Setting' => __DIR__.'/..'.'/../lib/Activity/Setting.php', |
|
| 28 | + 'OCA\\Comments\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
| 29 | + 'OCA\\Comments\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php', |
|
| 30 | + 'OCA\\Comments\\Collaboration\\CommentersSorter' => __DIR__.'/..'.'/../lib/Collaboration/CommentersSorter.php', |
|
| 31 | + 'OCA\\Comments\\Controller\\Notifications' => __DIR__.'/..'.'/../lib/Controller/Notifications.php', |
|
| 32 | + 'OCA\\Comments\\EventHandler' => __DIR__.'/..'.'/../lib/EventHandler.php', |
|
| 33 | + 'OCA\\Comments\\JSSettingsHelper' => __DIR__.'/..'.'/../lib/JSSettingsHelper.php', |
|
| 34 | + 'OCA\\Comments\\Listener\\CommentsEntityEventListener' => __DIR__.'/..'.'/../lib/Listener/CommentsEntityEventListener.php', |
|
| 35 | + 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__.'/..'.'/../lib/Listener/LoadAdditionalScripts.php', |
|
| 36 | + 'OCA\\Comments\\Listener\\LoadSidebarScripts' => __DIR__.'/..'.'/../lib/Listener/LoadSidebarScripts.php', |
|
| 37 | + 'OCA\\Comments\\Notification\\Listener' => __DIR__.'/..'.'/../lib/Notification/Listener.php', |
|
| 38 | + 'OCA\\Comments\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
| 39 | + 'OCA\\Comments\\Search\\CommentsSearchResultEntry' => __DIR__.'/..'.'/../lib/Search/CommentsSearchResultEntry.php', |
|
| 40 | + 'OCA\\Comments\\Search\\LegacyProvider' => __DIR__.'/..'.'/../lib/Search/LegacyProvider.php', |
|
| 41 | + 'OCA\\Comments\\Search\\Provider' => __DIR__.'/..'.'/../lib/Search/Provider.php', |
|
| 42 | + 'OCA\\Comments\\Search\\Result' => __DIR__.'/..'.'/../lib/Search/Result.php', |
|
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | 45 | public static function getInitializer(ClassLoader $loader) |
| 46 | 46 | { |
| 47 | - return \Closure::bind(function () use ($loader) { |
|
| 47 | + return \Closure::bind(function() use ($loader) { |
|
| 48 | 48 | $loader->prefixLengthsPsr4 = ComposerStaticInitComments::$prefixLengthsPsr4; |
| 49 | 49 | $loader->prefixDirsPsr4 = ComposerStaticInitComments::$prefixDirsPsr4; |
| 50 | 50 | $loader->classMap = ComposerStaticInitComments::$classMap; |
@@ -58,126 +58,126 @@ |
||
| 58 | 58 | use OCP\Util; |
| 59 | 59 | |
| 60 | 60 | class Application extends App implements IBootstrap { |
| 61 | - public const APP_ID = 'files'; |
|
| 62 | - |
|
| 63 | - public function __construct(array $urlParams=[]) { |
|
| 64 | - parent::__construct(self::APP_ID, $urlParams); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function register(IRegistrationContext $context): void { |
|
| 68 | - /** |
|
| 69 | - * Controllers |
|
| 70 | - */ |
|
| 71 | - $context->registerService('APIController', function (IContainer $c) { |
|
| 72 | - /** @var IServerContainer $server */ |
|
| 73 | - $server = $c->query(IServerContainer::class); |
|
| 74 | - |
|
| 75 | - return new ApiController( |
|
| 76 | - $c->query('AppName'), |
|
| 77 | - $c->query('Request'), |
|
| 78 | - $server->getUserSession(), |
|
| 79 | - $c->query('TagService'), |
|
| 80 | - $server->getPreviewManager(), |
|
| 81 | - $server->getShareManager(), |
|
| 82 | - $server->getConfig(), |
|
| 83 | - $server->getUserFolder() |
|
| 84 | - ); |
|
| 85 | - }); |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * Services |
|
| 89 | - */ |
|
| 90 | - $context->registerService('TagService', function (IContainer $c) { |
|
| 91 | - /** @var IServerContainer $server */ |
|
| 92 | - $server = $c->query(IServerContainer::class); |
|
| 93 | - |
|
| 94 | - return new TagService( |
|
| 95 | - $server->getUserSession(), |
|
| 96 | - $server->getActivityManager(), |
|
| 97 | - $server->getTagManager()->load(self::APP_ID), |
|
| 98 | - $server->getUserFolder(), |
|
| 99 | - $server->getEventDispatcher() |
|
| 100 | - ); |
|
| 101 | - }); |
|
| 102 | - |
|
| 103 | - /* |
|
| 61 | + public const APP_ID = 'files'; |
|
| 62 | + |
|
| 63 | + public function __construct(array $urlParams=[]) { |
|
| 64 | + parent::__construct(self::APP_ID, $urlParams); |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + public function register(IRegistrationContext $context): void { |
|
| 68 | + /** |
|
| 69 | + * Controllers |
|
| 70 | + */ |
|
| 71 | + $context->registerService('APIController', function (IContainer $c) { |
|
| 72 | + /** @var IServerContainer $server */ |
|
| 73 | + $server = $c->query(IServerContainer::class); |
|
| 74 | + |
|
| 75 | + return new ApiController( |
|
| 76 | + $c->query('AppName'), |
|
| 77 | + $c->query('Request'), |
|
| 78 | + $server->getUserSession(), |
|
| 79 | + $c->query('TagService'), |
|
| 80 | + $server->getPreviewManager(), |
|
| 81 | + $server->getShareManager(), |
|
| 82 | + $server->getConfig(), |
|
| 83 | + $server->getUserFolder() |
|
| 84 | + ); |
|
| 85 | + }); |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * Services |
|
| 89 | + */ |
|
| 90 | + $context->registerService('TagService', function (IContainer $c) { |
|
| 91 | + /** @var IServerContainer $server */ |
|
| 92 | + $server = $c->query(IServerContainer::class); |
|
| 93 | + |
|
| 94 | + return new TagService( |
|
| 95 | + $server->getUserSession(), |
|
| 96 | + $server->getActivityManager(), |
|
| 97 | + $server->getTagManager()->load(self::APP_ID), |
|
| 98 | + $server->getUserFolder(), |
|
| 99 | + $server->getEventDispatcher() |
|
| 100 | + ); |
|
| 101 | + }); |
|
| 102 | + |
|
| 103 | + /* |
|
| 104 | 104 | * Register capabilities |
| 105 | 105 | */ |
| 106 | - $context->registerCapability(Capabilities::class); |
|
| 107 | - |
|
| 108 | - $context->registerEventListener(LoadAdditionalScriptsEvent::class, LegacyLoadAdditionalScriptsAdapter::class); |
|
| 109 | - $context->registerEventListener(LoadSidebar::class, LoadSidebarListener::class); |
|
| 110 | - |
|
| 111 | - $context->registerSearchProvider(FilesSearchProvider::class); |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - public function boot(IBootContext $context): void { |
|
| 115 | - $this->registerCollaboration($context); |
|
| 116 | - Listener::register($context->getServerContainer()->getEventDispatcher()); |
|
| 117 | - $this->registerNotification($context); |
|
| 118 | - $this->registerSearchProvider($context); |
|
| 119 | - $this->registerTemplates(); |
|
| 120 | - $this->registerNavigation($context); |
|
| 121 | - $this->registerHooks(); |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * Register Collaboration ResourceProvider |
|
| 126 | - */ |
|
| 127 | - private function registerCollaboration(IBootContext $context): void { |
|
| 128 | - /** @var IProviderManager $providerManager */ |
|
| 129 | - $providerManager = $context->getAppContainer()->query(IProviderManager::class); |
|
| 130 | - $providerManager->registerResourceProvider(ResourceProvider::class); |
|
| 131 | - } |
|
| 132 | - |
|
| 133 | - private function registerNotification(IBootContext $context): void { |
|
| 134 | - /** @var IManager $notifications */ |
|
| 135 | - $notifications = $context->getAppContainer()->query(IManager::class); |
|
| 136 | - $notifications->registerNotifierService(Notifier::class); |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * @param IBootContext $context |
|
| 141 | - */ |
|
| 142 | - private function registerSearchProvider(IBootContext $context): void { |
|
| 143 | - $context->getServerContainer()->getSearch()->registerProvider(File::class, ['apps' => ['files']]); |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - private function registerTemplates(): void { |
|
| 147 | - $templateManager = \OC_Helper::getFileTemplateManager(); |
|
| 148 | - $templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp'); |
|
| 149 | - $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt'); |
|
| 150 | - $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods'); |
|
| 151 | - } |
|
| 152 | - |
|
| 153 | - private function registerNavigation(IBootContext $context): void { |
|
| 154 | - /** @var IL10N $l10n */ |
|
| 155 | - $l10n = $context->getAppContainer()->query(IL10N::class); |
|
| 156 | - \OCA\Files\App::getNavigationManager()->add([ |
|
| 157 | - 'id' => 'files', |
|
| 158 | - 'appname' => 'files', |
|
| 159 | - 'script' => 'list.php', |
|
| 160 | - 'order' => 0, |
|
| 161 | - 'name' => $l10n->t('All files') |
|
| 162 | - ]); |
|
| 163 | - \OCA\Files\App::getNavigationManager()->add([ |
|
| 164 | - 'id' => 'recent', |
|
| 165 | - 'appname' => 'files', |
|
| 166 | - 'script' => 'recentlist.php', |
|
| 167 | - 'order' => 2, |
|
| 168 | - 'name' => $l10n->t('Recent') |
|
| 169 | - ]); |
|
| 170 | - \OCA\Files\App::getNavigationManager()->add([ |
|
| 171 | - 'id' => 'favorites', |
|
| 172 | - 'appname' => 'files', |
|
| 173 | - 'script' => 'simplelist.php', |
|
| 174 | - 'order' => 5, |
|
| 175 | - 'name' => $l10n->t('Favorites'), |
|
| 176 | - 'expandedState' => 'show_Quick_Access' |
|
| 177 | - ]); |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - private function registerHooks(): void { |
|
| 181 | - Util::connectHook('\OCP\Config', 'js', '\OCA\Files\App', 'extendJsConfig'); |
|
| 182 | - } |
|
| 106 | + $context->registerCapability(Capabilities::class); |
|
| 107 | + |
|
| 108 | + $context->registerEventListener(LoadAdditionalScriptsEvent::class, LegacyLoadAdditionalScriptsAdapter::class); |
|
| 109 | + $context->registerEventListener(LoadSidebar::class, LoadSidebarListener::class); |
|
| 110 | + |
|
| 111 | + $context->registerSearchProvider(FilesSearchProvider::class); |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + public function boot(IBootContext $context): void { |
|
| 115 | + $this->registerCollaboration($context); |
|
| 116 | + Listener::register($context->getServerContainer()->getEventDispatcher()); |
|
| 117 | + $this->registerNotification($context); |
|
| 118 | + $this->registerSearchProvider($context); |
|
| 119 | + $this->registerTemplates(); |
|
| 120 | + $this->registerNavigation($context); |
|
| 121 | + $this->registerHooks(); |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * Register Collaboration ResourceProvider |
|
| 126 | + */ |
|
| 127 | + private function registerCollaboration(IBootContext $context): void { |
|
| 128 | + /** @var IProviderManager $providerManager */ |
|
| 129 | + $providerManager = $context->getAppContainer()->query(IProviderManager::class); |
|
| 130 | + $providerManager->registerResourceProvider(ResourceProvider::class); |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + private function registerNotification(IBootContext $context): void { |
|
| 134 | + /** @var IManager $notifications */ |
|
| 135 | + $notifications = $context->getAppContainer()->query(IManager::class); |
|
| 136 | + $notifications->registerNotifierService(Notifier::class); |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * @param IBootContext $context |
|
| 141 | + */ |
|
| 142 | + private function registerSearchProvider(IBootContext $context): void { |
|
| 143 | + $context->getServerContainer()->getSearch()->registerProvider(File::class, ['apps' => ['files']]); |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + private function registerTemplates(): void { |
|
| 147 | + $templateManager = \OC_Helper::getFileTemplateManager(); |
|
| 148 | + $templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp'); |
|
| 149 | + $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt'); |
|
| 150 | + $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods'); |
|
| 151 | + } |
|
| 152 | + |
|
| 153 | + private function registerNavigation(IBootContext $context): void { |
|
| 154 | + /** @var IL10N $l10n */ |
|
| 155 | + $l10n = $context->getAppContainer()->query(IL10N::class); |
|
| 156 | + \OCA\Files\App::getNavigationManager()->add([ |
|
| 157 | + 'id' => 'files', |
|
| 158 | + 'appname' => 'files', |
|
| 159 | + 'script' => 'list.php', |
|
| 160 | + 'order' => 0, |
|
| 161 | + 'name' => $l10n->t('All files') |
|
| 162 | + ]); |
|
| 163 | + \OCA\Files\App::getNavigationManager()->add([ |
|
| 164 | + 'id' => 'recent', |
|
| 165 | + 'appname' => 'files', |
|
| 166 | + 'script' => 'recentlist.php', |
|
| 167 | + 'order' => 2, |
|
| 168 | + 'name' => $l10n->t('Recent') |
|
| 169 | + ]); |
|
| 170 | + \OCA\Files\App::getNavigationManager()->add([ |
|
| 171 | + 'id' => 'favorites', |
|
| 172 | + 'appname' => 'files', |
|
| 173 | + 'script' => 'simplelist.php', |
|
| 174 | + 'order' => 5, |
|
| 175 | + 'name' => $l10n->t('Favorites'), |
|
| 176 | + 'expandedState' => 'show_Quick_Access' |
|
| 177 | + ]); |
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + private function registerHooks(): void { |
|
| 181 | + Util::connectHook('\OCP\Config', 'js', '\OCA\Files\App', 'extendJsConfig'); |
|
| 182 | + } |
|
| 183 | 183 | } |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | use OCP\Search\ASearchResultEntry; |
| 29 | 29 | |
| 30 | 30 | class FilesSearchResultEntry extends ASearchResultEntry { |
| 31 | - public function __construct(string $thumbnailUrl, |
|
| 32 | - string $filename, |
|
| 33 | - string $path, |
|
| 34 | - string $url) { |
|
| 35 | - parent::__construct($thumbnailUrl, $filename, $path, $url); |
|
| 36 | - } |
|
| 31 | + public function __construct(string $thumbnailUrl, |
|
| 32 | + string $filename, |
|
| 33 | + string $path, |
|
| 34 | + string $url) { |
|
| 35 | + parent::__construct($thumbnailUrl, $filename, $path, $url); |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -36,38 +36,38 @@ |
||
| 36 | 36 | |
| 37 | 37 | class FilesSearchProvider implements IProvider { |
| 38 | 38 | |
| 39 | - /** @var File */ |
|
| 40 | - private $fileSearch; |
|
| 39 | + /** @var File */ |
|
| 40 | + private $fileSearch; |
|
| 41 | 41 | |
| 42 | - /** @var IL10N */ |
|
| 43 | - private $l10n; |
|
| 42 | + /** @var IL10N */ |
|
| 43 | + private $l10n; |
|
| 44 | 44 | |
| 45 | - /** @var IURLGenerator */ |
|
| 46 | - private $urlGenerator; |
|
| 45 | + /** @var IURLGenerator */ |
|
| 46 | + private $urlGenerator; |
|
| 47 | 47 | |
| 48 | - public function __construct(File $fileSearch, |
|
| 49 | - IL10N $l10n, |
|
| 50 | - IURLGenerator $urlGenerator) { |
|
| 51 | - $this->l10n = $l10n; |
|
| 52 | - $this->fileSearch = $fileSearch; |
|
| 53 | - $this->urlGenerator = $urlGenerator; |
|
| 54 | - } |
|
| 48 | + public function __construct(File $fileSearch, |
|
| 49 | + IL10N $l10n, |
|
| 50 | + IURLGenerator $urlGenerator) { |
|
| 51 | + $this->l10n = $l10n; |
|
| 52 | + $this->fileSearch = $fileSearch; |
|
| 53 | + $this->urlGenerator = $urlGenerator; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - public function getId(): string { |
|
| 57 | - return 'files'; |
|
| 58 | - } |
|
| 56 | + public function getId(): string { |
|
| 57 | + return 'files'; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - public function search(IUser $user, ISearchQuery $query): SearchResult { |
|
| 61 | - return SearchResult::complete( |
|
| 62 | - $this->l10n->t('Files'), |
|
| 63 | - array_map(function (FileResult $result) { |
|
| 64 | - return new FilesSearchResultEntry( |
|
| 65 | - $this->urlGenerator->linkToRoute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id]), |
|
| 66 | - $result->name, |
|
| 67 | - $result->path, |
|
| 68 | - $result->link |
|
| 69 | - ); |
|
| 70 | - }, $this->fileSearch->search($query->getTerm())) |
|
| 71 | - ); |
|
| 72 | - } |
|
| 60 | + public function search(IUser $user, ISearchQuery $query): SearchResult { |
|
| 61 | + return SearchResult::complete( |
|
| 62 | + $this->l10n->t('Files'), |
|
| 63 | + array_map(function (FileResult $result) { |
|
| 64 | + return new FilesSearchResultEntry( |
|
| 65 | + $this->urlGenerator->linkToRoute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id]), |
|
| 66 | + $result->name, |
|
| 67 | + $result->path, |
|
| 68 | + $result->link |
|
| 69 | + ); |
|
| 70 | + }, $this->fileSearch->search($query->getTerm())) |
|
| 71 | + ); |
|
| 72 | + } |
|
| 73 | 73 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | public function search(IUser $user, ISearchQuery $query): SearchResult { |
| 61 | 61 | return SearchResult::complete( |
| 62 | 62 | $this->l10n->t('Files'), |
| 63 | - array_map(function (FileResult $result) { |
|
| 63 | + array_map(function(FileResult $result) { |
|
| 64 | 64 | return new FilesSearchResultEntry( |
| 65 | 65 | $this->urlGenerator->linkToRoute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id]), |
| 66 | 66 | $result->name, |
@@ -6,51 +6,51 @@ |
||
| 6 | 6 | $baseDir = $vendorDir; |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir . '/../lib/Activity/FavoriteProvider.php', |
|
| 10 | - 'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir . '/../lib/Activity/Filter/Favorites.php', |
|
| 11 | - 'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir . '/../lib/Activity/Filter/FileChanges.php', |
|
| 12 | - 'OCA\\Files\\Activity\\Helper' => $baseDir . '/../lib/Activity/Helper.php', |
|
| 13 | - 'OCA\\Files\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php', |
|
| 14 | - 'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir . '/../lib/Activity/Settings/FavoriteAction.php', |
|
| 15 | - 'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir . '/../lib/Activity/Settings/FileChanged.php', |
|
| 16 | - 'OCA\\Files\\Activity\\Settings\\FileCreated' => $baseDir . '/../lib/Activity/Settings/FileCreated.php', |
|
| 17 | - 'OCA\\Files\\Activity\\Settings\\FileDeleted' => $baseDir . '/../lib/Activity/Settings/FileDeleted.php', |
|
| 18 | - 'OCA\\Files\\Activity\\Settings\\FileFavorite' => $baseDir . '/../lib/Activity/Settings/FileFavorite.php', |
|
| 19 | - 'OCA\\Files\\Activity\\Settings\\FileRestored' => $baseDir . '/../lib/Activity/Settings/FileRestored.php', |
|
| 20 | - 'OCA\\Files\\App' => $baseDir . '/../lib/App.php', |
|
| 21 | - 'OCA\\Files\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
| 22 | - 'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir . '/../lib/BackgroundJob/CleanupDirectEditingTokens.php', |
|
| 23 | - 'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir . '/../lib/BackgroundJob/CleanupFileLocks.php', |
|
| 24 | - 'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir . '/../lib/BackgroundJob/DeleteOrphanedItems.php', |
|
| 25 | - 'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir . '/../lib/BackgroundJob/ScanFiles.php', |
|
| 26 | - 'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir . '/../lib/BackgroundJob/TransferOwnership.php', |
|
| 27 | - 'OCA\\Files\\Capabilities' => $baseDir . '/../lib/Capabilities.php', |
|
| 28 | - 'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir . '/../lib/Collaboration/Resources/Listener.php', |
|
| 29 | - 'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir . '/../lib/Collaboration/Resources/ResourceProvider.php', |
|
| 30 | - 'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir . '/../lib/Command/DeleteOrphanedFiles.php', |
|
| 31 | - 'OCA\\Files\\Command\\Scan' => $baseDir . '/../lib/Command/Scan.php', |
|
| 32 | - 'OCA\\Files\\Command\\ScanAppData' => $baseDir . '/../lib/Command/ScanAppData.php', |
|
| 33 | - 'OCA\\Files\\Command\\TransferOwnership' => $baseDir . '/../lib/Command/TransferOwnership.php', |
|
| 34 | - 'OCA\\Files\\Controller\\AjaxController' => $baseDir . '/../lib/Controller/AjaxController.php', |
|
| 35 | - 'OCA\\Files\\Controller\\ApiController' => $baseDir . '/../lib/Controller/ApiController.php', |
|
| 36 | - 'OCA\\Files\\Controller\\DirectEditingController' => $baseDir . '/../lib/Controller/DirectEditingController.php', |
|
| 37 | - 'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir . '/../lib/Controller/DirectEditingViewController.php', |
|
| 38 | - 'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir . '/../lib/Controller/TransferOwnershipController.php', |
|
| 39 | - 'OCA\\Files\\Controller\\ViewController' => $baseDir . '/../lib/Controller/ViewController.php', |
|
| 40 | - 'OCA\\Files\\Db\\TransferOwnership' => $baseDir . '/../lib/Db/TransferOwnership.php', |
|
| 41 | - 'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir . '/../lib/Db/TransferOwnershipMapper.php', |
|
| 42 | - 'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir . '/../lib/Event/LoadAdditionalScriptsEvent.php', |
|
| 43 | - 'OCA\\Files\\Event\\LoadSidebar' => $baseDir . '/../lib/Event/LoadSidebar.php', |
|
| 44 | - 'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir . '/../lib/Exception/TransferOwnershipException.php', |
|
| 45 | - 'OCA\\Files\\Helper' => $baseDir . '/../lib/Helper.php', |
|
| 46 | - 'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir . '/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php', |
|
| 47 | - 'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir . '/../lib/Listener/LoadSidebarListener.php', |
|
| 48 | - 'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir . '/../lib/Migration/Version11301Date20191205150729.php', |
|
| 49 | - 'OCA\\Files\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
| 50 | - 'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir . '/../lib/Search/FilesSearchProvider.php', |
|
| 51 | - 'OCA\\Files\\Search\\FilesSearchResultEntry' => $baseDir . '/../lib/Search/FilesSearchResultEntry.php', |
|
| 52 | - 'OCA\\Files\\Service\\DirectEditingService' => $baseDir . '/../lib/Service/DirectEditingService.php', |
|
| 53 | - 'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir . '/../lib/Service/OwnershipTransferService.php', |
|
| 54 | - 'OCA\\Files\\Service\\TagService' => $baseDir . '/../lib/Service/TagService.php', |
|
| 55 | - 'OCA\\Files\\Settings\\PersonalSettings' => $baseDir . '/../lib/Settings/PersonalSettings.php', |
|
| 9 | + 'OCA\\Files\\Activity\\FavoriteProvider' => $baseDir.'/../lib/Activity/FavoriteProvider.php', |
|
| 10 | + 'OCA\\Files\\Activity\\Filter\\Favorites' => $baseDir.'/../lib/Activity/Filter/Favorites.php', |
|
| 11 | + 'OCA\\Files\\Activity\\Filter\\FileChanges' => $baseDir.'/../lib/Activity/Filter/FileChanges.php', |
|
| 12 | + 'OCA\\Files\\Activity\\Helper' => $baseDir.'/../lib/Activity/Helper.php', |
|
| 13 | + 'OCA\\Files\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php', |
|
| 14 | + 'OCA\\Files\\Activity\\Settings\\FavoriteAction' => $baseDir.'/../lib/Activity/Settings/FavoriteAction.php', |
|
| 15 | + 'OCA\\Files\\Activity\\Settings\\FileChanged' => $baseDir.'/../lib/Activity/Settings/FileChanged.php', |
|
| 16 | + 'OCA\\Files\\Activity\\Settings\\FileCreated' => $baseDir.'/../lib/Activity/Settings/FileCreated.php', |
|
| 17 | + 'OCA\\Files\\Activity\\Settings\\FileDeleted' => $baseDir.'/../lib/Activity/Settings/FileDeleted.php', |
|
| 18 | + 'OCA\\Files\\Activity\\Settings\\FileFavorite' => $baseDir.'/../lib/Activity/Settings/FileFavorite.php', |
|
| 19 | + 'OCA\\Files\\Activity\\Settings\\FileRestored' => $baseDir.'/../lib/Activity/Settings/FileRestored.php', |
|
| 20 | + 'OCA\\Files\\App' => $baseDir.'/../lib/App.php', |
|
| 21 | + 'OCA\\Files\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
| 22 | + 'OCA\\Files\\BackgroundJob\\CleanupDirectEditingTokens' => $baseDir.'/../lib/BackgroundJob/CleanupDirectEditingTokens.php', |
|
| 23 | + 'OCA\\Files\\BackgroundJob\\CleanupFileLocks' => $baseDir.'/../lib/BackgroundJob/CleanupFileLocks.php', |
|
| 24 | + 'OCA\\Files\\BackgroundJob\\DeleteOrphanedItems' => $baseDir.'/../lib/BackgroundJob/DeleteOrphanedItems.php', |
|
| 25 | + 'OCA\\Files\\BackgroundJob\\ScanFiles' => $baseDir.'/../lib/BackgroundJob/ScanFiles.php', |
|
| 26 | + 'OCA\\Files\\BackgroundJob\\TransferOwnership' => $baseDir.'/../lib/BackgroundJob/TransferOwnership.php', |
|
| 27 | + 'OCA\\Files\\Capabilities' => $baseDir.'/../lib/Capabilities.php', |
|
| 28 | + 'OCA\\Files\\Collaboration\\Resources\\Listener' => $baseDir.'/../lib/Collaboration/Resources/Listener.php', |
|
| 29 | + 'OCA\\Files\\Collaboration\\Resources\\ResourceProvider' => $baseDir.'/../lib/Collaboration/Resources/ResourceProvider.php', |
|
| 30 | + 'OCA\\Files\\Command\\DeleteOrphanedFiles' => $baseDir.'/../lib/Command/DeleteOrphanedFiles.php', |
|
| 31 | + 'OCA\\Files\\Command\\Scan' => $baseDir.'/../lib/Command/Scan.php', |
|
| 32 | + 'OCA\\Files\\Command\\ScanAppData' => $baseDir.'/../lib/Command/ScanAppData.php', |
|
| 33 | + 'OCA\\Files\\Command\\TransferOwnership' => $baseDir.'/../lib/Command/TransferOwnership.php', |
|
| 34 | + 'OCA\\Files\\Controller\\AjaxController' => $baseDir.'/../lib/Controller/AjaxController.php', |
|
| 35 | + 'OCA\\Files\\Controller\\ApiController' => $baseDir.'/../lib/Controller/ApiController.php', |
|
| 36 | + 'OCA\\Files\\Controller\\DirectEditingController' => $baseDir.'/../lib/Controller/DirectEditingController.php', |
|
| 37 | + 'OCA\\Files\\Controller\\DirectEditingViewController' => $baseDir.'/../lib/Controller/DirectEditingViewController.php', |
|
| 38 | + 'OCA\\Files\\Controller\\TransferOwnershipController' => $baseDir.'/../lib/Controller/TransferOwnershipController.php', |
|
| 39 | + 'OCA\\Files\\Controller\\ViewController' => $baseDir.'/../lib/Controller/ViewController.php', |
|
| 40 | + 'OCA\\Files\\Db\\TransferOwnership' => $baseDir.'/../lib/Db/TransferOwnership.php', |
|
| 41 | + 'OCA\\Files\\Db\\TransferOwnershipMapper' => $baseDir.'/../lib/Db/TransferOwnershipMapper.php', |
|
| 42 | + 'OCA\\Files\\Event\\LoadAdditionalScriptsEvent' => $baseDir.'/../lib/Event/LoadAdditionalScriptsEvent.php', |
|
| 43 | + 'OCA\\Files\\Event\\LoadSidebar' => $baseDir.'/../lib/Event/LoadSidebar.php', |
|
| 44 | + 'OCA\\Files\\Exception\\TransferOwnershipException' => $baseDir.'/../lib/Exception/TransferOwnershipException.php', |
|
| 45 | + 'OCA\\Files\\Helper' => $baseDir.'/../lib/Helper.php', |
|
| 46 | + 'OCA\\Files\\Listener\\LegacyLoadAdditionalScriptsAdapter' => $baseDir.'/../lib/Listener/LegacyLoadAdditionalScriptsAdapter.php', |
|
| 47 | + 'OCA\\Files\\Listener\\LoadSidebarListener' => $baseDir.'/../lib/Listener/LoadSidebarListener.php', |
|
| 48 | + 'OCA\\Files\\Migration\\Version11301Date20191205150729' => $baseDir.'/../lib/Migration/Version11301Date20191205150729.php', |
|
| 49 | + 'OCA\\Files\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
| 50 | + 'OCA\\Files\\Search\\FilesSearchProvider' => $baseDir.'/../lib/Search/FilesSearchProvider.php', |
|
| 51 | + 'OCA\\Files\\Search\\FilesSearchResultEntry' => $baseDir.'/../lib/Search/FilesSearchResultEntry.php', |
|
| 52 | + 'OCA\\Files\\Service\\DirectEditingService' => $baseDir.'/../lib/Service/DirectEditingService.php', |
|
| 53 | + 'OCA\\Files\\Service\\OwnershipTransferService' => $baseDir.'/../lib/Service/OwnershipTransferService.php', |
|
| 54 | + 'OCA\\Files\\Service\\TagService' => $baseDir.'/../lib/Service/TagService.php', |
|
| 55 | + 'OCA\\Files\\Settings\\PersonalSettings' => $baseDir.'/../lib/Settings/PersonalSettings.php', |
|
| 56 | 56 | ); |