<?php
/**
- * ownCloud - Addressbook
+ * ownCloud - Editor
*
* @author Tom Needham
* @copyright 2011 Tom Needham contact@tomneedham.com
OC_JSON::success();
} else {
// No force
- // Show error
- OC_JSON::faliure();
+ OC_JSON::error(array('data' => array( 'message' => $l10n->t('The file has been edited since you opened it. Overwrite the file?'))));
}
} else {
// No body has edited it whilst you were, so save the file
var dir = $('#editor').attr('data-dir');
var file = $('#editor').attr('data-file');
$.post('ajax/savefile.php',{ filecontents: filecontents, file: file, dir: dir },function(jsondata){
- if(jsondata.satus == 'failure'){
- var answer = confirm('The file has been modified after you opened it. Do you want to overwrite the file with your changes?');
+ if(jsondata.status == 'failure'){
+ var answer = confirm(jsondata.data.message);
if(answer){
$.post('ajax/savefile.php',{ filecontents: filecontents, file: file, dir: dir, force: 'true' },function(jsondata){
if(jsondata.status =='success'){
}
else {
// Save error
- alert('Error saving the file. Please report this!');
+ alert(jsondata.data.message);
}
}, 'json');
}