diff --git a/filemanager/inc/class.filemanager_shares.inc.php b/filemanager/inc/class.filemanager_shares.inc.php index 85314af5b3..7bfc80a91b 100644 --- a/filemanager/inc/class.filemanager_shares.inc.php +++ b/filemanager/inc/class.filemanager_shares.inc.php @@ -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, diff --git a/filemanager/js/app.js b/filemanager/js/app.js index e9e336e714..a9fa702024 100644 --- a/filemanager/js/app.js +++ b/filemanager/js/app.js @@ -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 *