diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-10 17:25:46 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-14 10:36:04 +0200 |
commit | dd7529da9853dff43b8e81685f3a1c7151bc9e24 (patch) | |
tree | 96b10553284bb0424dac027b8af18bc117bc3513 /apps/files/lib | |
parent | e58dce2ee0768248f3ef4ee9070af5432a97f541 (diff) | |
download | nextcloud-server-dd7529da9853dff43b8e81685f3a1c7151bc9e24.tar.gz nextcloud-server-dd7529da9853dff43b8e81685f3a1c7151bc9e24.zip |
Added mountType attribute and adapted Delete action text
Added mountType attribute for files/folder to indicated whether they are
regular, external or shared.
The client side then adapts the "Delete" action hint text based on this
information.
Only the mount roots must have the delete icon hint adapted.
To make this detectable on the client side, the mountType can now
be null, "shared", "shared-root", "external" or "external-root".
This also gives room to icon customization on the client side.
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/helper.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index b84b6c06d30..be0992b1985 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -37,6 +37,7 @@ class Helper public static function determineIcon($file) { if($file['type'] === 'dir') { $icon = \OC_Helper::mimetypeIcon('dir'); + // TODO: move this part to the client side, using mountType if ($file->isShared()) { $icon = \OC_Helper::mimetypeIcon('dir-shared'); } elseif ($file->isMounted()) { @@ -125,6 +126,18 @@ class Helper if (isset($i['is_share_mount_point'])) { $entry['isShareMountPoint'] = $i['is_share_mount_point']; } + $mountType = null; + if ($i->isShared()) { + $mountType = 'shared'; + } else if ($i->isMounted()) { + $mountType = 'external'; + } + if ($mountType !== null) { + if ($i->getInternalPath() === '') { + $mountType .= '-root'; + } + $entry['mountType'] = $mountType; + } return $entry; } |