diff --git a/api/js/jsapi/app_base.js b/api/js/jsapi/app_base.js index 37a701e6ec..ace55f5af0 100644 --- a/api/js/jsapi/app_base.js +++ b/api/js/jsapi/app_base.js @@ -1906,6 +1906,13 @@ var AppJS = (function(){ "use strict"; return Class.extend( { return this.egw.message(this.egw.lang('Missing share path. Unable to create share.'), 'error'); } + switch(_action.id) + { + case 'shareFilemanager': + // Sharing a link to just files in filemanager + var id = path.split('::'); + path = '/apps/'+ id[0] + '/' + id[1]; + } if(typeof _writable === 'undefined' && _action.parent && _action.parent.getActionById('shareWritable')) { _writable = _action.parent.getActionById('shareWritable').checked || false; diff --git a/api/src/Sharing.php b/api/src/Sharing.php index 0729f2bf67..4ae8c6bb43 100644 --- a/api/src/Sharing.php +++ b/api/src/Sharing.php @@ -418,9 +418,21 @@ class Sharing 'allowOnMultiple' => true, 'enabled' => "javaScript:app.$appname.is_share_enabled", 'checkbox' => true - ) + ), + 'shareFilemanager' => array( + 'caption' => lang('Filemanager directory'), + 'group' => 10, + 'icon' => 'link', + 'order' => 20, + 'enabled' => "javaScript:app.$appname.is_share_enabled", + 'onExecute' => "javaScript:app.$appname.share_link" + ), ), )); + if(!$GLOBALS['egw_info']['user']['apps']['filemanager']) + { + unset($actions['share']['children']['shareFilemanager']); + } if(!$GLOBALS['egw_info']['user']['apps']['stylite']) { array_unshift($actions['share']['children'], array(