Filemanager - add actions for EPL ability to edit view link & shares

This commit is contained in:
nathangray 2019-07-10 11:39:48 -06:00
parent a08009b9e9
commit 27307169c1
2 changed files with 34 additions and 0 deletions

View File

@ -121,6 +121,25 @@ class filemanager_shares extends filemanager_ui
{
$group = 1;
$actions = array(
'shareLink' => array(
'caption' => lang('View link'),
'group' => $group,
'icon' => 'share',
'allowOnMultiple' => false,
'default' => true,
'onExecute' => 'javaScript:app.filemanager.view_link',
'disableIfNoEPL' => true
),
'shareEdit' => array(
'caption' => lang('Edit Share'),
'group' => 1,
'icon' => 'edit',
'allowOnMultiple' => false,
'popup' => '400x200',
'url' => 'menuaction=stylite.stylite_filemanager.edit_share&share_id=$id',
'disableIfNoEPL' => true
),
'delete' => array(
'caption' => lang('Delete'),
'group' => ++$group,

View File

@ -1225,6 +1225,21 @@ app.classes.filemanager = AppJS.extend(
});
},
/**
* View the link from an existing share
* (EPL only)
*
* @param {egwAction} _action The shareLink action
* @param {egwActionObject[]} _senders The row clicked on
*/
view_link: function(_action, _senders)
{
var id = egw.dataGetUIDdata(_senders[0].id).data.share_id;
egw.json('stylite_filemanager::ajax_view_link', [id],
this._share_link_callback, this, true, this).sendRequest();
return true;
},
/**
* This function copies the selected file/folder entry as webdav link into clipboard
*