Api - Add a Share filemanager directory context menu action

This commit is contained in:
nathangray 2019-08-22 15:18:40 -06:00
parent 3e8f2274f2
commit a49e3a3c15
2 changed files with 20 additions and 1 deletions

View File

@ -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;

View File

@ -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(