diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-02 17:37:16 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-02 17:37:16 +0200 |
commit | c92c577b5e05ea1d932c6739b87fea8beea21e1b (patch) | |
tree | e194232ae8efd9f97fca8fee61cc9b2df314dac2 /apps/files/lib | |
parent | 49d9631eee1616b9ae2846886c3d428236c5b81a (diff) | |
download | nextcloud-server-c92c577b5e05ea1d932c6739b87fea8beea21e1b.tar.gz nextcloud-server-c92c577b5e05ea1d932c6739b87fea8beea21e1b.zip |
- Introduce isShared() and isMounted() on FileInfo class
- Reuse these methods on determineIcon()
- Generate permission string for the desktop client
- expose {http://owncloud.org/ns}permissions as additional WebDAV property containing the permission string
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/helper.php | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 0ae87d12fbf..3d395081411 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -27,20 +27,11 @@ class Helper */ public static function determineIcon($file) { if($file['type'] === 'dir') { - $dir = $file['directory']; $icon = \OC_Helper::mimetypeIcon('dir'); - $absPath = $file->getPath(); - $mount = \OC\Files\Filesystem::getMountManager()->find($absPath); - if (!is_null($mount)) { - $sid = $mount->getStorageId(); - if (!is_null($sid)) { - $sid = explode(':', $sid); - if ($sid[0] === 'shared') { - $icon = \OC_Helper::mimetypeIcon('dir-shared'); - } elseif ($sid[0] !== 'local' and $sid[0] !== 'home') { - $icon = \OC_Helper::mimetypeIcon('dir-external'); - } - } + if ($file->isShared()) { + $icon = \OC_Helper::mimetypeIcon('dir-shared'); + } elseif ($file->isMounted()) { + $icon = \OC_Helper::mimetypeIcon('dir-external'); } }else{ $icon = \OC_Helper::mimetypeIcon($file->getMimetype()); |