Open Office Editor W.I.P:

- Add Edit option in filemanager's contextmenu
This commit is contained in:
Hadi Nategh 2016-07-20 10:34:52 +02:00
parent fa5767d156
commit 40f3dce568
6 changed files with 48 additions and 4 deletions

View File

@ -131,6 +131,13 @@ class filemanager_ui
'onExecute' => 'javaScript:app.filemanager.open', 'onExecute' => 'javaScript:app.filemanager.open',
'default' => true 'default' => true
), ),
'modify' => array(
'caption' => lang('Edit'),
'group' => $group,
'icon' => 'edit',
'onExecute' => 'javaScript:app.filemanager.open',
'enabled' => 'javaScript:app.filemanager.isEditable',
),
'saveas' => array( 'saveas' => array(
'caption' => lang('Save as'), 'caption' => lang('Save as'),
'group' => $group, 'group' => $group,

View File

@ -781,6 +781,13 @@ app.classes.filemanager = AppJS.extend(
{ {
mime_dom.click(); mime_dom.click();
} }
else if (_action.id == 'modify' && mime && data.data.mime.match(mime.mime_odf_regex))
{
egw.open_link(egw.link('/index.php', {
menuaction: 'filemanager.filemanager_ui.editor',
path: data.data.download_url
}), '', '800x600');
}
else else
{ {
// Build ViewerJS url // Build ViewerJS url
@ -1204,6 +1211,17 @@ app.classes.filemanager = AppJS.extend(
break; break;
} }
jQuery.ajax(ajaxObj); jQuery.ajax(ajaxObj);
},
/**
* Function to check wheter selected file is editable. ATM only .odt is supported.
*
* @returns {boolean} returns true if is editable otherwise false
*/
isEditable: function (_egwAction, _senders) {
var data = egw.dataGetUIDdata(_senders[0].id);
var mime = this.et2._inst.widgetContainer.getWidgetById('$row');
return data.data.mime.match(mime.mime_odf_regex)?true:false;
} }
}); });

View File

@ -120,4 +120,11 @@ table.egwGridView_grid .tile .file_tile {
} }
.mimeIcon {width:65px;} .mimeIcon {width:65px;}
.previewImage {width:100%;} .previewImage {width:100%;}
#filemanager-editor_file_path {
font-size: 11pt;
display: inline-block;
margin-top: 5px;
margin-left: 10px;
}

View File

@ -6,12 +6,12 @@
<grid width="100%" height="100%"> <grid width="100%" height="100%">
<columns> <columns>
<column width="100%"/> <column width="100%"/>
<column width="100%"/>
</columns> </columns>
<rows> <rows>
<row height="30"> <row height="45" class="dialogHeader">
<box> <box height="30">
<toolbar id="tools"/> <toolbar id="tools"/>
<description id="file_path"/>
</box> </box>
</row> </row>
<row> <row>

View File

@ -165,6 +165,12 @@ input.displayNone {
.previewImage { .previewImage {
width: 100%; width: 100%;
} }
#filemanager-editor_file_path {
font-size: 11pt;
display: inline-block;
margin-top: 5px;
margin-left: 10px;
}
/*/***************************************************************** /*/*****************************************************************
// sidebar // sidebar

View File

@ -153,6 +153,12 @@ input.displayNone {
.previewImage { .previewImage {
width: 100%; width: 100%;
} }
#filemanager-editor_file_path {
font-size: 11pt;
display: inline-block;
margin-top: 5px;
margin-left: 10px;
}
/*/***************************************************************** /*/*****************************************************************
// sidebar // sidebar