diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-01-31 11:22:46 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-03-01 20:56:18 +0100 |
commit | 31340b8be944fbf86237c10bff87b5ca3a2ffa8a (patch) | |
tree | 5cf05f44970b5fd71e4fe4883d2050649f313002 /apps | |
parent | d1a4856b5dbc2d9fc19d203c640a3c01a64a1fe8 (diff) | |
download | nextcloud-server-31340b8be944fbf86237c10bff87b5ca3a2ffa8a.tar.gz nextcloud-server-31340b8be944fbf86237c10bff87b5ca3a2ffa8a.zip |
Add icon for resource type and icons for folder/file
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/Collaboration/Resources/ResourceProvider.php | 13 | ||||
-rw-r--r-- | apps/files_sharing/src/files_sharing.js | 3 |
2 files changed, 14 insertions, 2 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'; } /** diff --git a/apps/files_sharing/src/files_sharing.js b/apps/files_sharing/src/files_sharing.js index 4e90afaf943..54bf71d8a19 100644 --- a/apps/files_sharing/src/files_sharing.js +++ b/apps/files_sharing/src/files_sharing.js @@ -22,7 +22,8 @@ window.OCP.Collaboration.registerType('files', { }); }, /** used in "Link to a {typeString}" */ - typeString: t('files_sharing', 'file') + typeString: t('files_sharing', 'file'), + typeIconClass: 'icon-files-dark' }); window.OCA.Sharing = OCA.Sharing; |