diff options
author | kondou <kondou@ts.unde.re> | 2013-08-18 00:38:52 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-18 00:38:52 +0200 |
commit | edd92e4c09151238a89816186914f9382293ab9b (patch) | |
tree | e25d87cecf45ff2c2189198e5369f7754e01873a /apps/files_versions | |
parent | 1348330c7d75d2b60d845a43be57dedc6199ea1a (diff) | |
parent | 12f4494de02457d51004ca6a82c1b2160189819f (diff) | |
download | nextcloud-server-edd92e4c09151238a89816186914f9382293ab9b.tar.gz nextcloud-server-edd92e4c09151238a89816186914f9382293ab9b.zip |
Merge branch 'master' into fix_jslint_kondou
Conflicts:
apps/files/js/file-upload.js
Diffstat (limited to 'apps/files_versions')
57 files changed, 229 insertions, 89 deletions
diff --git a/apps/files_versions/css/versions.css b/apps/files_versions/css/versions.css index 6146eda3372..6a9b3a95698 100644 --- a/apps/files_versions/css/versions.css +++ b/apps/files_versions/css/versions.css @@ -1,3 +1,7 @@ +#dropdown.drop-versions { + width:22em; +} + #found_versions li { width: 100%; cursor: default; @@ -39,6 +43,3 @@ float: right; } -.drop-versions #makelink { - float: left; -} diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index 9c3c74721f0..f57e931bad9 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -104,9 +104,9 @@ function createVersionsDropdown(filename, files) { success: function(result) { var versions = result.data.versions; if (result.data.endReached === true) { - document.getElementById("show-more-versions").style.display="none"; + $("#show-more-versions").css("display", "none"); } else { - document.getElementById("show-more-versions").style.display="block"; + $("#show-more-versions").css("display", "block"); } if (versions) { $.each(versions, function(index, row) { @@ -132,8 +132,6 @@ function createVersionsDropdown(filename, files) { var download ='<a href="' + path + "?file=" + files + '&revision=' + revision.version + '">'; download+='<img'; download+=' src="' + OC.imagePath('core', 'actions/download') + '"'; - download+=' id="' + revision.version + '"'; - download+=' value="' + files + '"'; download+=' name="downloadVersion" />'; download+=name; download+='</a>'; @@ -143,8 +141,6 @@ function createVersionsDropdown(filename, files) { revert+=' value="' + files + '">'; revert+='<img'; revert+=' src="' + OC.imagePath('core', 'actions/history') + '"'; - revert+=' id="' + revision.version + '"'; - revert+=' value="' + files + '"'; revert+=' name="revertVersion"'; revert+='/>'+t('files_versions', 'Restore')+'</span>'; diff --git a/apps/files_versions/l10n/ar.php b/apps/files_versions/l10n/ar.php index 278b793a86d..53eae8e9fee 100644 --- a/apps/files_versions/l10n/ar.php +++ b/apps/files_versions/l10n/ar.php @@ -1,4 +1,6 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "الإصدارات", "Restore" => "استعيد" ); +$PLURAL_FORMS = "nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;"; diff --git a/apps/files_versions/l10n/bg_BG.php b/apps/files_versions/l10n/bg_BG.php index 25254cfb4d8..6268f408f7a 100644 --- a/apps/files_versions/l10n/bg_BG.php +++ b/apps/files_versions/l10n/bg_BG.php @@ -1,4 +1,6 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "Версии", "Restore" => "Възтановяване" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/bn_BD.php b/apps/files_versions/l10n/bn_BD.php index f3b0071a356..ce7f81b0095 100644 --- a/apps/files_versions/l10n/bn_BD.php +++ b/apps/files_versions/l10n/bn_BD.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "ভার্সন" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/ca.php b/apps/files_versions/l10n/ca.php index 4f92c341200..e5c47a277f9 100644 --- a/apps/files_versions/l10n/ca.php +++ b/apps/files_versions/l10n/ca.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "No s'ha pogut revertir: %s", "Versions" => "Versions", +"Failed to revert {file} to revision {timestamp}." => "Ha fallat en retornar {file} a la revisió {timestamp}", +"More versions..." => "Més versions...", +"No other versions available" => "No hi ha altres versions disponibles", "Restore" => "Recupera" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/cs_CZ.php b/apps/files_versions/l10n/cs_CZ.php index bc6f4cf4a19..45ce297eae5 100644 --- a/apps/files_versions/l10n/cs_CZ.php +++ b/apps/files_versions/l10n/cs_CZ.php @@ -1,8 +1,10 @@ -<?php $TRANSLATIONS = array( -"Could not revert: %s" => "Nelze navrátit: %s", +<?php +$TRANSLATIONS = array( +"Could not revert: %s" => "Nelze vrátit: %s", "Versions" => "Verze", -"Failed to revert {file} to revision {timestamp}." => "Selhalo navrácení souboru {file} na verzi {timestamp}.", +"Failed to revert {file} to revision {timestamp}." => "Selhalo vrácení souboru {file} na verzi {timestamp}.", "More versions..." => "Více verzí...", "No other versions available" => "Žádné další verze nejsou dostupné", "Restore" => "Obnovit" ); +$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files_versions/l10n/da.php b/apps/files_versions/l10n/da.php index 4a94a749f2e..a18bc717708 100644 --- a/apps/files_versions/l10n/da.php +++ b/apps/files_versions/l10n/da.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Kunne ikke genskabe: %s", "Versions" => "Versioner", "Failed to revert {file} to revision {timestamp}." => "Kunne ikke tilbagerulle {file} til den tidligere udgave: {timestamp}.", @@ -6,3 +7,4 @@ "No other versions available" => "Ingen andre versioner tilgængelig", "Restore" => "Gendan" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/de.php b/apps/files_versions/l10n/de.php index e89c216fe43..c8b45eee500 100644 --- a/apps/files_versions/l10n/de.php +++ b/apps/files_versions/l10n/de.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Konnte %s nicht zurücksetzen", "Versions" => "Versionen", "Failed to revert {file} to revision {timestamp}." => "Konnte {file} der Revision {timestamp} nicht rückgänging machen.", @@ -6,3 +7,4 @@ "No other versions available" => "Keine anderen Versionen verfügbar", "Restore" => "Wiederherstellen" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/de_DE.php b/apps/files_versions/l10n/de_DE.php index e89c216fe43..c8b45eee500 100644 --- a/apps/files_versions/l10n/de_DE.php +++ b/apps/files_versions/l10n/de_DE.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Konnte %s nicht zurücksetzen", "Versions" => "Versionen", "Failed to revert {file} to revision {timestamp}." => "Konnte {file} der Revision {timestamp} nicht rückgänging machen.", @@ -6,3 +7,4 @@ "No other versions available" => "Keine anderen Versionen verfügbar", "Restore" => "Wiederherstellen" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/el.php b/apps/files_versions/l10n/el.php index d589770553c..af608e7c042 100644 --- a/apps/files_versions/l10n/el.php +++ b/apps/files_versions/l10n/el.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Αδυναμία επαναφοράς του: %s", "Versions" => "Εκδόσεις", +"Failed to revert {file} to revision {timestamp}." => "Αποτυχία επαναφοράς του {file} στην αναθεώρηση {timestamp}.", +"More versions..." => "Περισσότερες εκδόσεις...", +"No other versions available" => "Δεν υπάρχουν άλλες εκδόσεις διαθέσιμες", "Restore" => "Επαναφορά" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/eo.php b/apps/files_versions/l10n/eo.php index 72d8625be9e..c023d5fbc37 100644 --- a/apps/files_versions/l10n/eo.php +++ b/apps/files_versions/l10n/eo.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Ne eblas malfari: %s", "Versions" => "Versioj", "Restore" => "Restaŭri" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/es.php b/apps/files_versions/l10n/es.php index b2857bded17..a6031698e06 100644 --- a/apps/files_versions/l10n/es.php +++ b/apps/files_versions/l10n/es.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "No se puede revertir: %s", "Versions" => "Revisiones", +"Failed to revert {file} to revision {timestamp}." => "No se ha podido revertir {archivo} a revisión {timestamp}.", +"More versions..." => "Más...", +"No other versions available" => "No hay otras versiones disponibles", "Restore" => "Recuperar" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/es_AR.php b/apps/files_versions/l10n/es_AR.php index ec55fa8ebf5..068f835d0af 100644 --- a/apps/files_versions/l10n/es_AR.php +++ b/apps/files_versions/l10n/es_AR.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "No se pudo revertir: %s ", "Versions" => "Versiones", "Restore" => "Recuperar" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/et_EE.php b/apps/files_versions/l10n/et_EE.php index 271d424df43..ba8b516e856 100644 --- a/apps/files_versions/l10n/et_EE.php +++ b/apps/files_versions/l10n/et_EE.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Ei suuda taastada faili: %s", "Versions" => "Versioonid", +"Failed to revert {file} to revision {timestamp}." => "Ebaõnnestus faili {file} taastamine revisjonile {timestamp}", +"More versions..." => "Rohkem versioone...", +"No other versions available" => "Muid versioone pole saadaval", "Restore" => "Taasta" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/eu.php b/apps/files_versions/l10n/eu.php index 918b20fb0fd..249ae096630 100644 --- a/apps/files_versions/l10n/eu.php +++ b/apps/files_versions/l10n/eu.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Ezin izan da leheneratu: %s", "Versions" => "Bertsioak", "Failed to revert {file} to revision {timestamp}." => "Errore bat izan da {fitxategia} {timestamp} bertsiora leheneratzean.", @@ -6,3 +7,4 @@ "No other versions available" => "Ez dago bertsio gehiago eskuragarri", "Restore" => "Berrezarri" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/fa.php b/apps/files_versions/l10n/fa.php index 9f77e526624..8edfc2ee265 100644 --- a/apps/files_versions/l10n/fa.php +++ b/apps/files_versions/l10n/fa.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "بازگردانی امکان ناپذیر است: %s", "Versions" => "نسخه ها", "Restore" => "بازیابی" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/fi_FI.php b/apps/files_versions/l10n/fi_FI.php index 9f6f38ce05d..fb011df2a13 100644 --- a/apps/files_versions/l10n/fi_FI.php +++ b/apps/files_versions/l10n/fi_FI.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Palautus epäonnistui: %s", "Versions" => "Versiot", "Failed to revert {file} to revision {timestamp}." => "Tiedoston {file} palautus versioon {timestamp} epäonnistui.", @@ -6,3 +7,4 @@ "No other versions available" => "Ei muita versioita saatavilla", "Restore" => "Palauta" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/fr.php b/apps/files_versions/l10n/fr.php index 74931bd7046..537783e6c9f 100644 --- a/apps/files_versions/l10n/fr.php +++ b/apps/files_versions/l10n/fr.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Impossible de restaurer %s", "Versions" => "Versions", "Restore" => "Restaurer" ); +$PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files_versions/l10n/gl.php b/apps/files_versions/l10n/gl.php index 66e3ccc5dc7..1ccdc95f1eb 100644 --- a/apps/files_versions/l10n/gl.php +++ b/apps/files_versions/l10n/gl.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Non foi posíbel reverter: %s", "Versions" => "Versións", "Failed to revert {file} to revision {timestamp}." => "Non foi posíbel reverter {file} á revisión {timestamp}.", @@ -6,3 +7,4 @@ "No other versions available" => "Non hai outras versións dispoñíbeis", "Restore" => "Restablecer" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/he.php b/apps/files_versions/l10n/he.php index bcac74be08b..848e4712276 100644 --- a/apps/files_versions/l10n/he.php +++ b/apps/files_versions/l10n/he.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "לא ניתן להחזיר: %s", "Versions" => "גרסאות", "Restore" => "שחזור" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/hu_HU.php b/apps/files_versions/l10n/hu_HU.php index fe3db5211f8..13b3fe7cace 100644 --- a/apps/files_versions/l10n/hu_HU.php +++ b/apps/files_versions/l10n/hu_HU.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Nem sikerült átállni a változatra: %s", "Versions" => "Az állományok korábbi változatai", +"Failed to revert {file} to revision {timestamp}." => "Nem sikerült a(z) {file} állományt erre visszaállítani: {timestamp}.", +"More versions..." => "További változatok...", +"No other versions available" => "Az állománynak nincs több változata", "Restore" => "Visszaállítás" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/id.php b/apps/files_versions/l10n/id.php index 96d96130d18..ee7061805ba 100644 --- a/apps/files_versions/l10n/id.php +++ b/apps/files_versions/l10n/id.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Tidak dapat mengembalikan: %s", "Versions" => "Versi", "Restore" => "Pulihkan" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/is.php b/apps/files_versions/l10n/is.php index d165a78c31e..0f643122ad0 100644 --- a/apps/files_versions/l10n/is.php +++ b/apps/files_versions/l10n/is.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "Útgáfur" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/it.php b/apps/files_versions/l10n/it.php index b59d2edfec9..6e4aee450a6 100644 --- a/apps/files_versions/l10n/it.php +++ b/apps/files_versions/l10n/it.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Impossibile ripristinare: %s", "Versions" => "Versioni", "Failed to revert {file} to revision {timestamp}." => "Ripristino di {file} alla revisione {timestamp} non riuscito.", @@ -6,3 +7,4 @@ "No other versions available" => "Non sono disponibili altre versioni", "Restore" => "Ripristina" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/ja_JP.php b/apps/files_versions/l10n/ja_JP.php index d8a99c4980d..ec2601aafbd 100644 --- a/apps/files_versions/l10n/ja_JP.php +++ b/apps/files_versions/l10n/ja_JP.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "元に戻せませんでした: %s", "Versions" => "バージョン", +"Failed to revert {file} to revision {timestamp}." => "{file} を {timestamp} のリヴィジョンに戻すことができません。", +"More versions..." => "もっと他のバージョン...", +"No other versions available" => "利用可能な他のバージョンはありません", "Restore" => "復元" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/ka_GE.php b/apps/files_versions/l10n/ka_GE.php index 10fe7e705f3..41e65903b65 100644 --- a/apps/files_versions/l10n/ka_GE.php +++ b/apps/files_versions/l10n/ka_GE.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "ვერ მოხერხდა უკან დაბრუნება: %s", "Versions" => "ვერსიები", "Restore" => "აღდგენა" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/ko.php b/apps/files_versions/l10n/ko.php index 59856397f5a..365adc25115 100644 --- a/apps/files_versions/l10n/ko.php +++ b/apps/files_versions/l10n/ko.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "되돌릴 수 없습니다: %s", "Versions" => "버전", "Restore" => "복원" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/ku_IQ.php b/apps/files_versions/l10n/ku_IQ.php index 9132caf75e3..de2696509bb 100644 --- a/apps/files_versions/l10n/ku_IQ.php +++ b/apps/files_versions/l10n/ku_IQ.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "وهشان" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/lt_LT.php b/apps/files_versions/l10n/lt_LT.php index 84963febb53..4e1af5fcc29 100644 --- a/apps/files_versions/l10n/lt_LT.php +++ b/apps/files_versions/l10n/lt_LT.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Nepavyko atstatyti: %s", "Versions" => "Versijos", "Restore" => "Atstatyti" ); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_versions/l10n/lv.php b/apps/files_versions/l10n/lv.php index 90d54e35de1..c686370ac31 100644 --- a/apps/files_versions/l10n/lv.php +++ b/apps/files_versions/l10n/lv.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Nevarēja atgriezt — %s", "Versions" => "Versijas", "Restore" => "Atjaunot" ); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"; diff --git a/apps/files_versions/l10n/mk.php b/apps/files_versions/l10n/mk.php index 6a1882c2bfd..01a98808cff 100644 --- a/apps/files_versions/l10n/mk.php +++ b/apps/files_versions/l10n/mk.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "Версии" ); +$PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files_versions/l10n/nb_NO.php b/apps/files_versions/l10n/nb_NO.php index 18ff750f861..2a0a6d8a76d 100644 --- a/apps/files_versions/l10n/nb_NO.php +++ b/apps/files_versions/l10n/nb_NO.php @@ -1,4 +1,6 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "Versjoner", "Restore" => "Gjenopprett" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/nl.php b/apps/files_versions/l10n/nl.php index 77f3e1836cf..ec7551d9596 100644 --- a/apps/files_versions/l10n/nl.php +++ b/apps/files_versions/l10n/nl.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Kon niet terugdraaien: %s", "Versions" => "Versies", "Failed to revert {file} to revision {timestamp}." => "Kon {file} niet terugdraaien naar revisie {timestamp}.", @@ -6,3 +7,4 @@ "No other versions available" => "Geen andere versies beschikbaar", "Restore" => "Herstellen" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/nn_NO.php b/apps/files_versions/l10n/nn_NO.php index ce6db36a55e..79b518bc18d 100644 --- a/apps/files_versions/l10n/nn_NO.php +++ b/apps/files_versions/l10n/nn_NO.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Klarte ikkje å tilbakestilla: %s", "Versions" => "Utgåver", "Restore" => "Gjenopprett" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/pl.php b/apps/files_versions/l10n/pl.php index 3f4f61ec9e8..3d6be24a63d 100644 --- a/apps/files_versions/l10n/pl.php +++ b/apps/files_versions/l10n/pl.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Nie można było przywrócić: %s", "Versions" => "Wersje", +"Failed to revert {file} to revision {timestamp}." => "Nie udało się przywrócić zmiany {sygnatura czasowa} {plik}.", +"More versions..." => "Więcej wersji...", +"No other versions available" => "Nie są dostępne żadne inne wersje", "Restore" => "Przywróć" ); +$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_versions/l10n/pt_BR.php b/apps/files_versions/l10n/pt_BR.php index 711a38b3bf4..b1958825b47 100644 --- a/apps/files_versions/l10n/pt_BR.php +++ b/apps/files_versions/l10n/pt_BR.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Impossível reverter: %s", "Versions" => "Versões", "Failed to revert {file} to revision {timestamp}." => "Falha ao reverter {file} para a revisão {timestamp}.", @@ -6,3 +7,4 @@ "No other versions available" => "Nenhuma outra versão disponível", "Restore" => "Restaurar" ); +$PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files_versions/l10n/pt_PT.php b/apps/files_versions/l10n/pt_PT.php index b0262765ca1..e4371f53409 100644 --- a/apps/files_versions/l10n/pt_PT.php +++ b/apps/files_versions/l10n/pt_PT.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Não foi possível reverter: %s", "Versions" => "Versões", "Failed to revert {file} to revision {timestamp}." => "Falhou a recuperação do ficheiro {file} para a revisão {timestamp}.", @@ -6,3 +7,4 @@ "No other versions available" => "Não existem versões mais antigas", "Restore" => "Restaurar" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/ro.php b/apps/files_versions/l10n/ro.php index 240cd181aed..5151b1dceb9 100644 --- a/apps/files_versions/l10n/ro.php +++ b/apps/files_versions/l10n/ro.php @@ -1,4 +1,6 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Nu a putut reveni: %s", "Versions" => "Versiuni" ); +$PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/apps/files_versions/l10n/ru.php b/apps/files_versions/l10n/ru.php index eb5e404600a..12f9f77b94d 100644 --- a/apps/files_versions/l10n/ru.php +++ b/apps/files_versions/l10n/ru.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Не может быть возвращён: %s", "Versions" => "Версии", "Failed to revert {file} to revision {timestamp}." => "Не удалось возвратить {file} к ревизии {timestamp}.", @@ -6,3 +7,4 @@ "No other versions available" => "Других версий не доступно", "Restore" => "Восстановить" ); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_versions/l10n/ru_RU.php b/apps/files_versions/l10n/ru_RU.php deleted file mode 100644 index 8656e346eb6..00000000000 --- a/apps/files_versions/l10n/ru_RU.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php $TRANSLATIONS = array( -"History" => "История", -"Files Versioning" => "Файлы управления версиями", -"Enable" => "Включить" -); diff --git a/apps/files_versions/l10n/si_LK.php b/apps/files_versions/l10n/si_LK.php index c7ee63d8ef6..7ee8da049b7 100644 --- a/apps/files_versions/l10n/si_LK.php +++ b/apps/files_versions/l10n/si_LK.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "අනුවාද" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/sk_SK.php b/apps/files_versions/l10n/sk_SK.php index e22a5bb33f6..5edcea3606c 100644 --- a/apps/files_versions/l10n/sk_SK.php +++ b/apps/files_versions/l10n/sk_SK.php @@ -1,5 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Nemožno obnoviť: %s", "Versions" => "Verzie", +"Failed to revert {file} to revision {timestamp}." => "Zlyhalo obnovenie súboru {file} na verziu {timestamp}.", +"More versions..." => "Viac verzií...", +"No other versions available" => "Žiadne ďalšie verzie nie sú dostupné", "Restore" => "Obnoviť" ); +$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files_versions/l10n/sl.php b/apps/files_versions/l10n/sl.php index 4b1c10c773b..809ab34c262 100644 --- a/apps/files_versions/l10n/sl.php +++ b/apps/files_versions/l10n/sl.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Ni mogoče povrniti: %s", "Versions" => "Različice", "Restore" => "Obnovi" ); +$PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"; diff --git a/apps/files_versions/l10n/sr.php b/apps/files_versions/l10n/sr.php index 111fa776884..d4eb0be19cb 100644 --- a/apps/files_versions/l10n/sr.php +++ b/apps/files_versions/l10n/sr.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Restore" => "Врати" ); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_versions/l10n/sv.php b/apps/files_versions/l10n/sv.php index 86d215e5016..0fd073d5cbe 100644 --- a/apps/files_versions/l10n/sv.php +++ b/apps/files_versions/l10n/sv.php @@ -1,4 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Kunde inte återställa: %s", "Versions" => "Versioner", "Failed to revert {file} to revision {timestamp}." => "Kunde inte återställa {file} till revision {timestamp}.", @@ -6,3 +7,4 @@ "No other versions available" => "Inga andra versioner tillgängliga", "Restore" => "Återskapa" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/ta_LK.php b/apps/files_versions/l10n/ta_LK.php index 61a47e42f0a..3c21735fa84 100644 --- a/apps/files_versions/l10n/ta_LK.php +++ b/apps/files_versions/l10n/ta_LK.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "பதிப்புகள்" ); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_versions/l10n/th_TH.php b/apps/files_versions/l10n/th_TH.php index d42608287a6..97c89b2f809 100644 --- a/apps/files_versions/l10n/th_TH.php +++ b/apps/files_versions/l10n/th_TH.php @@ -1,4 +1,6 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "รุ่น", "Restore" => "คืนค่า" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/tr.php b/apps/files_versions/l10n/tr.php index 23da6b6b43d..f2bc1e6c0aa 100644 --- a/apps/files_versions/l10n/tr.php +++ b/apps/files_versions/l10n/tr.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Geri alınamıyor: %s", "Versions" => "Sürümler", "Restore" => "Geri yükle" ); +$PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files_versions/l10n/ug.php b/apps/files_versions/l10n/ug.php index 3b63272d927..984e6c314c7 100644 --- a/apps/files_versions/l10n/ug.php +++ b/apps/files_versions/l10n/ug.php @@ -1,4 +1,6 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "ئەسلىگە قايتۇرالمايدۇ: %s", "Versions" => "نەشرى" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/uk.php b/apps/files_versions/l10n/uk.php index afe44ff3be0..d75160f2864 100644 --- a/apps/files_versions/l10n/uk.php +++ b/apps/files_versions/l10n/uk.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Не вдалося відновити: %s", "Versions" => "Версії", "Restore" => "Відновити" ); +$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_versions/l10n/vi.php b/apps/files_versions/l10n/vi.php index f3677c8a775..9d72612c2ad 100644 --- a/apps/files_versions/l10n/vi.php +++ b/apps/files_versions/l10n/vi.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "Không thể khôi phục: %s", "Versions" => "Phiên bản", "Restore" => "Khôi phục" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/zh_CN.GB2312.php b/apps/files_versions/l10n/zh_CN.GB2312.php index e5f4733da8d..de340d6dc94 100644 --- a/apps/files_versions/l10n/zh_CN.GB2312.php +++ b/apps/files_versions/l10n/zh_CN.GB2312.php @@ -1,4 +1,10 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "无法恢复:%s", -"Versions" => "版本" +"Versions" => "版本", +"Failed to revert {file} to revision {timestamp}." => "无法恢复文件 {file} 到 版本 {timestamp}。", +"More versions..." => "更多版本", +"No other versions available" => "没有其他可用版本", +"Restore" => "恢复" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/zh_CN.php b/apps/files_versions/l10n/zh_CN.php index 8dd2559414e..767ca1cf646 100644 --- a/apps/files_versions/l10n/zh_CN.php +++ b/apps/files_versions/l10n/zh_CN.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "无法恢复: %s", "Versions" => "版本", "Restore" => "恢复" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/zh_HK.php b/apps/files_versions/l10n/zh_HK.php index 072d5fbdba8..6d249af4b16 100644 --- a/apps/files_versions/l10n/zh_HK.php +++ b/apps/files_versions/l10n/zh_HK.php @@ -1,3 +1,5 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Versions" => "版本" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/l10n/zh_TW.php b/apps/files_versions/l10n/zh_TW.php index 7498c6951cd..55a3dca3c32 100644 --- a/apps/files_versions/l10n/zh_TW.php +++ b/apps/files_versions/l10n/zh_TW.php @@ -1,5 +1,7 @@ -<?php $TRANSLATIONS = array( +<?php +$TRANSLATIONS = array( "Could not revert: %s" => "無法還原:%s", "Versions" => "版本", "Restore" => "復原" ); +$PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 7c75d70f79c..0b4699dc5c0 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -48,14 +48,14 @@ class Storage { /** * get current size of all versions from a given user - * + * * @param $user user who owns the versions * @return mixed versions size or false if no versions size is stored */ private static function getVersionsSize($user) { $query = \OC_DB::prepare('SELECT `size` FROM `*PREFIX*files_versions` WHERE `user`=?'); $result = $query->execute(array($user))->fetchAll(); - + if ($result) { return $result[0]['size']; } @@ -64,7 +64,7 @@ class Storage { /** * write to the database how much space is in use for versions - * + * * @param $user owner of the versions * @param $size size of the versions */ @@ -76,20 +76,20 @@ class Storage { } $query->execute(array($size, $user)); } - + /** * store a new version of a file. */ public static function store($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - + // if the file gets streamed we need to remove the .part extension // to get the right target $ext = pathinfo($filename, PATHINFO_EXTENSION); if ($ext === 'part') { $filename = substr($filename, 0, strlen($filename)-5); } - + list($uid, $filename) = self::getUidAndFilename($filename); $files_view = new \OC\Files\View('/'.$uid .'/files'); @@ -101,17 +101,15 @@ class Storage { return false; } - // we should have a source file to work with - if (!$files_view->file_exists($filename)) { + // we should have a source file to work with, and the file shouldn't + // be empty + $fileExists = $files_view->file_exists($filename); + if (!($fileExists && $files_view->filesize($filename) > 0)) { return false; } // create all parent folders - $info=pathinfo($filename); - $versionsFolderName=$versions_view->getLocalFolder(''); - if(!file_exists($versionsFolderName.'/'.$info['dirname'])) { - mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true); - } + self::createMissingDirectories($filename, $users_view); $versionsSize = self::getVersionsSize($uid); if ( $versionsSize === false || $versionsSize < 0 ) { @@ -171,7 +169,7 @@ class Storage { list($uidn, $newpath) = self::getUidAndFilename($new_path); $versions_view = new \OC\Files\View('/'.$uid .'/files_versions'); $files_view = new \OC\Files\View('/'.$uid .'/files'); - + // if the file already exists than it was a upload of a existing file // over the web interface -> store() is the right function we need here if ($files_view->file_exists($newpath)) { @@ -180,13 +178,12 @@ class Storage { self::expire($newpath); - $abs_newpath = $versions_view->getLocalFile($newpath); - if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) { $versions_view->rename($oldpath, $newpath); } else if ( ($versions = Storage::getVersions($uid, $oldpath)) ) { - $info=pathinfo($abs_newpath); - if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true); + // create missing dirs if necessary + self::createMissingDirectories($newpath, new \OC\Files\View('/'. $uidn)); + foreach ($versions as $v) { $versions_view->rename($oldpath.'.v'.$v['version'], $newpath.'.v'.$v['version']); } @@ -432,7 +429,7 @@ class Storage { } else { $quota = \OCP\Util::computerFileSize($quota); } - + // make sure that we have the current size of the version history if ( $versionsSize === null ) { $versionsSize = self::getVersionsSize($uid); @@ -565,4 +562,21 @@ class Storage { return $size; } + /** + * @brief create recursively missing directories + * @param string $filename $path to a file + * @param \OC\Files\View $view view on data/user/ + */ + private static function createMissingDirectories($filename, $view) { + $dirname = \OC_Filesystem::normalizePath(dirname($filename)); + $dirParts = explode('/', $dirname); + $dir = "/files_versions"; + foreach ($dirParts as $part) { + $dir = $dir . '/' . $part; + if (!$view->file_exists($dir)) { + $view->mkdir($dir); + } + } + } + } |