if (actions['Delete']) {
var img = self.icons['Delete'];
var html;
+ var mountType = $tr.attr('data-mounttype');
+ var deleteTitle = t('files', 'Delete');
+ if (mountType === 'external-root') {
+ deleteTitle = t('files', 'Disconnect storage');
+ } else if (mountType === 'shared-root') {
+ deleteTitle = t('files', 'Unshare');
+ } else if (fileList.id === 'trashbin') {
+ deleteTitle = t('files', 'Delete permanently');
+ }
+
if (img.call) {
img = img(file);
}
- if (typeof trashBinApp !== 'undefined' && trashBinApp) {
- html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete delete-icon" />';
- } else {
- html = '<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete delete-icon" />';
- }
+ html = '<a href="#" original-title="' + escapeHTML(deleteTitle) + '" class="action delete delete-icon" />';
var element = $(html);
element.data('action', actions['Delete']);
element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler);
"data-permissions": fileData.permissions || this.getDirectoryPermissions()
});
+ if (fileData.mountType) {
+ tr.attr('data-mounttype', fileData.mountType);
+ }
+
if (!_.isUndefined(path)) {
tr.attr('data-path', path);
}
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()) {
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;
}
_makeFiles: function(data) {
var files = _.map(data, function(fileData) {
fileData.icon = OC.imagePath('core', 'filetypes/folder-external');
+ fileData.mountType = 'external';
return fileData;
});
.each(function(data) {
// convert the recipients map to a flat
// array of sorted names
+ data.mountType = 'shared';
data.recipients = _.keys(data.recipients);
data.recipientsDisplayName = OCA.Sharing.Util.formatRecipients(
data.recipients,