Skip to content
Snippets Groups Projects
Unverified Commit 885dabb7 authored by Christoph Wurst's avatar Christoph Wurst
Browse files

Add attributes to file search results

parent cc92d5a2
No related branches found
No related tags found
No related merge requests found
...@@ -110,13 +110,16 @@ class FilesSearchProvider implements IProvider { ...@@ -110,13 +110,16 @@ class FilesSearchProvider implements IProvider {
? $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id]) ? $this->urlGenerator->linkToRouteAbsolute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id])
: ''; : '';
return new SearchResultEntry( $searchResultEntry = new SearchResultEntry(
$thumbnailUrl, $thumbnailUrl,
$result->name, $result->name,
$this->formatSubline($result), $this->formatSubline($result),
$this->urlGenerator->getAbsoluteURL($result->link), $this->urlGenerator->getAbsoluteURL($result->link),
$result->type === 'folder' ? 'icon-folder' : $this->mimeTypeDetector->mimeTypeIcon($result->mime_type) $result->type === 'folder' ? 'icon-folder' : $this->mimeTypeDetector->mimeTypeIcon($result->mime_type)
); );
$searchResultEntry->addAttribute('fileId', (string)$result->id);
$searchResultEntry->addAttribute('path', $result->path);
return $searchResultEntry;
}, $this->fileSearch->search($query->getTerm())) }, $this->fileSearch->search($query->getTerm()))
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment