diff options
Diffstat (limited to 'apps/files_trashbin')
66 files changed, 543 insertions, 15 deletions
diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php new file mode 100644 index 00000000000..7a6bd1342ea --- /dev/null +++ b/apps/files_trashbin/ajax/delete.php @@ -0,0 +1,24 @@ +<?php + +OCP\JSON::checkLoggedIn(); +OCP\JSON::callCheck(); + +$file = $_REQUEST['file']; + +$path_parts = pathinfo($file); +if ($path_parts['dirname'] == '.') { + $delimiter = strrpos($file, '.d'); + $filename = substr($file, 0, $delimiter); + $timestamp = substr($file, $delimiter+2); +} else { + $filename = $file; + $timestamp = null; +} + +if (OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp)) { + OCP\JSON::success(array("data" => array("filename" => $file))); +} else { + $l = OC_L10N::get('files_trashbin'); + OCP\JSON::error(array("data" => array("message" => $l->t("Couldn't delete %s permanently", array($file))))); +} + diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index a7bb5b9de2d..cc010979c51 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -1,8 +1,7 @@ <?php -if(!OCP\User::isLoggedIn()) {
- exit;
-} +OCP\JSON::checkLoggedIn(); +OCP\JSON::callCheck(); $files = $_REQUEST['files']; $dirlisting = $_REQUEST['dirlisting']; @@ -23,7 +22,7 @@ foreach ($list as $file) { $timestamp = null; } - if ( !OCA_Trash\Trashbin::restore($file, $filename, $timestamp) ) { + if ( !OCA\Files_Trashbin\Trashbin::restore($file, $filename, $timestamp) ) { $error[] = $filename; } else { $success[$i]['filename'] = $file; @@ -38,8 +37,10 @@ if ( $error ) { foreach ( $error as $e ) { $filelist .= $e.', '; } - OCP\JSON::error(array("data" => array("message" => "Couldn't restore ".rtrim($filelist,', '), "success" => $success, "error" => $error))); + $l = OC_L10N::get('files_trashbin'); + $message = $l->t("Couldn't restore %s", array(rtrim($filelist,', '))); + OCP\JSON::error(array("data" => array("message" => $message, + "success" => $success, "error" => $error))); } else { OCP\JSON::success(array("data" => array("success" => $success))); } - diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php index 3741d42c781..b1a15cd13d1 100644 --- a/apps/files_trashbin/appinfo/app.php +++ b/apps/files_trashbin/appinfo/app.php @@ -1,7 +1,7 @@ <?php -OC::$CLASSPATH['OCA_Trash\Hooks'] = 'apps/files_trashbin/lib/hooks.php';
-OC::$CLASSPATH['OCA_Trash\Trashbin'] = 'apps/files_trashbin/lib/trash.php';
+OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'apps/files_trashbin/lib/hooks.php';
+OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'apps/files_trashbin/lib/trash.php';
-OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA_Trash\Hooks", "remove_hook"); +OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Files_Trashbin\Hooks", "remove_hook"); diff --git a/apps/files_trashbin/js/disableDefaultActions.js b/apps/files_trashbin/js/disableDefaultActions.js index 56b95407dd3..27c3e13db4d 100644 --- a/apps/files_trashbin/js/disableDefaultActions.js +++ b/apps/files_trashbin/js/disableDefaultActions.js @@ -1,3 +1,4 @@ /* disable download and sharing actions */
var disableDownloadActions = true;
var disableSharing = true;
+var trashBinApp = true;
\ No newline at end of file diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index f2797347b82..c3429e7a838 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -21,7 +21,32 @@ $(document).ready(function() { }); }; - + + FileActions.register('all', 'Delete', OC.PERMISSION_READ, function () { + return OC.imagePath('core', 'actions/delete'); + }, function (filename) { + $('.tipsy').remove(); + + var tr=$('tr').filterAttr('data-file', filename); + var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete"); + var oldHTML = deleteAction[0].outerHTML; + var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'delete file permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; + deleteAction[0].outerHTML = newHTML; + + $.post(OC.filePath('files_trashbin','ajax','delete.php'), + {file:tr.attr('data-file') }, + function(result){ + if ( result.status == 'success' ) { + var row = document.getElementById(result.data.filename); + row.parentNode.removeChild(row); + } else { + deleteAction[0].outerHTML = oldHTML; + OC.dialogs.alert(result.data.message, 'Error'); + } + }); + + }); + // Sets the select_all checkbox behaviour : $('#select_all').click(function() { if($(this).attr('checked')){ @@ -66,7 +91,7 @@ $(document).ready(function() { }); $('.undelete').click('click',function(event) { - var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform undelete operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; + var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var files=getSelectedFiles('file'); var fileslist=files.join(';'); var dirlisting=getSelectedFiles('dirlisting')[0]; diff --git a/apps/files_trashbin/l10n/ar.php b/apps/files_trashbin/l10n/ar.php new file mode 100644 index 00000000000..e38130fe2d3 --- /dev/null +++ b/apps/files_trashbin/l10n/ar.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "اسم" +); diff --git a/apps/files_trashbin/l10n/bg_BG.php b/apps/files_trashbin/l10n/bg_BG.php new file mode 100644 index 00000000000..681c1dc5802 --- /dev/null +++ b/apps/files_trashbin/l10n/bg_BG.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Име" +); diff --git a/apps/files_trashbin/l10n/bn_BD.php b/apps/files_trashbin/l10n/bn_BD.php new file mode 100644 index 00000000000..c669eff7e1f --- /dev/null +++ b/apps/files_trashbin/l10n/bn_BD.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "রাম", +"1 folder" => "১টি ফোল্ডার", +"{count} folders" => "{count} টি ফোল্ডার", +"1 file" => "১টি ফাইল", +"{count} files" => "{count} টি ফাইল" +); diff --git a/apps/files_trashbin/l10n/ca.php b/apps/files_trashbin/l10n/ca.php new file mode 100644 index 00000000000..3af33c8a310 --- /dev/null +++ b/apps/files_trashbin/l10n/ca.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "executa l'operació de restauració", +"Name" => "Nom", +"Deleted" => "Eliminat", +"1 folder" => "1 carpeta", +"{count} folders" => "{count} carpetes", +"1 file" => "1 fitxer", +"{count} files" => "{count} fitxers", +"Nothing in here. Your trash bin is empty!" => "La paperera està buida!", +"Restore" => "Recupera" +); diff --git a/apps/files_trashbin/l10n/cs_CZ.php b/apps/files_trashbin/l10n/cs_CZ.php new file mode 100644 index 00000000000..caaaea37436 --- /dev/null +++ b/apps/files_trashbin/l10n/cs_CZ.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "provést obnovu", +"Name" => "Název", +"Deleted" => "Smazáno", +"1 folder" => "1 složka", +"{count} folders" => "{count} složky", +"1 file" => "1 soubor", +"{count} files" => "{count} soubory", +"Nothing in here. Your trash bin is empty!" => "Žádný obsah. Váš koš je prázdný.", +"Restore" => "Obnovit" +); diff --git a/apps/files_trashbin/l10n/da.php b/apps/files_trashbin/l10n/da.php new file mode 100644 index 00000000000..3343b6fc8f6 --- /dev/null +++ b/apps/files_trashbin/l10n/da.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Navn", +"1 folder" => "1 mappe", +"{count} folders" => "{count} mapper", +"1 file" => "1 fil", +"{count} files" => "{count} filer", +"Restore" => "Gendan" +); diff --git a/apps/files_trashbin/l10n/de.php b/apps/files_trashbin/l10n/de.php new file mode 100644 index 00000000000..45dfb9d6057 --- /dev/null +++ b/apps/files_trashbin/l10n/de.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "Wiederherstellung ausführen", +"Name" => "Name", +"Deleted" => "gelöscht", +"1 folder" => "1 Ordner", +"{count} folders" => "{count} Ordner", +"1 file" => "1 Datei", +"{count} files" => "{count} Dateien", +"Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, der Papierkorb ist leer!", +"Restore" => "Wiederherstellen" +); diff --git a/apps/files_trashbin/l10n/de_DE.php b/apps/files_trashbin/l10n/de_DE.php new file mode 100644 index 00000000000..45e30d85a3b --- /dev/null +++ b/apps/files_trashbin/l10n/de_DE.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "Führe die Wiederherstellung aus", +"Name" => "Name", +"Deleted" => "Gelöscht", +"1 folder" => "1 Ordner", +"{count} folders" => "{count} Ordner", +"1 file" => "1 Datei", +"{count} files" => "{count} Dateien", +"Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", +"Restore" => "Wiederherstellen" +); diff --git a/apps/files_trashbin/l10n/el.php b/apps/files_trashbin/l10n/el.php new file mode 100644 index 00000000000..83e359890ea --- /dev/null +++ b/apps/files_trashbin/l10n/el.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Όνομα", +"1 folder" => "1 φάκελος", +"{count} folders" => "{count} φάκελοι", +"1 file" => "1 αρχείο", +"{count} files" => "{count} αρχεία", +"Restore" => "Επαναφορά" +); diff --git a/apps/files_trashbin/l10n/eo.php b/apps/files_trashbin/l10n/eo.php new file mode 100644 index 00000000000..f357e3c10c2 --- /dev/null +++ b/apps/files_trashbin/l10n/eo.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nomo", +"1 folder" => "1 dosierujo", +"{count} folders" => "{count} dosierujoj", +"1 file" => "1 dosiero", +"{count} files" => "{count} dosierujoj", +"Restore" => "Restaŭri" +); diff --git a/apps/files_trashbin/l10n/es.php b/apps/files_trashbin/l10n/es.php new file mode 100644 index 00000000000..b191ffc4246 --- /dev/null +++ b/apps/files_trashbin/l10n/es.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "Restaurar", +"Name" => "Nombre", +"Deleted" => "Eliminado", +"1 folder" => "1 carpeta", +"{count} folders" => "{count} carpetas", +"1 file" => "1 archivo", +"{count} files" => "{count} archivos", +"Nothing in here. Your trash bin is empty!" => "Nada aqui. La papelera esta vacia!", +"Restore" => "Recuperar" +); diff --git a/apps/files_trashbin/l10n/es_AR.php b/apps/files_trashbin/l10n/es_AR.php new file mode 100644 index 00000000000..d2c5f304284 --- /dev/null +++ b/apps/files_trashbin/l10n/es_AR.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nombre", +"1 folder" => "1 directorio", +"{count} folders" => "{count} directorios", +"1 file" => "1 archivo", +"{count} files" => "{count} archivos", +"Restore" => "Recuperar" +); diff --git a/apps/files_trashbin/l10n/et_EE.php b/apps/files_trashbin/l10n/et_EE.php new file mode 100644 index 00000000000..4f46f388020 --- /dev/null +++ b/apps/files_trashbin/l10n/et_EE.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nimi", +"1 folder" => "1 kaust", +"{count} folders" => "{count} kausta", +"1 file" => "1 fail", +"{count} files" => "{count} faili" +); diff --git a/apps/files_trashbin/l10n/eu.php b/apps/files_trashbin/l10n/eu.php new file mode 100644 index 00000000000..a1e3ca53e61 --- /dev/null +++ b/apps/files_trashbin/l10n/eu.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Izena", +"1 folder" => "karpeta bat", +"{count} folders" => "{count} karpeta", +"1 file" => "fitxategi bat", +"{count} files" => "{count} fitxategi", +"Restore" => "Berrezarri" +); diff --git a/apps/files_trashbin/l10n/fa.php b/apps/files_trashbin/l10n/fa.php new file mode 100644 index 00000000000..487d1657985 --- /dev/null +++ b/apps/files_trashbin/l10n/fa.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "نام", +"1 folder" => "1 پوشه", +"{count} folders" => "{ شمار} پوشه ها", +"1 file" => "1 پرونده", +"{count} files" => "{ شمار } فایل ها", +"Restore" => "بازیابی" +); diff --git a/apps/files_trashbin/l10n/fi_FI.php b/apps/files_trashbin/l10n/fi_FI.php new file mode 100644 index 00000000000..de25027f9a8 --- /dev/null +++ b/apps/files_trashbin/l10n/fi_FI.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "suorita palautustoiminto", +"Name" => "Nimi", +"Deleted" => "Poistettu", +"1 folder" => "1 kansio", +"{count} folders" => "{count} kansiota", +"1 file" => "1 tiedosto", +"{count} files" => "{count} tiedostoa", +"Nothing in here. Your trash bin is empty!" => "Tyhjää täynnä! Roskakorissa ei ole mitään.", +"Restore" => "Palauta" +); diff --git a/apps/files_trashbin/l10n/fr.php b/apps/files_trashbin/l10n/fr.php new file mode 100644 index 00000000000..51ade82d908 --- /dev/null +++ b/apps/files_trashbin/l10n/fr.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "effectuer l'opération de restauration", +"Name" => "Nom", +"Deleted" => "Effacé", +"1 folder" => "1 dossier", +"{count} folders" => "{count} dossiers", +"1 file" => "1 fichier", +"{count} files" => "{count} fichiers", +"Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !", +"Restore" => "Restaurer" +); diff --git a/apps/files_trashbin/l10n/gl.php b/apps/files_trashbin/l10n/gl.php new file mode 100644 index 00000000000..bdc3187b20b --- /dev/null +++ b/apps/files_trashbin/l10n/gl.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nome", +"1 folder" => "1 cartafol", +"{count} folders" => "{count} cartafoles", +"1 file" => "1 ficheiro", +"{count} files" => "{count} ficheiros", +"Restore" => "Restablecer" +); diff --git a/apps/files_trashbin/l10n/he.php b/apps/files_trashbin/l10n/he.php new file mode 100644 index 00000000000..d026add5d75 --- /dev/null +++ b/apps/files_trashbin/l10n/he.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "שם", +"1 folder" => "תיקייה אחת", +"{count} folders" => "{count} תיקיות", +"1 file" => "קובץ אחד", +"{count} files" => "{count} קבצים" +); diff --git a/apps/files_trashbin/l10n/hr.php b/apps/files_trashbin/l10n/hr.php new file mode 100644 index 00000000000..52255c7429a --- /dev/null +++ b/apps/files_trashbin/l10n/hr.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Ime" +); diff --git a/apps/files_trashbin/l10n/hu_HU.php b/apps/files_trashbin/l10n/hu_HU.php new file mode 100644 index 00000000000..c4e2b5e2125 --- /dev/null +++ b/apps/files_trashbin/l10n/hu_HU.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Név", +"1 folder" => "1 mappa", +"{count} folders" => "{count} mappa", +"1 file" => "1 fájl", +"{count} files" => "{count} fájl", +"Restore" => "Visszaállítás" +); diff --git a/apps/files_trashbin/l10n/ia.php b/apps/files_trashbin/l10n/ia.php new file mode 100644 index 00000000000..c2581f3de17 --- /dev/null +++ b/apps/files_trashbin/l10n/ia.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nomine" +); diff --git a/apps/files_trashbin/l10n/id.php b/apps/files_trashbin/l10n/id.php new file mode 100644 index 00000000000..1a14d8b7c21 --- /dev/null +++ b/apps/files_trashbin/l10n/id.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "nama" +); diff --git a/apps/files_trashbin/l10n/is.php b/apps/files_trashbin/l10n/is.php new file mode 100644 index 00000000000..416f641a8ef --- /dev/null +++ b/apps/files_trashbin/l10n/is.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nafn", +"1 folder" => "1 mappa", +"{count} folders" => "{count} möppur", +"1 file" => "1 skrá", +"{count} files" => "{count} skrár" +); diff --git a/apps/files_trashbin/l10n/it.php b/apps/files_trashbin/l10n/it.php new file mode 100644 index 00000000000..7def431a42a --- /dev/null +++ b/apps/files_trashbin/l10n/it.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "esegui operazione di ripristino", +"Name" => "Nome", +"Deleted" => "Eliminati", +"1 folder" => "1 cartella", +"{count} folders" => "{count} cartelle", +"1 file" => "1 file", +"{count} files" => "{count} file", +"Nothing in here. Your trash bin is empty!" => "Qui non c'è niente. Il tuo cestino è vuoto.", +"Restore" => "Ripristina" +); diff --git a/apps/files_trashbin/l10n/ja_JP.php b/apps/files_trashbin/l10n/ja_JP.php new file mode 100644 index 00000000000..0b4e1954e74 --- /dev/null +++ b/apps/files_trashbin/l10n/ja_JP.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "復元操作を実行する", +"Name" => "名前", +"Deleted" => "削除済み", +"1 folder" => "1 フォルダ", +"{count} folders" => "{count} フォルダ", +"1 file" => "1 ファイル", +"{count} files" => "{count} ファイル", +"Nothing in here. Your trash bin is empty!" => "ここには何もありません。ゴミ箱は空です!", +"Restore" => "復元" +); diff --git a/apps/files_trashbin/l10n/ka_GE.php b/apps/files_trashbin/l10n/ka_GE.php new file mode 100644 index 00000000000..43dba38f5c7 --- /dev/null +++ b/apps/files_trashbin/l10n/ka_GE.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "სახელი", +"1 folder" => "1 საქაღალდე", +"{count} folders" => "{count} საქაღალდე", +"1 file" => "1 ფაილი", +"{count} files" => "{count} ფაილი" +); diff --git a/apps/files_trashbin/l10n/ko.php b/apps/files_trashbin/l10n/ko.php new file mode 100644 index 00000000000..61acd1276a7 --- /dev/null +++ b/apps/files_trashbin/l10n/ko.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "이름", +"1 folder" => "폴더 1개", +"{count} folders" => "폴더 {count}개", +"1 file" => "파일 1개", +"{count} files" => "파일 {count}개", +"Restore" => "복원" +); diff --git a/apps/files_trashbin/l10n/ku_IQ.php b/apps/files_trashbin/l10n/ku_IQ.php new file mode 100644 index 00000000000..cbdbe4644d1 --- /dev/null +++ b/apps/files_trashbin/l10n/ku_IQ.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "ناو" +); diff --git a/apps/files_trashbin/l10n/lb.php b/apps/files_trashbin/l10n/lb.php new file mode 100644 index 00000000000..d1bd7518663 --- /dev/null +++ b/apps/files_trashbin/l10n/lb.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Numm" +); diff --git a/apps/files_trashbin/l10n/lt_LT.php b/apps/files_trashbin/l10n/lt_LT.php new file mode 100644 index 00000000000..4933e97202f --- /dev/null +++ b/apps/files_trashbin/l10n/lt_LT.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Pavadinimas", +"1 folder" => "1 aplankalas", +"{count} folders" => "{count} aplankalai", +"1 file" => "1 failas", +"{count} files" => "{count} failai" +); diff --git a/apps/files_trashbin/l10n/lv.php b/apps/files_trashbin/l10n/lv.php new file mode 100644 index 00000000000..017a8d285c0 --- /dev/null +++ b/apps/files_trashbin/l10n/lv.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "veikt atjaunošanu", +"Name" => "Nosaukums", +"Deleted" => "Dzēsts", +"1 folder" => "1 mape", +"{count} folders" => "{count} mapes", +"1 file" => "1 datne", +"{count} files" => "{count} datnes", +"Nothing in here. Your trash bin is empty!" => "Šeit nekā nav. Jūsu miskaste ir tukša!", +"Restore" => "Atjaunot" +); diff --git a/apps/files_trashbin/l10n/mk.php b/apps/files_trashbin/l10n/mk.php new file mode 100644 index 00000000000..b983c341e8c --- /dev/null +++ b/apps/files_trashbin/l10n/mk.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Име", +"1 folder" => "1 папка", +"{count} folders" => "{count} папки", +"1 file" => "1 датотека", +"{count} files" => "{count} датотеки" +); diff --git a/apps/files_trashbin/l10n/ms_MY.php b/apps/files_trashbin/l10n/ms_MY.php new file mode 100644 index 00000000000..73e97b496e4 --- /dev/null +++ b/apps/files_trashbin/l10n/ms_MY.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nama" +); diff --git a/apps/files_trashbin/l10n/nb_NO.php b/apps/files_trashbin/l10n/nb_NO.php new file mode 100644 index 00000000000..49364753d13 --- /dev/null +++ b/apps/files_trashbin/l10n/nb_NO.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Navn", +"1 folder" => "1 mappe", +"{count} folders" => "{count} mapper", +"1 file" => "1 fil", +"{count} files" => "{count} filer" +); diff --git a/apps/files_trashbin/l10n/nl.php b/apps/files_trashbin/l10n/nl.php new file mode 100644 index 00000000000..4efa6ecf662 --- /dev/null +++ b/apps/files_trashbin/l10n/nl.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "uitvoeren restore operatie", +"Name" => "Naam", +"Deleted" => "Verwijderd", +"1 folder" => "1 map", +"{count} folders" => "{count} mappen", +"1 file" => "1 bestand", +"{count} files" => "{count} bestanden", +"Nothing in here. Your trash bin is empty!" => "Niets te vinden. Uw prullenbak is leeg!", +"Restore" => "Herstellen" +); diff --git a/apps/files_trashbin/l10n/nn_NO.php b/apps/files_trashbin/l10n/nn_NO.php new file mode 100644 index 00000000000..be60dabdf01 --- /dev/null +++ b/apps/files_trashbin/l10n/nn_NO.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Namn" +); diff --git a/apps/files_trashbin/l10n/oc.php b/apps/files_trashbin/l10n/oc.php new file mode 100644 index 00000000000..2c705193c15 --- /dev/null +++ b/apps/files_trashbin/l10n/oc.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nom" +); diff --git a/apps/files_trashbin/l10n/pl.php b/apps/files_trashbin/l10n/pl.php new file mode 100644 index 00000000000..d2ada4c9466 --- /dev/null +++ b/apps/files_trashbin/l10n/pl.php @@ -0,0 +1,8 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nazwa", +"1 folder" => "1 folder", +"{count} folders" => "{count} foldery", +"1 file" => "1 plik", +"{count} files" => "{count} pliki", +"Restore" => "Przywróć" +); diff --git a/apps/files_trashbin/l10n/pt_BR.php b/apps/files_trashbin/l10n/pt_BR.php new file mode 100644 index 00000000000..db5737d9238 --- /dev/null +++ b/apps/files_trashbin/l10n/pt_BR.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "realizar operação de restauração", +"Name" => "Nome", +"Deleted" => "Excluído", +"1 folder" => "1 pasta", +"{count} folders" => "{count} pastas", +"1 file" => "1 arquivo", +"{count} files" => "{count} arquivos", +"Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!", +"Restore" => "Restaurar" +); diff --git a/apps/files_trashbin/l10n/pt_PT.php b/apps/files_trashbin/l10n/pt_PT.php new file mode 100644 index 00000000000..79930315b0e --- /dev/null +++ b/apps/files_trashbin/l10n/pt_PT.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "Restaurar", +"Name" => "Nome", +"Deleted" => "Apagado", +"1 folder" => "1 pasta", +"{count} folders" => "{count} pastas", +"1 file" => "1 ficheiro", +"{count} files" => "{count} ficheiros", +"Nothing in here. Your trash bin is empty!" => "Não ha ficheiros. O lixo está vazio", +"Restore" => "Restaurar" +); diff --git a/apps/files_trashbin/l10n/ro.php b/apps/files_trashbin/l10n/ro.php new file mode 100644 index 00000000000..6ece51e02cf --- /dev/null +++ b/apps/files_trashbin/l10n/ro.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Nume", +"1 folder" => "1 folder", +"{count} folders" => "{count} foldare", +"1 file" => "1 fisier", +"{count} files" => "{count} fisiere" +); diff --git a/apps/files_trashbin/l10n/ru.php b/apps/files_trashbin/l10n/ru.php new file mode 100644 index 00000000000..23d739a2ff7 --- /dev/null +++ b/apps/files_trashbin/l10n/ru.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Имя", +"1 folder" => "1 папка", +"{count} folders" => "{count} папок", +"1 file" => "1 файл", +"{count} files" => "{count} файлов" +); diff --git a/apps/files_trashbin/l10n/ru_RU.php b/apps/files_trashbin/l10n/ru_RU.php new file mode 100644 index 00000000000..8ef2658cf24 --- /dev/null +++ b/apps/files_trashbin/l10n/ru_RU.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Имя", +"1 folder" => "1 папка", +"{count} folders" => "{количество} папок", +"1 file" => "1 файл", +"{count} files" => "{количество} файлов" +); diff --git a/apps/files_trashbin/l10n/si_LK.php b/apps/files_trashbin/l10n/si_LK.php new file mode 100644 index 00000000000..cb351afaec9 --- /dev/null +++ b/apps/files_trashbin/l10n/si_LK.php @@ -0,0 +1,5 @@ +<?php $TRANSLATIONS = array( +"Name" => "නම", +"1 folder" => "1 ෆොල්ඩරයක්", +"1 file" => "1 ගොනුවක්" +); diff --git a/apps/files_trashbin/l10n/sk_SK.php b/apps/files_trashbin/l10n/sk_SK.php new file mode 100644 index 00000000000..81d43614d7b --- /dev/null +++ b/apps/files_trashbin/l10n/sk_SK.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "vykonať obnovu", +"Name" => "Meno", +"Deleted" => "Zmazané", +"1 folder" => "1 priečinok", +"{count} folders" => "{count} priečinkov", +"1 file" => "1 súbor", +"{count} files" => "{count} súborov", +"Nothing in here. Your trash bin is empty!" => "Žiadny obsah. Kôš je prázdny!", +"Restore" => "Obnoviť" +); diff --git a/apps/files_trashbin/l10n/sl.php b/apps/files_trashbin/l10n/sl.php new file mode 100644 index 00000000000..2579f95c862 --- /dev/null +++ b/apps/files_trashbin/l10n/sl.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Ime", +"1 folder" => "1 mapa", +"{count} folders" => "{count} map", +"1 file" => "1 datoteka", +"{count} files" => "{count} datotek" +); diff --git a/apps/files_trashbin/l10n/sr.php b/apps/files_trashbin/l10n/sr.php new file mode 100644 index 00000000000..36659e70803 --- /dev/null +++ b/apps/files_trashbin/l10n/sr.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "врати у претходно стање", +"Name" => "Име", +"Deleted" => "Обрисано", +"1 folder" => "1 фасцикла", +"{count} folders" => "{count} фасцикле/и", +"1 file" => "1 датотека", +"{count} files" => "{count} датотеке/а", +"Nothing in here. Your trash bin is empty!" => "Овде нема ништа. Корпа за отпатке је празна.", +"Restore" => "Врати" +); diff --git a/apps/files_trashbin/l10n/sr@latin.php b/apps/files_trashbin/l10n/sr@latin.php new file mode 100644 index 00000000000..52255c7429a --- /dev/null +++ b/apps/files_trashbin/l10n/sr@latin.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Name" => "Ime" +); diff --git a/apps/files_trashbin/l10n/sv.php b/apps/files_trashbin/l10n/sv.php new file mode 100644 index 00000000000..5bde85e7056 --- /dev/null +++ b/apps/files_trashbin/l10n/sv.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "utför återställning", +"Name" => "Namn", +"Deleted" => "Raderad", +"1 folder" => "1 mapp", +"{count} folders" => "{count} mappar", +"1 file" => "1 fil", +"{count} files" => "{count} filer", +"Nothing in here. Your trash bin is empty!" => "Ingenting här. Din papperskorg är tom!", +"Restore" => "Återskapa" +); diff --git a/apps/files_trashbin/l10n/ta_LK.php b/apps/files_trashbin/l10n/ta_LK.php new file mode 100644 index 00000000000..a436e2344a4 --- /dev/null +++ b/apps/files_trashbin/l10n/ta_LK.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "பெயர்", +"1 folder" => "1 கோப்புறை", +"{count} folders" => "{எண்ணிக்கை} கோப்புறைகள்", +"1 file" => "1 கோப்பு", +"{count} files" => "{எண்ணிக்கை} கோப்புகள்" +); diff --git a/apps/files_trashbin/l10n/th_TH.php b/apps/files_trashbin/l10n/th_TH.php new file mode 100644 index 00000000000..8a031fb0d70 --- /dev/null +++ b/apps/files_trashbin/l10n/th_TH.php @@ -0,0 +1,11 @@ +<?php $TRANSLATIONS = array( +"perform restore operation" => "ดำเนินการคืนค่า", +"Name" => "ชื่อ", +"Deleted" => "ลบแล้ว", +"1 folder" => "1 โฟลเดอร์", +"{count} folders" => "{count} โฟลเดอร์", +"1 file" => "1 ไฟล์", +"{count} files" => "{count} ไฟล์", +"Nothing in here. Your trash bin is empty!" => "ไม่มีอะไรอยู่ในนี้ ถังขยะของคุณยังว่างอยู่", +"Restore" => "คืนค่า" +); diff --git a/apps/files_trashbin/l10n/tr.php b/apps/files_trashbin/l10n/tr.php new file mode 100644 index 00000000000..5b7064eceaf --- /dev/null +++ b/apps/files_trashbin/l10n/tr.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "İsim", +"1 folder" => "1 dizin", +"{count} folders" => "{count} dizin", +"1 file" => "1 dosya", +"{count} files" => "{count} dosya" +); diff --git a/apps/files_trashbin/l10n/uk.php b/apps/files_trashbin/l10n/uk.php new file mode 100644 index 00000000000..14c6931255a --- /dev/null +++ b/apps/files_trashbin/l10n/uk.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Ім'я", +"1 folder" => "1 папка", +"{count} folders" => "{count} папок", +"1 file" => "1 файл", +"{count} files" => "{count} файлів" +); diff --git a/apps/files_trashbin/l10n/vi.php b/apps/files_trashbin/l10n/vi.php new file mode 100644 index 00000000000..2c51c69aaf2 --- /dev/null +++ b/apps/files_trashbin/l10n/vi.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "Tên", +"1 folder" => "1 thư mục", +"{count} folders" => "{count} thư mục", +"1 file" => "1 tập tin", +"{count} files" => "{count} tập tin" +); diff --git a/apps/files_trashbin/l10n/zh_CN.GB2312.php b/apps/files_trashbin/l10n/zh_CN.GB2312.php new file mode 100644 index 00000000000..2c6a7891e98 --- /dev/null +++ b/apps/files_trashbin/l10n/zh_CN.GB2312.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "名称", +"1 folder" => "1 个文件夹", +"{count} folders" => "{count} 个文件夹", +"1 file" => "1 个文件", +"{count} files" => "{count} 个文件" +); diff --git a/apps/files_trashbin/l10n/zh_CN.php b/apps/files_trashbin/l10n/zh_CN.php new file mode 100644 index 00000000000..0060b1f31d6 --- /dev/null +++ b/apps/files_trashbin/l10n/zh_CN.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "名称", +"1 folder" => "1个文件夹", +"{count} folders" => "{count} 个文件夹", +"1 file" => "1 个文件", +"{count} files" => "{count} 个文件" +); diff --git a/apps/files_trashbin/l10n/zh_TW.php b/apps/files_trashbin/l10n/zh_TW.php new file mode 100644 index 00000000000..be61d9b0b6d --- /dev/null +++ b/apps/files_trashbin/l10n/zh_TW.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Name" => "名稱", +"1 folder" => "1 個資料夾", +"{count} folders" => "{count} 個資料夾", +"1 file" => "1 個檔案", +"{count} files" => "{count} 個檔案" +); diff --git a/apps/files_trashbin/lib/hooks.php b/apps/files_trashbin/lib/hooks.php index d3bee105b51..d6a62d447b8 100644 --- a/apps/files_trashbin/lib/hooks.php +++ b/apps/files_trashbin/lib/hooks.php @@ -24,7 +24,7 @@ * This class contains all hooks. */ -namespace OCA_Trash; +namespace OCA\Files_Trashbin; class Hooks { diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 1c66fac8903..abc7fbb7383 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -20,7 +20,7 @@ * */ -namespace OCA_Trash; +namespace OCA\Files_Trashbin; class Trashbin { @@ -65,7 +65,7 @@ class Trashbin { if ( \OCP\App::isEnabled('files_versions') ) { if ( $view->is_dir('files_versions'.$file_path) ) { $view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp); - } else if ( $versions = \OCA_Versions\Storage::getVersions($file_path) ) { + } else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) { foreach ($versions as $v) { $view->rename('files_versions'.$v['path'].'.v'.$v['version'], 'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp); } @@ -151,6 +151,45 @@ class Trashbin { } /** + * delete file from trash bin permanently + * @param $filename path to the file + * @param $timestamp of deletion time + * @return true/false + */ + public static function delete($filename, $timestamp=null) { + + $user = \OCP\User::getUser(); + $view = new \OC_FilesystemView('/'.$user); + + if ( $timestamp ) { + $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?'); + $query->execute(array($user,$filename,$timestamp)); + $file = $filename.'.d'.$timestamp; + } else { + $file = $filename; + } + + if ( \OCP\App::isEnabled('files_versions') ) { + if ($view->is_dir('versions_trashbin/'.$file)) { + $view->unlink('versions_trashbin/'.$file); + } else if ( $versions = self::getVersionsFromTrash($file, $timestamp) ) { + foreach ($versions as $v) { + if ($timestamp ) { + $view->unlink('versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp); + } else { + $view->unlink('versions_trashbin/'.$file.'.v'.$v); + } + } + } + } + + $view->unlink('/files_trashbin/'.$file); + + return true; + } + + + /** * clean up the trash bin */ private static function expire() { diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index c3e51b4becd..24e4a0e6c69 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -9,7 +9,7 @@ <div id="emptyfolder"><?php echo $l->t('Nothing in here. Your trash bin is empty!')?></div> <?php endif; ?> -<table> +<table class="hascontrols"> <thead> <tr> <th id='headerName'> |