diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-08-05 14:27:38 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-08-05 14:27:38 +0200 |
commit | af983b843d1335917f4a702cea6d91d28bab68e9 (patch) | |
tree | 692e6e4090ef282b597b9b69d2abd53262cf47a0 /apps/files_trashbin | |
parent | 554b1990e23c76aea182e9b8c2687f8f8b939fb9 (diff) | |
parent | 0fce89308e2fbcb44a2091ca67f373ba89ee068e (diff) | |
download | nextcloud-server-af983b843d1335917f4a702cea6d91d28bab68e9.tar.gz nextcloud-server-af983b843d1335917f4a702cea6d91d28bab68e9.zip |
fix merge conflicts
Diffstat (limited to 'apps/files_trashbin')
25 files changed, 57 insertions, 27 deletions
diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index 16c39ab3853..92361b65f63 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -13,7 +13,7 @@ $success = array(); $i = 0; foreach ($list as $file) { - if ( $dirlisting=='0') { + if ( $dirlisting === '0') { $delimiter = strrpos($file, '.d'); $filename = substr($file, 0, $delimiter); $timestamp = substr($file, $delimiter+2); diff --git a/apps/files_trashbin/ajax/isEmpty.php b/apps/files_trashbin/ajax/isEmpty.php new file mode 100644 index 00000000000..2e54c7e77b9 --- /dev/null +++ b/apps/files_trashbin/ajax/isEmpty.php @@ -0,0 +1,14 @@ +<?php + +/* + * Check if trash bin is empty to re-enable the deleted files button if needed + */ + +OCP\JSON::checkLoggedIn(); +OCP\JSON::callCheck(); + +$trashStatus = OCA\Files_Trashbin\Trashbin::isEmpty(OCP\User::getUser()); + +OCP\JSON::success(array("data" => array("isEmpty" => $trashStatus))); + + diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index 9d78f166765..e39004cc0d5 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -12,7 +12,7 @@ $success = array(); $i = 0; foreach ($list as $file) { - if ( $dirlisting=='0') { + if ( $dirlisting === '0') { $delimiter = strrpos($file, '.d'); $filename = substr($file, 0, $delimiter); $timestamp = substr($file, $delimiter+2); diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 6f1c364737e..2dbaefe7a78 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -24,7 +24,7 @@ if ($dir) { $dirContent = $view->opendir($dir); $i = 0; while($entryName = readdir($dirContent)) { - if ( $entryName != '.' && $entryName != '..' ) { + if (!\OC\Files\Filesystem::isIgnoredDir($entryName)) { $pos = strpos($dir.'/', '/', 1); $tmp = substr($dir, 0, $pos); $pos = strrpos($tmp, '.d'); @@ -54,13 +54,13 @@ foreach ($result as $r) { $i['timestamp'] = $r['timestamp']; $i['mimetype'] = $r['mime']; $i['type'] = $r['type']; - if ($i['type'] == 'file') { + if ($i['type'] === 'file') { $fileinfo = pathinfo($r['id']); $i['basename'] = $fileinfo['filename']; $i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : ''; } $i['directory'] = $r['location']; - if ($i['directory'] == '/') { + if ($i['directory'] === '/') { $i['directory'] = ''; } $i['permissions'] = OCP\PERMISSION_READ; @@ -68,9 +68,9 @@ foreach ($result as $r) { } function fileCmp($a, $b) { - if ($a['type'] == 'dir' and $b['type'] != 'dir') { + if ($a['type'] === 'dir' and $b['type'] !== 'dir') { return -1; - } elseif ($a['type'] != 'dir' and $b['type'] == 'dir') { + } elseif ($a['type'] !== 'dir' and $b['type'] === 'dir') { return 1; } else { return strnatcasecmp($a['name'], $b['name']); @@ -83,7 +83,7 @@ usort($files, "fileCmp"); $pathtohere = ''; $breadcrumb = array(); foreach (explode('/', $dir) as $i) { - if ($i != '') { + if ($i !== '') { if ( preg_match('/^(.+)\.d[0-9]+$/', $i, $match) ) { $name = $match[1]; } else { diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index 409e3e59d5a..c3c958b07a7 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -16,7 +16,7 @@ $(document).ready(function() { var row = document.getElementById(result.data.success[i].filename); row.parentNode.removeChild(row); } - if (result.status != 'success') { + if (result.status !== 'success') { OC.dialogs.alert(result.data.message, t('core', 'Error')); } enableActions(); @@ -44,7 +44,7 @@ $(document).ready(function() { var row = document.getElementById(result.data.success[i].filename); row.parentNode.removeChild(row); } - if (result.status != 'success') { + if (result.status !== 'success') { OC.dialogs.alert(result.data.message, t('core', 'Error')); } enableActions(); @@ -75,7 +75,7 @@ $(document).ready(function() { var rows = $(this).parent().parent().parent().children('tr'); for (var i = start; i < end; i++) { $(rows).each(function(index) { - if (index == i) { + if (index === i) { var checkbox = $(this).children().children('input:checkbox'); $(checkbox).attr('checked', 'checked'); $(checkbox).parent().parent().addClass('selected'); @@ -114,7 +114,7 @@ $(document).ready(function() { var row = document.getElementById(result.data.success[i].filename); row.parentNode.removeChild(row); } - if (result.status != 'success') { + if (result.status !== 'success') { OC.dialogs.alert(result.data.message, t('core', 'Error')); } enableActions(); @@ -142,7 +142,7 @@ $(document).ready(function() { var row = document.getElementById(result.data.success[i].filename); row.parentNode.removeChild(row); } - if (result.status != 'success') { + if (result.status !== 'success') { OC.dialogs.alert(result.data.message, t('core', 'Error')); } enableActions(); @@ -176,9 +176,9 @@ $(document).ready(function() { function processSelection(){ var selected=getSelectedFiles(); - var selectedFiles=selected.filter(function(el){return el.type=='file'}); - var selectedFolders=selected.filter(function(el){return el.type=='dir'}); - if(selectedFiles.length==0 && selectedFolders.length==0) { + var selectedFiles=selected.filter(function(el){return el.type === 'file'}); + var selectedFolders=selected.filter(function(el){return el.type === 'dir'}); + if(selectedFiles.length === 0 && selectedFolders.length === 0) { $('#headerName>span.name').text(t('files','Name')); $('#modified').text(t('files','Deleted')); $('table').removeClass('multiselect'); @@ -188,7 +188,7 @@ function processSelection(){ $('.selectedActions').show(); var selection=''; if(selectedFolders.length>0){ - if(selectedFolders.length==1){ + if(selectedFolders.length === 1){ selection+=t('files','1 folder'); }else{ selection+=t('files','{count} folders',{count: selectedFolders.length}); @@ -198,7 +198,7 @@ function processSelection(){ } } if(selectedFiles.length>0){ - if(selectedFiles.length==1){ + if(selectedFiles.length === 1){ selection+=t('files','1 file'); }else{ selection+=t('files','{count} files',{count: selectedFiles.length}); diff --git a/apps/files_trashbin/l10n/ca.php b/apps/files_trashbin/l10n/ca.php index b7540f653d6..2f15068cb50 100644 --- a/apps/files_trashbin/l10n/ca.php +++ b/apps/files_trashbin/l10n/ca.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} carpetes", "1 file" => "1 fitxer", "{count} files" => "{count} fitxers", +"restored" => "restaurat", "Nothing in here. Your trash bin is empty!" => "La paperera està buida!", "Restore" => "Recupera", "Delete" => "Esborra", diff --git a/apps/files_trashbin/l10n/cs_CZ.php b/apps/files_trashbin/l10n/cs_CZ.php index 416b6b231d5..6429c90cf5f 100644 --- a/apps/files_trashbin/l10n/cs_CZ.php +++ b/apps/files_trashbin/l10n/cs_CZ.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} složky", "1 file" => "1 soubor", "{count} files" => "{count} soubory", +"restored" => "obnoveno", "Nothing in here. Your trash bin is empty!" => "Žádný obsah. Váš koš je prázdný.", "Restore" => "Obnovit", "Delete" => "Smazat", diff --git a/apps/files_trashbin/l10n/da.php b/apps/files_trashbin/l10n/da.php index 16f98baed7e..ff114a10e7e 100644 --- a/apps/files_trashbin/l10n/da.php +++ b/apps/files_trashbin/l10n/da.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} mapper", "1 file" => "1 fil", "{count} files" => "{count} filer", +"restored" => "Gendannet", "Nothing in here. Your trash bin is empty!" => "Intet at se her. Din papirkurv er tom!", "Restore" => "Gendan", "Delete" => "Slet", diff --git a/apps/files_trashbin/l10n/de.php b/apps/files_trashbin/l10n/de.php index 4dd9033969e..3c643874723 100644 --- a/apps/files_trashbin/l10n/de.php +++ b/apps/files_trashbin/l10n/de.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} Ordner", "1 file" => "1 Datei", "{count} files" => "{count} Dateien", +"restored" => "Wiederhergestellt", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, der Papierkorb ist leer!", "Restore" => "Wiederherstellen", "Delete" => "Löschen", diff --git a/apps/files_trashbin/l10n/de_DE.php b/apps/files_trashbin/l10n/de_DE.php index 829b5026e1a..47dcedd4bf3 100644 --- a/apps/files_trashbin/l10n/de_DE.php +++ b/apps/files_trashbin/l10n/de_DE.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} Ordner", "1 file" => "1 Datei", "{count} files" => "{count} Dateien", +"restored" => "Wiederhergestellt", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", "Restore" => "Wiederherstellen", "Delete" => "Löschen", diff --git a/apps/files_trashbin/l10n/es.php b/apps/files_trashbin/l10n/es.php index b2d5a2aed26..d6591713e3b 100644 --- a/apps/files_trashbin/l10n/es.php +++ b/apps/files_trashbin/l10n/es.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} carpetas", "1 file" => "1 archivo", "{count} files" => "{count} archivos", +"restored" => "recuperado", "Nothing in here. Your trash bin is empty!" => "No hay nada aquí. ¡Tu papelera esta vacía!", "Restore" => "Recuperar", "Delete" => "Eliminar", diff --git a/apps/files_trashbin/l10n/fi_FI.php b/apps/files_trashbin/l10n/fi_FI.php index fd6edf398ea..646a000c0d1 100644 --- a/apps/files_trashbin/l10n/fi_FI.php +++ b/apps/files_trashbin/l10n/fi_FI.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} kansiota", "1 file" => "1 tiedosto", "{count} files" => "{count} tiedostoa", +"restored" => "palautettu", "Nothing in here. Your trash bin is empty!" => "Tyhjää täynnä! Roskakorissa ei ole mitään.", "Restore" => "Palauta", "Delete" => "Poista", diff --git a/apps/files_trashbin/l10n/gl.php b/apps/files_trashbin/l10n/gl.php index b9b3c8a1e5c..d22277c28f5 100644 --- a/apps/files_trashbin/l10n/gl.php +++ b/apps/files_trashbin/l10n/gl.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} cartafoles", "1 file" => "1 ficheiro", "{count} files" => "{count} ficheiros", +"restored" => "restaurado", "Nothing in here. Your trash bin is empty!" => "Aquí non hai nada. O cesto do lixo está baleiro!", "Restore" => "Restablecer", "Delete" => "Eliminar", diff --git a/apps/files_trashbin/l10n/it.php b/apps/files_trashbin/l10n/it.php index 795fd6ea167..769971bb9c8 100644 --- a/apps/files_trashbin/l10n/it.php +++ b/apps/files_trashbin/l10n/it.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} cartelle", "1 file" => "1 file", "{count} files" => "{count} file", +"restored" => "ripristinati", "Nothing in here. Your trash bin is empty!" => "Qui non c'è niente. Il tuo cestino è vuoto.", "Restore" => "Ripristina", "Delete" => "Elimina", diff --git a/apps/files_trashbin/l10n/nl.php b/apps/files_trashbin/l10n/nl.php index 91844a14b66..a0a55eced85 100644 --- a/apps/files_trashbin/l10n/nl.php +++ b/apps/files_trashbin/l10n/nl.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} mappen", "1 file" => "1 bestand", "{count} files" => "{count} bestanden", +"restored" => "hersteld", "Nothing in here. Your trash bin is empty!" => "Niets te vinden. Uw prullenbak is leeg!", "Restore" => "Herstellen", "Delete" => "Verwijder", diff --git a/apps/files_trashbin/l10n/pl.php b/apps/files_trashbin/l10n/pl.php index 5c9f558f11f..2b9ace19c41 100644 --- a/apps/files_trashbin/l10n/pl.php +++ b/apps/files_trashbin/l10n/pl.php @@ -11,6 +11,7 @@ "{count} folders" => "Ilość folderów: {count}", "1 file" => "1 plik", "{count} files" => "Ilość plików: {count}", +"restored" => "przywrócony", "Nothing in here. Your trash bin is empty!" => "Nic tu nie ma. Twój kosz jest pusty!", "Restore" => "Przywróć", "Delete" => "Usuń", diff --git a/apps/files_trashbin/l10n/pt_BR.php b/apps/files_trashbin/l10n/pt_BR.php index 9dad8a40a85..c1a88541b27 100644 --- a/apps/files_trashbin/l10n/pt_BR.php +++ b/apps/files_trashbin/l10n/pt_BR.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} pastas", "1 file" => "1 arquivo", "{count} files" => "{count} arquivos", +"restored" => "restaurado", "Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!", "Restore" => "Restaurar", "Delete" => "Excluir", diff --git a/apps/files_trashbin/l10n/pt_PT.php b/apps/files_trashbin/l10n/pt_PT.php index ba85158b70e..044d324c5ab 100644 --- a/apps/files_trashbin/l10n/pt_PT.php +++ b/apps/files_trashbin/l10n/pt_PT.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} pastas", "1 file" => "1 ficheiro", "{count} files" => "{count} ficheiros", +"restored" => "Restaurado", "Nothing in here. Your trash bin is empty!" => "Não hà ficheiros. O lixo está vazio!", "Restore" => "Restaurar", "Delete" => "Eliminar", diff --git a/apps/files_trashbin/l10n/ru.php b/apps/files_trashbin/l10n/ru.php index 0d55703cdc0..f77d82c7100 100644 --- a/apps/files_trashbin/l10n/ru.php +++ b/apps/files_trashbin/l10n/ru.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} папок", "1 file" => "1 файл", "{count} files" => "{count} файлов", +"restored" => "восстановлен", "Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!", "Restore" => "Восстановить", "Delete" => "Удалить", diff --git a/apps/files_trashbin/l10n/sv.php b/apps/files_trashbin/l10n/sv.php index d56d8946f34..2e4a5b42612 100644 --- a/apps/files_trashbin/l10n/sv.php +++ b/apps/files_trashbin/l10n/sv.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} mappar", "1 file" => "1 fil", "{count} files" => "{count} filer", +"restored" => "återställd", "Nothing in here. Your trash bin is empty!" => "Ingenting här. Din papperskorg är tom!", "Restore" => "Återskapa", "Delete" => "Radera", diff --git a/apps/files_trashbin/l10n/uk.php b/apps/files_trashbin/l10n/uk.php index ffc9ab02f48..b2f10760216 100644 --- a/apps/files_trashbin/l10n/uk.php +++ b/apps/files_trashbin/l10n/uk.php @@ -11,6 +11,7 @@ "{count} folders" => "{count} папок", "1 file" => "1 файл", "{count} files" => "{count} файлів", +"restored" => "відновлено", "Nothing in here. Your trash bin is empty!" => "Нічого немає. Ваший кошик для сміття пустий!", "Restore" => "Відновити", "Delete" => "Видалити", diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index b6ab552c959..615eafee617 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -265,14 +265,14 @@ class Trashbin { $query = \OC_DB::prepare('SELECT `location`,`type` FROM `*PREFIX*files_trash`' . ' WHERE `user`=? AND `id`=? AND `timestamp`=?'); $result = $query->execute(array($user, $filename, $timestamp))->fetchAll(); - if (count($result) != 1) { + if (count($result) !== 1) { \OC_Log::write('files_trashbin', 'trash bin database inconsistent!', \OC_Log::ERROR); return false; } // if location no longer exists, restore file in the root directory $location = $result[0]['location']; - if ($result[0]['location'] != '/' && + if ($result[0]['location'] !== '/' && (!$view->is_dir('files' . $result[0]['location']) || !$view->isUpdatable('files' . $result[0]['location']))) { $location = ''; diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index 66ec36df867..371765fa69a 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -5,7 +5,7 @@ </div> <div id='notification'></div> -<?php if (isset($_['files']) && count($_['files'])==0 && $_['dirlisting'] == false):?> +<?php if (isset($_['files']) && count($_['files']) === 0 && $_['dirlisting'] === false):?> <div id="emptyfolder"><?php p($l->t('Nothing in here. Your trash bin is empty!'))?></div> <?php endif; ?> diff --git a/apps/files_trashbin/templates/part.breadcrumb.php b/apps/files_trashbin/templates/part.breadcrumb.php index 85bb16ffa2d..8ecab58e5c8 100644 --- a/apps/files_trashbin/templates/part.breadcrumb.php +++ b/apps/files_trashbin/templates/part.breadcrumb.php @@ -12,7 +12,7 @@ <?php for($i=0; $i<count($_["breadcrumb"]); $i++): $crumb = $_["breadcrumb"][$i]; $dir = \OCP\Util::encodePath($crumb["dir"]); ?> - <div class="crumb <?php if($i == count($_["breadcrumb"])-1) p('last');?> svg" + <div class="crumb <?php if($i === count($_["breadcrumb"])-1) p('last');?> svg" data-dir='<?php p($dir);?>'> <a href="<?php p($_['baseURL'].$dir); ?>"><?php p($crumb["name"]); ?></a> </div> diff --git a/apps/files_trashbin/templates/part.list.php b/apps/files_trashbin/templates/part.list.php index 71b9a238823..6c6d2162846 100644 --- a/apps/files_trashbin/templates/part.list.php +++ b/apps/files_trashbin/templates/part.list.php @@ -7,7 +7,7 @@ $name = \OCP\Util::encodePath($file['name']); $directory = \OCP\Util::encodePath($file['directory']); ?> <tr data-filename="<?php p($file['name']);?>" - data-type="<?php ($file['type'] == 'dir')?p('dir'):p('file')?>" + data-type="<?php ($file['type'] === 'dir')?p('dir'):p('file')?>" data-mime="<?php p($file['mimetype'])?>" data-permissions='<?php p($file['permissions']); ?>' <?php if ( $_['dirlisting'] ): ?> @@ -22,7 +22,7 @@ data-dirlisting=0 <?php endif; ?>> <td class="filename svg" - <?php if($file['type'] == 'dir'): ?> + <?php if($file['type'] === 'dir'): ?> style="background-image:url(<?php print_unescaped(OCP\mimetype_icon('dir')); ?>)" <?php else: ?> <?php if(\OCP\Preview::isMimeSupported($file['mimetype'])): ?> @@ -33,7 +33,7 @@ <?php endif; ?> > <?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?> - <?php if($file['type'] == 'dir'): ?> + <?php if($file['type'] === 'dir'): ?> <?php if( $_['dirlisting'] ): ?> <a class="name" href="<?php p($_['baseURL'].'/'.$name); ?>" title=""> <?php else: ?> @@ -47,14 +47,14 @@ <?php endif; ?> <?php endif; ?> <span class="nametext"> - <?php if($file['type'] == 'dir'):?> + <?php if($file['type'] === 'dir'):?> <?php print_unescaped(htmlspecialchars($file['name']));?> <?php else:?> <?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span> <?php endif;?> </span> - <?php if($file['type'] == 'dir'):?> + <?php if($file['type'] === 'dir'):?> <span class="uploadtext" currentUploads="0"> </span> <?php endif;?> |