aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/index.php4
-rw-r--r--apps/files/js/fileactions.js2
-rw-r--r--apps/files/l10n/el.php3
-rw-r--r--apps/files/l10n/et_EE.php5
-rw-r--r--apps/files/l10n/pl_PL.php5
-rw-r--r--apps/files/l10n/ro.php2
-rw-r--r--apps/files/l10n/tr.php2
-rw-r--r--apps/files/templates/admin.php42
-rw-r--r--apps/files/tests/js/fileactionsSpec.js26
9 files changed, 53 insertions, 38 deletions
diff --git a/apps/files/index.php b/apps/files/index.php
index 73601d26217..cd9341d3b1d 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -40,7 +40,7 @@ $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
$dir = \OC\Files\Filesystem::normalizePath($dir);
$dirInfo = \OC\Files\Filesystem::getFileInfo($dir);
// Redirect if directory does not exist
-if (!$dirInfo->getType() === 'dir') {
+if (!$dirInfo || !$dirInfo->getType() === 'dir') {
header('Location: ' . OCP\Util::getScriptName() . '');
exit();
}
@@ -97,7 +97,7 @@ $permissions = $dirInfo->getPermissions();
$storageInfo=OC_Helper::getStorageInfo($dir);
$freeSpace=$storageInfo['free'];
$uploadLimit=OCP\Util::uploadLimit();
-$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
+$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir, $freeSpace);
$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
// if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code)
$encryptionInitStatus = 2;
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index a7d1fa9d8a2..732690f047a 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -180,7 +180,7 @@ var FileActions = {
}
var element = $(html);
element.data('action', actions['Delete']);
- element.on('click', {a: null, elem: parent, actionFunc: actions['Delete']}, actionHandler);
+ element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler);
parent.parent().children().last().append(element);
}
diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php
index 9144cf3ea10..c71aa9a35ab 100644
--- a/apps/files/l10n/el.php
+++ b/apps/files/l10n/el.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"File name cannot be empty." => "Το όνομα αρχείου δεν μπορεί να είναι κενό.",
"\"%s\" is an invalid file name." => "Το \"%s\" είναι ένα μη έγκυρο όνομα αρχείου.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Μη έγκυρο όνομα, '\\', '/', '<', '>', ':', '\"', '|', '?' και '*' δεν επιτρέπονται.",
+"The target folder has been moved or deleted." => "Ο φάκελος προορισμού έχει μετακινηθεί ή διαγραφεί.",
"The name %s is already used in the folder %s. Please choose a different name." => "Το όνομα %s χρησιμοποιείτε ήδη στον φάκελο %s. Παρακαλώ επιλέξτε ένα άλλο όνομα.",
"Not a valid source" => "Μη έγκυρη πηγή",
"Server is not allowed to open URLs, please check the server configuration" => "Ο διακομιστής δεν επιτρέπεται να ανοίγει URL, παρακαλώ ελέγξτε τις ρυθμίσεις του διακομιστή",
@@ -28,6 +29,8 @@ $TRANSLATIONS = array(
"Invalid directory." => "Μη έγκυρος φάκελος.",
"Files" => "Αρχεία",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Αδυναμία φόρτωσης {filename} καθώς είναι κατάλογος αρχείων ή έχει 0 bytes",
+"Total file size {size1} exceeds upload limit {size2}" => "Το συνολικό μέγεθος αρχείου {size1} υπερβαίνει το όριο μεταφόρτωσης {size2}",
+"Not enough free space, you are uploading {size1} but only {size2} is left" => "Δεν υπάρχει αρκετός ελεύθερος χώρος, μεταφορτώνετε μέγεθος {size1} αλλά υπάρχει χώρος μόνο {size2}",
"Upload cancelled." => "Η αποστολή ακυρώθηκε.",
"Could not get result from server." => "Αδυναμία λήψης αποτελέσματος από το διακομιστή.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Η αποστολή του αρχείου βρίσκεται σε εξέλιξη. Το κλείσιμο της σελίδας θα ακυρώσει την αποστολή.",
diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php
index f1fdc82673c..74818f99f11 100644
--- a/apps/files/l10n/et_EE.php
+++ b/apps/files/l10n/et_EE.php
@@ -3,7 +3,9 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Ei saa liigutada faili %s - samanimeline fail on juba olemas",
"Could not move %s" => "%s liigutamine ebaõnnestus",
"File name cannot be empty." => "Faili nimi ei saa olla tühi.",
+"\"%s\" is an invalid file name." => "\"%s\" on vigane failinimi.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Vigane nimi, '\\', '/', '<', '>', ':', '\"', '|', '?' ja '*' pole lubatud.",
+"The target folder has been moved or deleted." => "Sihtkataloog on ümber tõstetud või kustutatud.",
"The name %s is already used in the folder %s. Please choose a different name." => "Nimi %s on juba kasutusel kataloogis %s. Palun vali mõni teine nimi.",
"Not a valid source" => "Pole korrektne lähteallikas",
"Server is not allowed to open URLs, please check the server configuration" => "Server ei võimalda URL-ide avamist, palun kontrolli serveri seadistust",
@@ -27,6 +29,8 @@ $TRANSLATIONS = array(
"Invalid directory." => "Vigane kaust.",
"Files" => "Failid",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Ei saa üles laadida {filename}, kuna see on kataloog või selle suurus on 0 baiti",
+"Total file size {size1} exceeds upload limit {size2}" => "Faili suurus {size1} ületab faili üleslaadimise mahu piirangu {size2}.",
+"Not enough free space, you are uploading {size1} but only {size2} is left" => "Pole piisavalt vaba ruumi. Sa laadid üles {size1}, kuid ainult {size2} on saadaval.",
"Upload cancelled." => "Üleslaadimine tühistati.",
"Could not get result from server." => "Serverist ei saadud tulemusi",
"File upload is in progress. Leaving the page now will cancel the upload." => "Faili üleslaadimine on töös. Lehelt lahkumine katkestab selle üleslaadimise.",
@@ -48,6 +52,7 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n fail","%n faili"),
"{dirs} and {files}" => "{dirs} ja {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Laadin üles %n faili","Laadin üles %n faili"),
+"\"{name}\" is an invalid file name." => "\"{name}\" on vigane failinimi.",
"Your storage is full, files can not be updated or synced anymore!" => "Sinu andmemaht on täis! Faile ei uuendata ega sünkroniseerita!",
"Your storage is almost full ({usedSpacePercent}%)" => "Su andmemaht on peaaegu täis ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Krüpteerimisrakend on lubatud, kuid võtmeid pole lähtestatud. Palun logi välja ning uuesti sisse.",
diff --git a/apps/files/l10n/pl_PL.php b/apps/files/l10n/pl_PL.php
deleted file mode 100644
index b67f67b972e..00000000000
--- a/apps/files/l10n/pl_PL.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-$TRANSLATIONS = array(
-"Save" => "Zapisz"
-);
-$PLURAL_FORMS = "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/files/l10n/ro.php b/apps/files/l10n/ro.php
index 7686025e35c..3f192df5b43 100644
--- a/apps/files/l10n/ro.php
+++ b/apps/files/l10n/ro.php
@@ -4,7 +4,9 @@ $TRANSLATIONS = array(
"Could not move %s" => "Nu se poate muta %s",
"File name cannot be empty." => "Numele fișierului nu poate rămâne gol.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nume nevalide, '\\', '/', '<', '>', ':', '\"', '|', '?' și '*' nu sunt permise.",
+"Error while downloading %s to %s" => "Eroare la descarcarea %s in %s",
"Error when creating the file" => "Eroare la crearea fisierului",
+"Folder name cannot be empty." => "Numele folderului nu poate fi liber.",
"Error when creating the folder" => "Eroare la crearea folderului",
"Unable to set upload directory." => "Imposibil de a seta directorul pentru incărcare.",
"Invalid Token" => "Jeton Invalid",
diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php
index a2570e002ac..095578ce65b 100644
--- a/apps/files/l10n/tr.php
+++ b/apps/files/l10n/tr.php
@@ -29,7 +29,7 @@ $TRANSLATIONS = array(
"Invalid directory." => "Geçersiz dizin.",
"Files" => "Dosyalar",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Bir dizin veya 0 bayt olduğundan {filename} yüklenemedi",
-"Total file size {size1} exceeds upload limit {size2}" => "Toplam dosya boyutu {size1} gönderme sınırını {size2} aşıyor",
+"Total file size {size1} exceeds upload limit {size2}" => "Toplam dosya boyutu {size1}, {size2} gönderme sınırını aşıyor",
"Not enough free space, you are uploading {size1} but only {size2} is left" => "Yeterince boş alan yok. Gönderdiğiniz boyut {size1} ancak {size2} alan mevcut",
"Upload cancelled." => "Yükleme iptal edildi.",
"Could not get result from server." => "Sunucudan sonuç alınamadı.",
diff --git a/apps/files/templates/admin.php b/apps/files/templates/admin.php
index a5afd55fbc3..5f7d3261d6c 100644
--- a/apps/files/templates/admin.php
+++ b/apps/files/templates/admin.php
@@ -1,28 +1,26 @@
<?php OCP\Util::addscript('files', 'admin'); ?>
-<form name="filesForm" action='#' method='post'>
- <fieldset class="personalblock">
- <h2><?php p($l->t('File handling')); ?></h2>
- <?php if($_['uploadChangable']):?>
- <label for="maxUploadSize"><?php p($l->t( 'Maximum upload size' )); ?> </label>
- <input type="text" name='maxUploadSize' id="maxUploadSize" value='<?php p($_['uploadMaxFilesize']) ?>'/>
- <?php if($_['displayMaxPossibleUploadSize']):?>
- (<?php p($l->t('max. possible: ')); p($_['maxPossibleUploadSize']) ?>)
- <?php endif;?>
- <br/>
+<form name="filesForm" class="section" action="#" method="post">
+ <h2><?php p($l->t('File handling')); ?></h2>
+ <?php if($_['uploadChangable']):?>
+ <label for="maxUploadSize"><?php p($l->t( 'Maximum upload size' )); ?> </label>
+ <input type="text" name='maxUploadSize' id="maxUploadSize" value='<?php p($_['uploadMaxFilesize']) ?>'/>
+ <?php if($_['displayMaxPossibleUploadSize']):?>
+ (<?php p($l->t('max. possible: ')); p($_['maxPossibleUploadSize']) ?>)
<?php endif;?>
- <input type="checkbox" name="allowZipDownload" id="allowZipDownload" value="1"
- title="<?php p($l->t( 'Needed for multi-file and folder downloads.' )); ?>"
- <?php if ($_['allowZipDownload']): ?> checked="checked"<?php endif; ?> />
- <label for="allowZipDownload"><?php p($l->t( 'Enable ZIP-download' )); ?></label><br/>
+ <br/>
+ <?php endif;?>
+ <input type="checkbox" name="allowZipDownload" id="allowZipDownload" value="1"
+ title="<?php p($l->t( 'Needed for multi-file and folder downloads.' )); ?>"
+ <?php if ($_['allowZipDownload']): ?> checked="checked"<?php endif; ?> />
+ <label for="allowZipDownload"><?php p($l->t( 'Enable ZIP-download' )); ?></label><br/>
- <input type="text" name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php p($_['maxZipInputSize']) ?>'
- title="<?php p($l->t( '0 is unlimited' )); ?>"
- <?php if (!$_['allowZipDownload']): ?> disabled="disabled"<?php endif; ?> /><br />
- <em><?php p($l->t( 'Maximum input size for ZIP files' )); ?> </em><br />
+ <input type="text" name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php p($_['maxZipInputSize']) ?>'
+ title="<?php p($l->t( '0 is unlimited' )); ?>"
+ <?php if (!$_['allowZipDownload']): ?> disabled="disabled"<?php endif; ?> /><br />
+ <em><?php p($l->t( 'Maximum input size for ZIP files' )); ?> </em><br />
- <input type="hidden" value="<?php p($_['requesttoken']); ?>" name="requesttoken" />
- <input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings"
- value="<?php p($l->t( 'Save' )); ?>"/>
- </fieldset>
+ <input type="hidden" value="<?php p($_['requesttoken']); ?>" name="requesttoken" />
+ <input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings"
+ value="<?php p($l->t( 'Save' )); ?>"/>
</form>
diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js
index ef7ddcb874a..80c04b5b242 100644
--- a/apps/files/tests/js/fileactionsSpec.js
+++ b/apps/files/tests/js/fileactionsSpec.js
@@ -38,15 +38,17 @@ describe('FileActions tests', function() {
var $tr = FileList.addFile('testName.txt', 1234, new Date(), false, false, {download_url: 'test/download/url'});
// no actions before call
- expect($tr.find('.action[data-action=Download]').length).toEqual(0);
- expect($tr.find('.action[data-action=Rename]').length).toEqual(0);
+ expect($tr.find('.action.action-download').length).toEqual(0);
+ expect($tr.find('.action.action-rename').length).toEqual(0);
expect($tr.find('.action.delete').length).toEqual(0);
FileActions.display($tr.find('td.filename'), true);
// actions defined after cal
- expect($tr.find('.action[data-action=Download]').length).toEqual(1);
- expect($tr.find('.nametext .action[data-action=Rename]').length).toEqual(1);
+ expect($tr.find('.action.action-download').length).toEqual(1);
+ expect($tr.find('.action.action-download').attr('data-action')).toEqual('Download');
+ expect($tr.find('.nametext .action.action-rename').length).toEqual(1);
+ expect($tr.find('.nametext .action.action-rename').attr('data-action')).toEqual('Rename');
expect($tr.find('.action.delete').length).toEqual(1);
});
it('calling display() twice correctly replaces file actions', function() {
@@ -56,8 +58,8 @@ describe('FileActions tests', function() {
FileActions.display($tr.find('td.filename'), true);
// actions defined after cal
- expect($tr.find('.action[data-action=Download]').length).toEqual(1);
- expect($tr.find('.nametext .action[data-action=Rename]').length).toEqual(1);
+ expect($tr.find('.action.action-download').length).toEqual(1);
+ expect($tr.find('.nametext .action.action-rename').length).toEqual(1);
expect($tr.find('.action.delete').length).toEqual(1);
});
it('redirects to download URL when clicking download', function() {
@@ -66,10 +68,20 @@ describe('FileActions tests', function() {
var $tr = FileList.addFile('test download File.txt', 1234, new Date(), false, false, {download_url: 'test/download/url'});
FileActions.display($tr.find('td.filename'), true);
- $tr.find('.action[data-action=Download]').click();
+ $tr.find('.action-download').click();
expect(redirectStub.calledOnce).toEqual(true);
expect(redirectStub.getCall(0).args[0]).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20download%20File.txt');
redirectStub.restore();
});
+ it('deletes file when clicking delete', function() {
+ var deleteStub = sinon.stub(FileList, 'do_delete');
+ var $tr = FileList.addFile('test delete File.txt', 1234, new Date());
+ FileActions.display($tr.find('td.filename'), true);
+
+ $tr.find('.action.delete').click();
+
+ expect(deleteStub.calledOnce).toEqual(true);
+ deleteStub.restore();
+ });
});