diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index 17ccbf3cd3..1b36f4d055 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -1489,7 +1489,7 @@ class filemanager_ui $actions = array ( 'save' => array( 'caption' => 'Save', - 'icon' => 'save', + 'icon' => 'apply', 'group' => ++$group, 'onExecute' => 'javaScript:app.filemanager.editor_save', 'allowOnMultiple' => false, @@ -1511,6 +1511,14 @@ class filemanager_ui 'allowOnMultiple' => false, 'toolbarDefault' => true ), + 'saveas' => array( + 'caption' => 'Save As', + 'icon' => 'save_all', + 'group' => ++$group, + 'onExecute' => 'javaScript:app.filemanager.editor_save', + 'allowOnMultiple' => false, + 'toolbarDefault' => true + ), 'delete' => array( 'caption' => 'Delete', 'icon' => 'delete', diff --git a/filemanager/js/app.js b/filemanager/js/app.js index a1c433b72b..5db693256d 100644 --- a/filemanager/js/app.js +++ b/filemanager/js/app.js @@ -1145,7 +1145,7 @@ app.classes.filemanager = AppJS.extend( /** * Method call for saving edited document */ - editor_save: function () { + editor_save: function (_egwAction) { var self = this, widgetFilePath = this.et2.getWidgetById('file_path'), file_path = widgetFilePath.value; @@ -1176,7 +1176,7 @@ app.classes.filemanager = AppJS.extend( } //existed file - if (file_path != '') { + if (file_path != '' && _egwAction.id != 'saveas') { this.editor.getDocumentAsByteArray(saveByteArrayLocally); } // new file @@ -1187,7 +1187,7 @@ app.classes.filemanager = AppJS.extend( id:'savefile', mode: 'saveas', button_caption:"", - button_label:"save", + button_label:_egwAction.id == 'saveas'?"save as":"save", value: "doc.odt" }, this.et2);