diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-01-18 20:09:03 +0100 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-01-18 20:09:03 +0100 |
commit | 5ff29b4348a1dcb9ed32273133b1c787aaf5c72c (patch) | |
tree | 8d92b51087544ab02a459fc32d01b110cce48f28 /apps/files | |
parent | e560cba76beb918a2c127b931b6d409abd9f03ab (diff) | |
download | nextcloud-server-5ff29b4348a1dcb9ed32273133b1c787aaf5c72c.tar.gz nextcloud-server-5ff29b4348a1dcb9ed32273133b1c787aaf5c72c.zip |
fixing indent
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/ajax/delete.php | 12 | ||||
-rw-r--r-- | apps/files/ajax/upload.php | 36 | ||||
-rw-r--r-- | apps/files/js/files.js | 46 |
3 files changed, 47 insertions, 47 deletions
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php index bb1f3fff87b..293543c547f 100644 --- a/apps/files/ajax/delete.php +++ b/apps/files/ajax/delete.php @@ -29,12 +29,12 @@ $maxHumanFilesize=$l->t('Upload') . ' max. '.$maxHumanFilesize; if($success) { OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $files, - 'uploadMaxFilesize'=>$maxUploadFilesize, - 'maxHumanFilesize'=>$maxHumanFilesize - ))); + 'uploadMaxFilesize'=>$maxUploadFilesize, + 'maxHumanFilesize'=>$maxHumanFilesize + ))); } else { OCP\JSON::error(array("data" => array( "message" => "Could not delete:\n" . $filesWithError, - 'uploadMaxFilesize'=>$maxUploadFilesize, - 'maxHumanFilesize'=>$maxHumanFilesize - ))); + 'uploadMaxFilesize'=>$maxUploadFilesize, + 'maxHumanFilesize'=>$maxHumanFilesize + ))); } diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 35463095988..93398019608 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -18,9 +18,9 @@ $maxHumanFilesize=$l->t('Upload') . ' max. '.$maxHumanFilesize; if (!isset($_FILES['files'])) { OCP\JSON::error(array('data' => array( 'message' => $l->t( 'No file was uploaded. Unknown error' ), - 'uploadMaxFilesize'=>$maxUploadFilesize, - 'maxHumanFilesize'=>$maxHumanFilesize - ))); + 'uploadMaxFilesize'=>$maxUploadFilesize, + 'maxHumanFilesize'=>$maxHumanFilesize + ))); exit(); } @@ -38,9 +38,9 @@ foreach ($_FILES['files']['error'] as $error) { UPLOAD_ERR_CANT_WRITE=>$l->t('Failed to write to disk'), ); OCP\JSON::error(array('data' => array( 'message' => $errors[$error], - 'uploadMaxFilesize'=>$maxUploadFilesize, - 'maxHumanFilesize'=>$maxHumanFilesize - ))); + 'uploadMaxFilesize'=>$maxUploadFilesize, + 'maxHumanFilesize'=>$maxHumanFilesize + ))); exit(); } } @@ -55,8 +55,8 @@ foreach($files['size'] as $size) { } if($totalSize>OC_Filesystem::free_space($dir)) { OCP\JSON::error(array('data' => array( 'message' => $l->t( 'Not enough space available' ), - 'uploadMaxFilesize'=>$maxUploadFilesize, - 'maxHumanFilesize'=>$maxHumanFilesize))); + 'uploadMaxFilesize'=>$maxUploadFilesize, + 'maxHumanFilesize'=>$maxHumanFilesize))); exit(); } @@ -70,19 +70,19 @@ if(strpos($dir, '..') === false) { if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) { $meta = OC_FileCache::get($target); $id = OC_FileCache::getId($target); - // updated max file size after upload - $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir); - $maxHumanFilesize=OCP\Util::humanFileSize($maxUploadFilesize); - $maxHumanFilesize=$l->t('Upload') . ' max. '.$maxHumanFilesize; + // updated max file size after upload + $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir); + $maxHumanFilesize=OCP\Util::humanFileSize($maxUploadFilesize); + $maxHumanFilesize=$l->t('Upload') . ' max. '.$maxHumanFilesize; - $result[]=array( 'status' => 'success', + $result[]=array( 'status' => 'success', 'mime'=>$meta['mimetype'], 'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target), - 'uploadMaxFilesize'=>$maxUploadFilesize, - 'maxHumanFilesize'=>$maxHumanFilesize - ); + 'uploadMaxFilesize'=>$maxUploadFilesize, + 'maxHumanFilesize'=>$maxHumanFilesize + ); } } OCP\JSON::encodedPrint($result); @@ -92,6 +92,6 @@ if(strpos($dir, '..') === false) { } OCP\JSON::error(array('data' => array('message' => $error, - 'uploadMaxFilesize'=>$maxUploadFilesize, - 'maxHumanFilesize'=>$maxHumanFilesize + 'uploadMaxFilesize'=>$maxUploadFilesize, + 'maxHumanFilesize'=>$maxHumanFilesize ))); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 440aeeaf6a6..a4836e6c504 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -26,23 +26,23 @@ Files={ }); procesSelection(); }, - updateMaxUploadFilesize:function(response) { - if(response == undefined) { - return; - } - if(response.data !== undefined && response.data.uploadMaxFilesize !== undefined) { - $('#max_upload').val(response.data.uploadMaxFilesize); - $('#data-upload-form a').attr('original-title', response.data.maxHumanFilesize); - } - if(response[0] == undefined) { - return; - } - if(response[0].uploadMaxFilesize !== undefined) { - $('#max_upload').val(response[0].uploadMaxFilesize); - $('#data-upload-form a').attr('original-title', response[0].maxHumanFilesize); - } - - }, + updateMaxUploadFilesize:function(response) { + if(response == undefined) { + return; + } + if(response.data !== undefined && response.data.uploadMaxFilesize !== undefined) { + $('#max_upload').val(response.data.uploadMaxFilesize); + $('#data-upload-form a').attr('original-title', response.data.maxHumanFilesize); + } + if(response[0] == undefined) { + return; + } + if(response[0].uploadMaxFilesize !== undefined) { + $('#max_upload').val(response[0].uploadMaxFilesize); + $('#data-upload-form a').attr('original-title', response[0].maxHumanFilesize); + } + + }, isFileNameValid:function (name) { if (name === '.') { $('#notification').text(t('files', '\'.\' is an invalid file name.')); @@ -333,7 +333,7 @@ $(document).ready(function() { $('#notification').text(t('files', response.data.message)); $('#notification').fadeIn(); } - Files.updateMaxUploadFilesize(response); + Files.updateMaxUploadFilesize(response); var file=response[0]; // TODO: this doesn't work if the file name has been changed server side delete uploadingFiles[dirName][file.name]; @@ -386,9 +386,9 @@ $(document).ready(function() { .success(function(result, textStatus, jqXHR) { var response; response=jQuery.parseJSON(result); - Files.updateMaxUploadFilesize(response); + Files.updateMaxUploadFilesize(response); - if(response[0] != undefined && response[0].status == 'success') { + if(response[0] != undefined && response[0].status == 'success') { var file=response[0]; delete uploadingFiles[file.name]; $('tr').filterAttr('data-file',file.name).data('mime',file.mime).data('id',file.id); @@ -421,8 +421,8 @@ $(document).ready(function() { data.submit().success(function(data, status) { // in safari data is a string response = jQuery.parseJSON(typeof data === 'string' ? data : data[0].body.innerText); - Files.updateMaxUploadFilesize(response); - if(response[0] != undefined && response[0].status == 'success') { + Files.updateMaxUploadFilesize(response); + if(response[0] != undefined && response[0].status == 'success') { var file=response[0]; delete uploadingFiles[file.name]; $('tr').filterAttr('data-file',file.name).data('mime',file.mime).data('id',file.id); @@ -787,7 +787,7 @@ scanFiles.scanning=false; function boolOperationFinished(data, callback) { result = jQuery.parseJSON(data.responseText); - Files.updateMaxUploadFilesize(result); + Files.updateMaxUploadFilesize(result); if(result.status == 'success'){ callback.call(); } else { |