From e8d67952b9028b923d148c2a4e8da3665ca31fcb Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 12 Mar 2018 11:11:13 +0100 Subject: [PATCH] * Filemanager: Fix sharing menu completely disappears when user has no rights to mail app --- filemanager/inc/class.filemanager_ui.inc.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index cdcf191838..5f9c9a69d4 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -176,7 +176,7 @@ class filemanager_ui 'onExecute' => Api\Header\UserAgent::mobile()?'javaScript:app.filemanager.viewEntry':'javaScript:app.filemanager.editprefs', 'mobileViewTemplate' => 'file?'.filemtime(Api\Etemplate\Widget\Template::rel2path('/filemanager/templates/mobile/file.xet')) ), - 'mail' => array( + 'share' => array( 'caption' => lang('Share files'), 'icon' => 'filemanager/mail_post_to', 'group' => $group, @@ -285,15 +285,11 @@ class filemanager_ui 'onExecute' => 'javaScript:app.filemanager.drop' ) ); - if (!isset($GLOBALS['egw_info']['user']['apps']['mail'])) - { - unset($actions['mail']); - } - else - { + + if (isset($GLOBALS['egw_info']['user']['apps']['mail'])) { foreach(Vfs\Sharing::$modes as $mode => $data) { - $actions['mail']['children']['mail_'.$mode] = array( + $actions['share']['children']['mail_'.$mode] = array( 'caption' => $data['label'], 'hint' => $data['title'], 'group' => 2, @@ -301,10 +297,11 @@ class filemanager_ui ); if ($mode == Vfs\Sharing::ATTACH || $mode == Vfs\Sharing::LINK) { - $actions['mail']['children']['mail_'.$mode]['disableClass'] = 'isDir'; + $actions['share']['children']['mail_'.$mode]['disableClass'] = 'isDir'; } } } + // This would be done automatically, but we're overriding foreach($actions as $action_id => $action) { @@ -979,7 +976,7 @@ class filemanager_ui { $row['class'] .= 'noEdit '; } - + $row['class'] .= !$dir_is_writable[$dir] ? 'noDelete' : ''; $row['download_url'] = Vfs::download_url($path); $row['gid'] = -abs($row['gid']); // gid are positive, but we use negagive account_id for groups internal