summaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Collaboration/Resources/ResourceProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Collaboration/Resources/ResourceProvider.php')
-rw-r--r--apps/files/lib/Collaboration/Resources/ResourceProvider.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files/lib/Collaboration/Resources/ResourceProvider.php b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
index 155dcbd7b14..1a6089b4856 100644
--- a/apps/files/lib/Collaboration/Resources/ResourceProvider.php
+++ b/apps/files/lib/Collaboration/Resources/ResourceProvider.php
@@ -48,6 +48,13 @@ class ResourceProvider implements IProvider {
$this->urlGenerator = $urlGenerator;
}
+ private function getNode(IResource $resource): ?Node {
+ if (isset($this->nodes[(int) $resource->getId()])) {
+ return $this->nodes[(int) $resource->getId()];
+ }
+ return null;
+ }
+
/**
* Get the display name of a resource
*
@@ -94,7 +101,11 @@ class ResourceProvider implements IProvider {
* @since 15.0.0
*/
public function getIconClass(IResource $resource): string {
- return 'icon-folder';
+ $node = $this->getNode($resource);
+ if ($node && $node->getMimetype() === 'httpd/unix-directory') {
+ return 'icon-files-dark';
+ }
+ return 'icon-filetype-file';
}
/**