From 8ce0de5208957104f6b17447a9c712ad1d04d3f4 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 29 Jun 2017 14:33:53 +0200 Subject: [PATCH] Disable share actions of download link and attachment if selected item is a folder --- filemanager/inc/class.filemanager_ui.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index 6401fad995..73da4792f7 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -180,7 +180,7 @@ class filemanager_ui 'onExecute' => 'javaScript:app.filemanager.createdir' ), 'mail' => array( - 'caption' => lang('Mail files'), + 'caption' => lang('Share files'), 'icon' => 'filemanager/mail_post_to', 'group' => $group, 'children' => array(), @@ -265,6 +265,10 @@ class filemanager_ui 'hint' => $data['title'], 'onExecute' => 'javaScript:app.filemanager.mail', ); + if ($mode == Vfs\Sharing::ATTACH || $mode == Vfs\Sharing::LINK) + { + $actions['mail']['children']['mail_'.$mode]['disableClass'] = 'isDir'; + } } } // This would be done automatically, but we're overriding