diff --git a/.jshintrc b/.jshintrc index 77f9e9f143d4c155ea03549df18202cef36decd4..d5da3e30828193581ecb113f423a69ab83e02bf6 100644 --- a/.jshintrc +++ b/.jshintrc @@ -26,6 +26,7 @@ "fakeServer": true, "_": true, "OC": true, + "OCA": true, "t": true, "n": true } diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 2d76b685018fec0f690b154672ae0f5c149774bd..bae3628402f73d4303b3625f8555b51a77d8cd84 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -17,8 +17,11 @@ $baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir='; $permissions = $dirInfo->getPermissions(); +$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name'; +$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false; + // make filelist -$files = \OCA\Files\Helper::getFiles($dir); +$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection); $data['directory'] = $dir; $data['files'] = \OCA\Files\Helper::formatFileInfos($files); diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index a5ce7b257da3db8de85ac94fc19f95b500b0d29c..9750173d1107f587f0329c6197398f9cdccd071b 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -88,7 +88,9 @@ foreach ($_FILES['files']['error'] as $error) { UPLOAD_ERR_NO_TMP_DIR => $l->t('Missing a temporary folder'), UPLOAD_ERR_CANT_WRITE => $l->t('Failed to write to disk'), ); - OCP\JSON::error(array('data' => array_merge(array('message' => $errors[$error]), $storageStats))); + $errorMessage = $errors[$error]; + \OC::$server->getLogger()->alert("Upload error: $error - $errorMessage", array('app' => 'files')); + OCP\JSON::error(array('data' => array_merge(array('message' => $errorMessage), $storageStats))); exit(); } } diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index 15a29133789d33a82a3f687aba758d09884e1718..4b0db457ada50bb8812d216b6fd9438be8dee033 100644 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -19,3 +19,13 @@ $templateManager->registerTemplate('text/html', 'core/templates/filetemplates/te $templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp'); $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt'); $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods'); + +\OCA\Files\App::getNavigationManager()->add( + array( + "id" => 'files', + "appname" => 'files', + "script" => 'list.php', + "order" => 0, + "name" => $l->t('All files') + ) +); diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index 34800378537ead29daf6456563038a43dc3bbbe4..390d645e2a44bac66a9bb7483976d3cc1bb47e7f 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -4,8 +4,8 @@ Files File Management AGPL - Robin Appelman - 4.93 + Robin Appelman, Vincent Petry + 4.93 true diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php deleted file mode 100644 index f920f842166700a16c8c75ad059f28117998adbc..0000000000000000000000000000000000000000 --- a/apps/files/appinfo/update.php +++ /dev/null @@ -1,46 +0,0 @@ -getDatabasePlatform()-> - getConcatExpression( '\'{DAV:}\'', '`propertyname`' ); - $query = OC_DB::prepare(' - UPDATE `*PREFIX*properties` - SET `propertyname` = ' . $concat . ' - WHERE `propertyname` NOT LIKE \'{%\' - '); - $query->execute(); -} - -//update from OC 3 - -//try to remove remaining files. -//Give a warning if not possible - -$filesToRemove = array( - 'ajax', - 'appinfo', - 'css', - 'js', - 'l10n', - 'templates', - 'admin.php', - 'download.php', - 'index.php', - 'settings.php' -); - -foreach($filesToRemove as $file) { - $filepath = OC::$SERVERROOT . '/files/' . $file; - if(!file_exists($filepath)) { - continue; - } - $success = OCP\Files::rmdirr($filepath); - if($success === false) { - //probably not sufficient privileges, give up and give a message. - OCP\Util::writeLog('files', 'Could not clean /files/ directory.' - .' Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR); - break; - } -} diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 533050691d5e75b94bce6bcf047eec6828dfa1ea..731dd7a23e7e1d985f762bfde6038302dfc6017e 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -3,10 +3,11 @@ See the COPYING-README file. */ /* FILE MENU */ -.actions { padding:5px; height:32px; width: 100%; } +.actions { padding:5px; height:32px; display: inline-block; float: left; } .actions input, .actions button, .actions .button { margin:0; float:left; } .actions .button a { color: #555; } .actions .button a:hover, .actions .button a:active { color: #333; } +.actions.hidden { display: none; } #new { z-index: 1010; @@ -75,6 +76,7 @@ top: 44px; width: 100%; } + /* make sure there's enough room for the file actions */ #body-user #filestable { min-width: 688px; /* 768 (mobile break) - 80 (nav width) */ @@ -83,6 +85,40 @@ min-width: 688px; /* 768 (mobile break) - 80 (nav width) */ } +#filestable tbody tr { background-color:#fff; height:51px; } + +.app-files #app-content { + position: relative; +} + +/** + * Override global #controls styles + * to be more flexible / relative + */ +#body-user .app-files #controls { + left: 310px; /* main nav bar + sidebar */ + position: fixed; + padding-left: 0px; +} + +/* this is mostly for file viewer apps, text editor, etc */ +#body-user .app-files.no-sidebar #controls { + left: 0px; + padding-left: 80px; /* main nav bar */ +} + +.app-files #app-navigation { + width: 230px; +} + +.app-files #app-settings { + width: 229px; /* DUH */ +} + +.app-files #app-settings input { + width: 90%; +} + #filestable tbody tr { background-color:#fff; height:40px; } #filestable tbody tr:hover, tbody tr:active { background-color: rgb(240,240,240); @@ -116,10 +152,29 @@ tr:hover span.extension { table tr.mouseOver td { background-color:#eee; } table th { height:24px; padding:0 8px; color:#999; } -table th .name { - position: absolute; - left: 55px; - top: 15px; +table th .columntitle { + display: inline-block; + padding: 15px; + width: 100%; + height: 50px; + box-sizing: border-box; + -moz-box-sizing: border-box; + vertical-align: middle; +} +table th .columntitle.name { + padding-left: 5px; + margin-left: 50px; + max-width: 300px; +} +/* hover effect on sortable column */ +table th a.columntitle:hover { + background-color: #F0F0F0; +} +table th .sort-indicator { + width: 10px; + height: 8px; + margin-left: 10px; + display: inline-block; } table th, table td { border-bottom:1px solid #ddd; text-align:left; font-weight:normal; } table td { @@ -139,8 +194,11 @@ table th#headerName { } table th#headerSize, table td.filesize { min-width: 48px; - padding: 0 16px; text-align: right; + padding: 0; +} +table table td.filesize { + padding: 0 16px; } table th#headerDate, table td.date { -moz-box-sizing: border-box; @@ -161,9 +219,7 @@ table.multiselect thead { z-index: 10; -moz-box-sizing: border-box; box-sizing: border-box; - left: 0; - padding-left: 80px; - width: 100%; + left: 310px; /* main nav bar + sidebar */ } table.multiselect thead th { @@ -197,10 +253,6 @@ table td.filename input.filename { table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:3px 8px 8px 3px; } table td.filename .nametext, .uploadtext, .modified { float:left; padding:14px 0; } -#modified { - position: absolute; - top: 15px; -} .modified { position: relative; padding-left: 8px; @@ -254,7 +306,7 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; } /* Use label to have bigger clickable size for checkbox */ #fileList tr td.filename>input[type="checkbox"] + label, -#select_all + label { +.select-all + label { height: 50px; position: absolute; width: 50px; @@ -268,10 +320,10 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; } #fileList tr td.filename>input[type="checkbox"] + label { left: 0; } -#select_all + label { +.select-all + label { top: 0; } -#select_all { +.select-all { position: absolute; top: 18px; left: 18px; @@ -306,6 +358,10 @@ table td.filename form { font-size:14px; margin-left:48px; margin-right:48px; } padding: 28px 14px 19px !important; } +#fileList .action.action-share-notification span, img, a { + cursor: default !important; +} + a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } /* Actions for selected files */ @@ -319,6 +375,9 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } display: inline; padding: 17px 5px; } +.selectedActions a.hidden { + display: none; +} .selectedActions a img { position:relative; top:5px; @@ -394,7 +453,7 @@ table.dragshadow td.size { } .mask { z-index: 50; - position: fixed; + position: absolute; top: 0; left: 0; right: 0; diff --git a/apps/files/index.php b/apps/files/index.php index a4e9a938507c36541cb7df9f0f600d577095074a..e24c535cb208cab1488194ddadc29bb5e444b970 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -28,6 +28,7 @@ OCP\User::checkLoggedIn(); OCP\Util::addStyle('files', 'files'); OCP\Util::addStyle('files', 'upload'); OCP\Util::addStyle('files', 'mobile'); +OCP\Util::addscript('files', 'app'); OCP\Util::addscript('files', 'file-upload'); OCP\Util::addscript('files', 'jquery.iframe-transport'); OCP\Util::addscript('files', 'jquery.fileupload'); @@ -37,28 +38,23 @@ OCP\Util::addscript('files', 'breadcrumb'); OCP\Util::addscript('files', 'filelist'); OCP\App::setActiveNavigationEntry('files_index'); -// Load the files -$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; -$dir = \OC\Files\Filesystem::normalizePath($dir); -$dirInfo = \OC\Files\Filesystem::getFileInfo($dir, false); -// Redirect if directory does not exist -if (!$dirInfo || !$dirInfo->getType() === 'dir') { - header('Location: ' . OCP\Util::getScriptName() . ''); - exit(); -} $isIE8 = false; preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches); -if (count($matches) > 0 && $matches[1] <= 8){ +if (count($matches) > 0 && $matches[1] <= 9) { $isIE8 = true; } -// if IE8 and "?dir=path" was specified, reformat the URL to use a hash like "#?dir=path" -if ($isIE8 && isset($_GET['dir'])){ - if ($dir === ''){ - $dir = '/'; +// if IE8 and "?dir=path&view=someview" was specified, reformat the URL to use a hash like "#?dir=path&view=someview" +if ($isIE8 && (isset($_GET['dir']) || isset($_GET['view']))) { + $hash = '#?'; + $dir = isset($_GET['dir']) ? $_GET['dir'] : '/'; + $view = isset($_GET['view']) ? $_GET['view'] : 'files'; + $hash = '#?dir=' . \OCP\Util::encodePath($dir); + if ($view !== 'files') { + $hash .= '&view=' . urlencode($view); } - header('Location: ' . OCP\Util::linkTo('files', 'index.php') . '#?dir=' . \OCP\Util::encodePath($dir)); + header('Location: ' . OCP\Util::linkTo('files', 'index.php') . $hash); exit(); } @@ -66,49 +62,62 @@ $user = OC_User::getUser(); $config = \OC::$server->getConfig(); -// needed for share init, permissions will be reloaded -// anyway with ajax load -$permissions = $dirInfo->getPermissions(); - -// information about storage capacities -$storageInfo=OC_Helper::getStorageInfo($dir, $dirInfo); -$freeSpace=$storageInfo['free']; -$uploadLimit=OCP\Util::uploadLimit(); -$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir, $freeSpace); -$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); +// mostly for the home storage's free space +$dirInfo = \OC\Files\Filesystem::getFileInfo('/', false); +$storageInfo=OC_Helper::getStorageInfo('/', $dirInfo); // if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code) $encryptionInitStatus = 2; if (OC_App::isEnabled('files_encryption')) { - $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); - $encryptionInitStatus = $session->getInitialized(); + $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); + $encryptionInitStatus = $session->getInitialized(); +} + +$nav = new OCP\Template('files', 'appnavigation', ''); + +$navItems = \OCA\Files\App::getNavigationManager()->getAll(); +$nav->assign('navigationItems', $navItems); + +$contentItems = array(); + +function renderScript($appName, $scriptName) { + $content = ''; + $appPath = OC_App::getAppPath($appName); + $scriptPath = $appPath . '/' . $scriptName; + if (file_exists($scriptPath)) { + // TODO: sanitize path / script name ? + ob_start(); + include $scriptPath; + $content = ob_get_contents(); + @ob_end_clean(); + } + return $content; } -$trashEnabled = \OCP\App::isEnabled('files_trashbin'); -$trashEmpty = true; -if ($trashEnabled) { - $trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user); +// render the container content for every navigation item +foreach ($navItems as $item) { + $content = ''; + if (isset($item['script'])) { + $content = renderScript($item['appname'], $item['script']); + } + $contentItem = array(); + $contentItem['id'] = $item['id']; + $contentItem['content'] = $content; + $contentItems[] = $contentItem; } OCP\Util::addscript('files', 'fileactions'); OCP\Util::addscript('files', 'files'); +OCP\Util::addscript('files', 'navigation'); OCP\Util::addscript('files', 'keyboardshortcuts'); $tmpl = new OCP\Template('files', 'index', 'user'); -$tmpl->assign('dir', $dir); -$tmpl->assign('permissions', $permissions); -$tmpl->assign('trash', $trashEnabled); -$tmpl->assign('trashEmpty', $trashEmpty); -$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); // minimium of freeSpace and uploadLimit -$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); -$tmpl->assign('freeSpace', $freeSpace); -$tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit -$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']); $tmpl->assign('isPublic', false); -$tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles()); $tmpl->assign("mailNotificationEnabled", $config->getAppValue('core', 'shareapi_allow_mail_notification', 'yes')); $tmpl->assign("allowShareWithLink", $config->getAppValue('core', 'shareapi_allow_links', 'yes')); $tmpl->assign("encryptionInitStatus", $encryptionInitStatus); -$tmpl->assign('disableSharing', false); +$tmpl->assign('appNavigation', $nav); +$tmpl->assign('appContents', $contentItems); +$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->printPage(); diff --git a/apps/files/js/app.js b/apps/files/js/app.js new file mode 100644 index 0000000000000000000000000000000000000000..9155fb38cdbeee986ac6d21194e92651c98d47e1 --- /dev/null +++ b/apps/files/js/app.js @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014 + * + * @author Vincent Petry + * @copyright 2014 Vincent Petry + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/* global dragOptions, folderDropOptions */ +(function() { + + if (!OCA.Files) { + OCA.Files = {}; + } + + var App = { + navigation: null, + + initialize: function() { + this.navigation = new OCA.Files.Navigation($('#app-navigation')); + + // TODO: ideally these should be in a separate class / app (the embedded "all files" app) + this.fileActions = OCA.Files.FileActions; + this.files = OCA.Files.Files; + + this.fileList = new OCA.Files.FileList( + $('#app-content-files'), { + scrollContainer: $('#app-content'), + dragOptions: dragOptions, + folderDropOptions: folderDropOptions + } + ); + this.files.initialize(); + this.fileActions.registerDefaultActions(this.fileList); + this.fileList.setFileActions(this.fileActions); + + // for backward compatibility, the global FileList will + // refer to the one of the "files" view + window.FileList = this.fileList; + + this._setupEvents(); + // trigger URL change event handlers + this._onPopState(OC.Util.History.parseUrlQuery()); + }, + + /** + * Returns the container of the currently visible app. + * + * @return app container + */ + getCurrentAppContainer: function() { + return this.navigation.getActiveContainer(); + }, + + /** + * Setup events based on URL changes + */ + _setupEvents: function() { + OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this)); + + // detect when app changed their current directory + $('#app-content').delegate('>div', 'changeDirectory', _.bind(this._onDirectoryChanged, this)); + $('#app-content').delegate('>div', 'changeViewerMode', _.bind(this._onChangeViewerMode, this)); + + $('#app-navigation').on('itemChanged', _.bind(this._onNavigationChanged, this)); + }, + + /** + * Event handler for when the current navigation item has changed + */ + _onNavigationChanged: function(e) { + var params; + if (e && e.itemId) { + params = { + view: e.itemId, + dir: '/' + }; + this._changeUrl(params.view, params.dir); + this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params)); + } + }, + + /** + * Event handler for when an app notified that its directory changed + */ + _onDirectoryChanged: function(e) { + if (e.dir) { + this._changeUrl(this.navigation.getActiveItem(), e.dir); + } + }, + + /** + * Event handler for when an app notifies that it needs space + * for viewer mode. + */ + _onChangeViewerMode: function(e) { + var state = !!e.viewerModeEnabled; + $('#app-navigation').toggleClass('hidden', state); + $('.app-files').toggleClass('viewer-mode no-sidebar', state); + }, + + /** + * Event handler for when the URL changed + */ + _onPopState: function(params) { + params = _.extend({ + dir: '/', + view: 'files' + }, params); + var lastId = this.navigation.getActiveItem(); + if (!this.navigation.itemExists(params.view)) { + params.view = 'files'; + } + this.navigation.setActiveItem(params.view, {silent: true}); + if (lastId !== this.navigation.getActiveItem()) { + this.navigation.getActiveContainer().trigger(new $.Event('show')); + } + this.navigation.getActiveContainer().trigger(new $.Event('urlChanged', params)); + }, + + /** + * Change the URL to point to the given dir and view + */ + _changeUrl: function(view, dir) { + var params = {dir: dir}; + if (view !== 'files') { + params.view = view; + } + OC.Util.History.pushState(params); + } + }; + OCA.Files.App = App; +})(); + +$(document).ready(function() { + // wait for other apps/extensions to register their event handlers + // in the "ready" clause + _.defer(function() { + OCA.Files.App.initialize(); + }); +}); + diff --git a/apps/files/js/breadcrumb.js b/apps/files/js/breadcrumb.js index 5bc2fac13695d29940872c4dfa6e76931035e923..c017d710d6decad7830193b7a3d4bccc53bc4c02 100644 --- a/apps/files/js/breadcrumb.js +++ b/apps/files/js/breadcrumb.js @@ -159,7 +159,11 @@ this.totalWidth = 64; // FIXME: this class should not know about global elements if ( $('#navigation').length ) { - this.totalWidth += $('#navigation').get(0).offsetWidth; + this.totalWidth += $('#navigation').outerWidth(); + } + + if ( $('#app-navigation').length && !$('#app-navigation').hasClass('hidden')) { + this.totalWidth += $('#app-navigation').outerWidth(); } this.hiddenBreadcrumbs = 0; @@ -167,8 +171,8 @@ this.totalWidth += $(this.breadcrumbs[i]).get(0).offsetWidth; } - $.each($('#controls .actions>div'), function(index, action) { - self.totalWidth += $(action).get(0).offsetWidth; + $.each($('#controls .actions'), function(index, action) { + self.totalWidth += $(action).outerWidth(); }); }, @@ -236,6 +240,6 @@ } }; - window.BreadCrumb = BreadCrumb; + OCA.Files.BreadCrumb = BreadCrumb; })(); diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 67775b22c5455295679072509ee2e2bd55612f63..6b0ca793681089edd304deae6ae05d531546b15e 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -346,7 +346,7 @@ OC.Upload = { // noone set update parameters, we set the minimum data.formData = { requesttoken: oc_requesttoken, - dir: $('#dir').val(), + dir: FileList.getCurrentDirectory(), file_directory: fileDirectory }; } @@ -460,7 +460,6 @@ OC.Upload = { $('#uploadprogresswrapper input.stop').fadeOut(); $('#uploadprogressbar').fadeOut(); - Files.updateStorageStatistics(); }); fileupload.on('fileuploadfail', function(e, data) { OC.Upload.log('progress handle fileuploadfail', e, data); @@ -471,8 +470,6 @@ OC.Upload = { } }); - } else { - console.log('skipping file progress because your browser is broken'); } } @@ -595,7 +592,7 @@ OC.Upload = { if (FileList.lastAction) { FileList.lastAction(); } - var name = getUniqueName(newname); + var name = FileList.getUniqueName(newname); if (newname !== name) { FileList.checkName(name, newname, true); var hidden = true; @@ -607,7 +604,7 @@ OC.Upload = { $.post( OC.filePath('files', 'ajax', 'newfile.php'), { - dir: $('#dir').val(), + dir: FileList.getCurrentDirectory(), filename: name }, function(result) { @@ -623,7 +620,7 @@ OC.Upload = { $.post( OC.filePath('files','ajax','newfolder.php'), { - dir: $('#dir').val(), + dir: FileList.getCurrentDirectory(), foldername: name }, function(result) { @@ -648,7 +645,7 @@ OC.Upload = { } else { //or the domain localName = (localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.', ''); } - localName = getUniqueName(localName); + localName = FileList.getUniqueName(localName); //IE < 10 does not fire the necessary events for the progress bar. if ($('html.lte9').length === 0) { $('#uploadprogressbar').progressbar({value: 0}); @@ -658,7 +655,7 @@ OC.Upload = { var eventSource = new OC.EventSource( OC.filePath('files', 'ajax', 'newfile.php'), { - dir: $('#dir').val(), + dir: FileList.getCurrentDirectory(), source: name, filename: localName } diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index ecdfa72a477eb00d7b8f0b07a892ec8b6e6d35b0..2edb45f544c15268a67a0c0ffb38c6e7aaeda626 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -8,242 +8,255 @@ * */ -/* global OC, FileList, Files */ /* global trashBinApp */ -var FileActions = { - actions: {}, - defaults: {}, - icons: {}, - currentFile: null, - register: function (mime, name, permissions, icon, action, displayName) { - if (!FileActions.actions[mime]) { - FileActions.actions[mime] = {}; - } - if (!FileActions.actions[mime][name]) { - FileActions.actions[mime][name] = {}; - } - if (!displayName) { - displayName = t('files', name); - } - FileActions.actions[mime][name]['action'] = action; - FileActions.actions[mime][name]['permissions'] = permissions; - FileActions.actions[mime][name]['displayName'] = displayName; - FileActions.icons[name] = icon; - }, - setDefault: function (mime, name) { - FileActions.defaults[mime] = name; - }, - get: function (mime, type, permissions) { - var actions = this.getActions(mime, type, permissions); - var filteredActions = {}; - $.each(actions, function (name, action) { - filteredActions[name] = action.action; - }); - return filteredActions; - }, - getActions: function (mime, type, permissions) { - var actions = {}; - if (FileActions.actions.all) { - actions = $.extend(actions, FileActions.actions.all); - } - if (type) {//type is 'dir' or 'file' - if (FileActions.actions[type]) { - actions = $.extend(actions, FileActions.actions[type]); +(function() { + + var FileActions = { + actions: {}, + defaults: {}, + icons: {}, + currentFile: null, + register: function (mime, name, permissions, icon, action, displayName) { + if (!this.actions[mime]) { + this.actions[mime] = {}; } - } - if (mime) { - var mimePart = mime.substr(0, mime.indexOf('/')); - if (FileActions.actions[mimePart]) { - actions = $.extend(actions, FileActions.actions[mimePart]); + if (!this.actions[mime][name]) { + this.actions[mime][name] = {}; } - if (FileActions.actions[mime]) { - actions = $.extend(actions, FileActions.actions[mime]); + if (!displayName) { + displayName = t('files', name); } - } - var filteredActions = {}; - $.each(actions, function (name, action) { - if (action.permissions & permissions) { - filteredActions[name] = action; + this.actions[mime][name]['action'] = action; + this.actions[mime][name]['permissions'] = permissions; + this.actions[mime][name]['displayName'] = displayName; + this.icons[name] = icon; + }, + clear: function() { + this.actions = {}; + this.defaults = {}; + this.icons = {}; + this.currentFile = null; + }, + setDefault: function (mime, name) { + this.defaults[mime] = name; + }, + get: function (mime, type, permissions) { + var actions = this.getActions(mime, type, permissions); + var filteredActions = {}; + $.each(actions, function (name, action) { + filteredActions[name] = action.action; + }); + return filteredActions; + }, + getActions: function (mime, type, permissions) { + var actions = {}; + if (this.actions.all) { + actions = $.extend(actions, this.actions.all); } - }); - return filteredActions; - }, - getDefault: function (mime, type, permissions) { - var mimePart; - if (mime) { - mimePart = mime.substr(0, mime.indexOf('/')); - } - var name = false; - if (mime && FileActions.defaults[mime]) { - name = FileActions.defaults[mime]; - } else if (mime && FileActions.defaults[mimePart]) { - name = FileActions.defaults[mimePart]; - } else if (type && FileActions.defaults[type]) { - name = FileActions.defaults[type]; - } else { - name = FileActions.defaults.all; - } - var actions = this.get(mime, type, permissions); - return actions[name]; - }, - /** - * Display file actions for the given element - * @param parent "td" element of the file for which to display actions - * @param triggerEvent if true, triggers the fileActionsReady on the file - * list afterwards (false by default) - */ - display: function (parent, triggerEvent) { - FileActions.currentFile = parent; - var actions = FileActions.getActions(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); - var file = FileActions.getCurrentFile(); - var nameLinks; - if (FileList.findFileEl(file).data('renaming')) { - return; - } + if (type) {//type is 'dir' or 'file' + if (this.actions[type]) { + actions = $.extend(actions, this.actions[type]); + } + } + if (mime) { + var mimePart = mime.substr(0, mime.indexOf('/')); + if (this.actions[mimePart]) { + actions = $.extend(actions, this.actions[mimePart]); + } + if (this.actions[mime]) { + actions = $.extend(actions, this.actions[mime]); + } + } + var filteredActions = {}; + $.each(actions, function (name, action) { + if (action.permissions & permissions) { + filteredActions[name] = action; + } + }); + return filteredActions; + }, + getDefault: function (mime, type, permissions) { + var mimePart; + if (mime) { + mimePart = mime.substr(0, mime.indexOf('/')); + } + var name = false; + if (mime && this.defaults[mime]) { + name = this.defaults[mime]; + } else if (mime && this.defaults[mimePart]) { + name = this.defaults[mimePart]; + } else if (type && this.defaults[type]) { + name = this.defaults[type]; + } else { + name = this.defaults.all; + } + var actions = this.get(mime, type, permissions); + return actions[name]; + }, + /** + * Display file actions for the given element + * @param parent "td" element of the file for which to display actions + * @param triggerEvent if true, triggers the fileActionsReady on the file + * list afterwards (false by default) + */ + display: function (parent, triggerEvent) { + this.currentFile = parent; + var self = this; + var actions = this.getActions(this.getCurrentMimeType(), this.getCurrentType(), this.getCurrentPermissions()); + var file = this.getCurrentFile(); + var nameLinks; + if (parent.closest('tr').data('renaming')) { + return; + } + + // recreate fileactions + nameLinks = parent.children('a.name'); + nameLinks.find('.fileactions, .nametext .action').remove(); + nameLinks.append(''); + var defaultAction = this.getDefault(this.getCurrentMimeType(), this.getCurrentType(), this.getCurrentPermissions()); - // recreate fileactions - nameLinks = parent.children('a.name'); - nameLinks.find('.fileactions, .nametext .action').remove(); - nameLinks.append(''); - var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); + var actionHandler = function (event) { + event.stopPropagation(); + event.preventDefault(); - var actionHandler = function (event) { - event.stopPropagation(); - event.preventDefault(); + self.currentFile = event.data.elem; + var file = self.getCurrentFile(); - FileActions.currentFile = event.data.elem; - var file = FileActions.getCurrentFile(); + event.data.actionFunc(file); + }; - event.data.actionFunc(file); - }; + var addAction = function (name, action, displayName) { - var addAction = function (name, action, displayName) { + if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') { - if ((name === 'Download' || action !== defaultAction) && name !== 'Delete') { + var img = self.icons[name], + actionText = displayName, + actionContainer = 'a.name>span.fileactions'; - var img = FileActions.icons[name], - actionText = displayName, - actionContainer = 'a.name>span.fileactions'; + if (name === 'Rename') { + // rename has only an icon which appears behind + // the file name + actionText = ''; + actionContainer = 'a.name span.nametext'; + } + if (img.call) { + img = img(file); + } + var html = ''; + if (img) { + html += ''; + } + html += ' ' + actionText + ''; - if (name === 'Rename') { - // rename has only an icon which appears behind - // the file name - actionText = ''; - actionContainer = 'a.name span.nametext'; + var element = $(html); + element.data('action', name); + element.on('click', {a: null, elem: parent, actionFunc: actions[name].action}, actionHandler); + parent.find(actionContainer).append(element); } + + }; + + $.each(actions, function (name, action) { + if (name !== 'Share') { + displayName = action.displayName; + ah = action.action; + + addAction(name, ah, displayName); + } + }); + if(actions.Share){ + displayName = t('files', 'Share'); + addAction('Share', actions.Share, displayName); + } + + // remove the existing delete action + parent.parent().children().last().find('.action.delete').remove(); + if (actions['Delete']) { + var img = self.icons['Delete']; + var html; if (img.call) { img = img(file); } - var html = ''; - if (img) { - html += ''; + if (typeof trashBinApp !== 'undefined' && trashBinApp) { + html = ''; + } else { + html = ''; } - html += ' ' + actionText + ''; - var element = $(html); - element.data('action', name); - element.on('click', {a: null, elem: parent, actionFunc: actions[name].action}, actionHandler); - parent.find(actionContainer).append(element); + element.data('action', actions['Delete']); + element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler); + parent.parent().children().last().append(element); } - }; + if (triggerEvent){ + $('#fileList').trigger(jQuery.Event("fileActionsReady")); + } + }, + getCurrentFile: function () { + return this.currentFile.parent().attr('data-file'); + }, + getCurrentMimeType: function () { + return this.currentFile.parent().attr('data-mime'); + }, + getCurrentType: function () { + return this.currentFile.parent().attr('data-type'); + }, + getCurrentPermissions: function () { + return this.currentFile.parent().data('permissions'); + }, - $.each(actions, function (name, action) { - if (name !== 'Share') { - displayName = action.displayName; - ah = action.action; + /** + * Register the actions that are used by default for the files app. + */ + registerDefaultActions: function(fileList) { + // TODO: try to find a way to not make it depend on fileList, + // maybe get a handler or listener to trigger events on + this.register('all', 'Delete', OC.PERMISSION_DELETE, function () { + return OC.imagePath('core', 'actions/delete'); + }, function (filename) { + fileList.do_delete(filename); + $('.tipsy').remove(); + }); - addAction(name, ah, displayName); - } - }); - if(actions.Share){ - displayName = t('files', 'Share'); - addAction('Share', actions.Share, displayName); - } + // t('files', 'Rename') + this.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { + return OC.imagePath('core', 'actions/rename'); + }, function (filename) { + fileList.rename(filename); + }); - // remove the existing delete action - parent.parent().children().last().find('.action.delete').remove(); - if (actions['Delete']) { - var img = FileActions.icons['Delete']; - var html; - if (img.call) { - img = img(file); - } - if (typeof trashBinApp !== 'undefined' && trashBinApp) { - html = ''; + this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { + var dir = fileList.getCurrentDirectory(); + if (dir !== '/') { + dir = dir + '/'; + } + fileList.changeDirectory(dir + filename); + }); + + this.setDefault('dir', 'Open'); + var downloadScope; + if ($('#allowZipDownload').val() == 1) { + downloadScope = 'all'; } else { - html = ''; + downloadScope = 'file'; } - var element = $(html); - element.data('action', actions['Delete']); - element.on('click', {a: null, elem: parent, actionFunc: actions['Delete'].action}, actionHandler); - parent.parent().children().last().append(element); - } - if (triggerEvent){ - $('#fileList').trigger(jQuery.Event("fileActionsReady")); + this.register(downloadScope, 'Download', OC.PERMISSION_READ, function () { + return OC.imagePath('core', 'actions/download'); + }, function (filename) { + var url = fileList.getDownloadUrl(filename, fileList.getCurrentDirectory()); + if (url) { + OC.redirect(url); + } + }); + + fileList.$fileList.trigger(jQuery.Event("fileActionsReady")); } - }, - getCurrentFile: function () { - return FileActions.currentFile.parent().attr('data-file'); - }, - getCurrentMimeType: function () { - return FileActions.currentFile.parent().attr('data-mime'); - }, - getCurrentType: function () { - return FileActions.currentFile.parent().attr('data-type'); - }, - getCurrentPermissions: function () { - return FileActions.currentFile.parent().data('permissions'); - } -}; - -$(document).ready(function () { - var downloadScope; - if ($('#allowZipDownload').val() == 1) { - downloadScope = 'all'; - } else { - downloadScope = 'file'; - } - - if (typeof disableDownloadActions == 'undefined' || !disableDownloadActions) { - FileActions.register(downloadScope, 'Download', OC.PERMISSION_READ, function () { - return OC.imagePath('core', 'actions/download'); - }, function (filename) { - var url = Files.getDownloadUrl(filename); - if (url) { - OC.redirect(url); - } - }); - } - $('#fileList tr').each(function () { - FileActions.display($(this).children('td.filename')); - }); - - $('#fileList').trigger(jQuery.Event("fileActionsReady")); - -}); - -FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () { - return OC.imagePath('core', 'actions/delete'); -}, function (filename) { - FileList.do_delete(filename); - $('.tipsy').remove(); -}); - -// t('files', 'Rename') -FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { - return OC.imagePath('core', 'actions/rename'); -}, function (filename) { - FileList.rename(filename); -}); - -FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { - var dir = $('#dir').val() || '/'; - if (dir !== '/') { - dir = dir + '/'; - } - FileList.changeDirectory(dir + filename); -}); - -FileActions.setDefault('dir', 'Open'); + }; + + OCA.Files.FileActions = FileActions; +})(); + +// for backward compatibility +window.FileActions = OCA.Files.FileActions; + diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 8896a8e23a87d53674f6e7b7c8f6b07baedcca85..72e1a688041b0cd29619c7e348295cd1fa438567 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -8,1540 +8,1763 @@ * */ -/* global OC, t, n, FileList, FileActions, Files, FileSummary, BreadCrumb */ -/* global dragOptions, folderDropOptions */ -window.FileList = { - appName: t('files', 'Files'), - isEmpty: true, - useUndo:true, - $el: $('#filestable'), - $fileList: $('#fileList'), - breadcrumb: null, - +(function() { /** - * Instance of FileSummary + * The FileList class manages a file list view. + * A file list view consists of a controls bar and + * a file list table. */ - fileSummary: null, - initialized: false, - - // number of files per page - pageSize: 20, + var FileList = function($el, options) { + this.initialize($el, options); + }; + FileList.prototype = { + SORT_INDICATOR_ASC_CLASS: 'icon-triangle-s', + SORT_INDICATOR_DESC_CLASS: 'icon-triangle-n', + + id: 'files', + appName: t('files', 'Files'), + isEmpty: true, + useUndo:true, + + /** + * Top-level container with controls and file list + */ + $el: null, + + /** + * Files table + */ + $table: null, + + /** + * List of rows (table tbody) + */ + $fileList: null, + + breadcrumb: null, + + /** + * Instance of FileSummary + */ + fileSummary: null, + initialized: false, + + // number of files per page + pageSize: 20, + + /** + * Array of files in the current folder. + * The entries are of file data. + */ + files: [], + + /** + * File actions handler, defaults to OCA.Files.FileActions + */ + fileActions: null, + + /** + * Map of file id to file data + */ + _selectedFiles: {}, + + /** + * Summary of selected files. + * Instance of FileSummary. + */ + _selectionSummary: null, + + /** + * Sort attribute + */ + _sort: 'name', + + /** + * Sort direction: 'asc' or 'desc' + */ + _sortDirection: 'asc', + + /** + * Sort comparator function for the current sort + */ + _sortComparator: null, + + /** + * Current directory + */ + _currentDirectory: null, + + _dragOptions: null, + _folderDropOptions: null, + + /** + * Initialize the file list and its components + * + * @param $el container element with existing markup for the #controls + * and a table + * @param options map of options, see other parameters + * @param scrollContainer scrollable container, defaults to $(window) + * @param dragOptions drag options, disabled by default + * @param folderDropOptions folder drop options, disabled by default + */ + initialize: function($el, options) { + var self = this; + options = options || {}; + if (this.initialized) { + return; + } - /** - * Array of files in the current folder. - * The entries are of file data. - */ - files: [], + if (options.dragOptions) { + this._dragOptions = options.dragOptions; + } + if (options.folderDropOptions) { + this._folderDropOptions = options.folderDropOptions; + } - /** - * Map of file id to file data - */ - _selectedFiles: {}, + this.$el = $el; + this.$container = options.scrollContainer || $(window); + this.$table = $el.find('table:first'); + this.$fileList = $el.find('#fileList'); + this.fileActions = OCA.Files.FileActions; + this.files = []; + this._selectedFiles = {}; + this._selectionSummary = new OCA.Files.FileSummary(); - /** - * Summary of selected files. - * Instance of FileSummary. - */ - _selectionSummary: null, + this.fileSummary = this._createSummary(); - /** - * Compare two file info objects, sorting by - * folders first, then by name. - */ - _fileInfoCompare: function(fileInfo1, fileInfo2) { - if (fileInfo1.type === 'dir' && fileInfo2.type !== 'dir') { - return -1; - } - if (fileInfo1.type !== 'dir' && fileInfo2.type === 'dir') { - return 1; - } - return fileInfo1.name.localeCompare(fileInfo2.name); - }, + this.setSort('name', 'asc'); - /** - * Initialize the file list and its components - */ - initialize: function() { - var self = this; - if (this.initialized) { - return; - } + var breadcrumbOptions = { + onClick: _.bind(this._onClickBreadCrumb, this), + getCrumbUrl: function(part) { + return self.linkTo(part.dir); + } + }; + // if dropping on folders is allowed, then also allow on breadcrumbs + if (this._folderDropOptions) { + breadcrumbOptions.onDrop = _.bind(this._onDropOnBreadCrumb, this); + } + this.breadcrumb = new OCA.Files.BreadCrumb(breadcrumbOptions); - // TODO: FileList should not know about global elements - this.$el = $('#filestable'); - this.$fileList = $('#fileList'); - this.files = []; - this._selectedFiles = {}; - this._selectionSummary = new FileSummary(); + this.$el.find('#controls').prepend(this.breadcrumb.$el); - this.fileSummary = this._createSummary(); + this.$el.find('thead th .columntitle').click(_.bind(this._onClickHeader, this)); - this.breadcrumb = new BreadCrumb({ - onClick: this._onClickBreadCrumb, - onDrop: _.bind(this._onDropOnBreadCrumb, this), - getCrumbUrl: function(part, index) { - return self.linkTo(part.dir); - } - }); + $(window).resize(function() { + // TODO: debounce this ? + var width = $(this).width(); + self.breadcrumb.resize(width, false); + }); - $('#controls').prepend(this.breadcrumb.$el); + this.$fileList.on('click','td.filename>a.name', _.bind(this._onClickFile, this)); + this.$fileList.on('change', 'td.filename>input:checkbox', _.bind(this._onClickFileCheckbox, this)); + this.$el.on('urlChanged', _.bind(this._onUrlChanged, this)); + this.$el.find('.select-all').click(_.bind(this._onClickSelectAll, this)); + this.$el.find('.download').click(_.bind(this._onClickDownloadSelected, this)); + this.$el.find('.delete-selected').click(_.bind(this._onClickDeleteSelected, this)); - $(window).resize(function() { - // TODO: debounce this ? - var width = $(this).width(); - FileList.breadcrumb.resize(width, false); - }); + this.setupUploadEvents(); - this.$fileList.on('click','td.filename>a.name', _.bind(this._onClickFile, this)); - this.$fileList.on('change', 'td.filename>input:checkbox', _.bind(this._onClickFileCheckbox, this)); - this.$el.find('#select_all').click(_.bind(this._onClickSelectAll, this)); - this.$el.find('.download').click(_.bind(this._onClickDownloadSelected, this)); - this.$el.find('.delete-selected').click(_.bind(this._onClickDeleteSelected, this)); - }, + this.$container.on('scroll', _.bind(this._onScroll, this)); + }, - /** - * Selected/deselects the given file element and updated - * the internal selection cache. - * - * @param $tr single file row element - * @param state true to select, false to deselect - */ - _selectFileEl: function($tr, state) { - var $checkbox = $tr.find('td.filename>input:checkbox'); - var oldData = !!this._selectedFiles[$tr.data('id')]; - var data; - $checkbox.prop('checked', state); - $tr.toggleClass('selected', state); - // already selected ? - if (state === oldData) { - return; - } - data = this.elementToFile($tr); - if (state) { - this._selectedFiles[$tr.data('id')] = data; - this._selectionSummary.add(data); - } - else { - delete this._selectedFiles[$tr.data('id')]; - this._selectionSummary.remove(data); - } - this.$el.find('#select_all').prop('checked', this._selectionSummary.getTotal() === this.files.length); - }, + /** + * Event handler for when the URL changed + */ + _onUrlChanged: function(e) { + if (e && e.dir) { + this.changeDirectory(e.dir, false, true); + } + }, + + /** + * Selected/deselects the given file element and updated + * the internal selection cache. + * + * @param $tr single file row element + * @param state true to select, false to deselect + */ + _selectFileEl: function($tr, state) { + var $checkbox = $tr.find('td.filename>input:checkbox'); + var oldData = !!this._selectedFiles[$tr.data('id')]; + var data; + $checkbox.prop('checked', state); + $tr.toggleClass('selected', state); + // already selected ? + if (state === oldData) { + return; + } + data = this.elementToFile($tr); + if (state) { + this._selectedFiles[$tr.data('id')] = data; + this._selectionSummary.add(data); + } + else { + delete this._selectedFiles[$tr.data('id')]; + this._selectionSummary.remove(data); + } + this.$el.find('.select-all').prop('checked', this._selectionSummary.getTotal() === this.files.length); + }, + + /** + * Event handler for when clicking on files to select them + */ + _onClickFile: function(event) { + var $tr = $(event.target).closest('tr'); + if (event.ctrlKey || event.shiftKey) { + event.preventDefault(); + if (event.shiftKey) { + var $lastTr = $(this._lastChecked); + var lastIndex = $lastTr.index(); + var currentIndex = $tr.index(); + var $rows = this.$fileList.children('tr'); + + // last clicked checkbox below current one ? + if (lastIndex > currentIndex) { + var aux = lastIndex; + lastIndex = currentIndex; + currentIndex = aux; + } - /** - * Event handler for when clicking on files to select them - */ - _onClickFile: function(event) { - var $tr = $(event.target).closest('tr'); - if (event.ctrlKey || event.shiftKey) { - event.preventDefault(); - if (event.shiftKey) { - var $lastTr = $(this._lastChecked); - var lastIndex = $lastTr.index(); - var currentIndex = $tr.index(); - var $rows = this.$fileList.children('tr'); - - // last clicked checkbox below current one ? - if (lastIndex > currentIndex) { - var aux = lastIndex; - lastIndex = currentIndex; - currentIndex = aux; + // auto-select everything in-between + for (var i = lastIndex + 1; i < currentIndex; i++) { + this._selectFileEl($rows.eq(i), true); + } } - - // auto-select everything in-between - for (var i = lastIndex + 1; i < currentIndex; i++) { - this._selectFileEl($rows.eq(i), true); + else { + this._lastChecked = $tr; + } + var $checkbox = $tr.find('td.filename>input:checkbox'); + this._selectFileEl($tr, !$checkbox.prop('checked')); + this.updateSelectionSummary(); + } else { + var filename = $tr.attr('data-file'); + var renaming = $tr.data('renaming'); + if (!renaming) { + this.fileActions.currentFile = $tr.find('td'); + var mime = this.fileActions.getCurrentMimeType(); + var type = this.fileActions.getCurrentType(); + var permissions = this.fileActions.getCurrentPermissions(); + var action = this.fileActions.getDefault(mime,type, permissions); + if (action) { + event.preventDefault(); + action(filename); + } } } - else { - this._lastChecked = $tr; + }, + + /** + * Event handler for when clicking on a file's checkbox + */ + _onClickFileCheckbox: function(e) { + var $tr = $(e.target).closest('tr'); + this._selectFileEl($tr, !$tr.hasClass('selected')); + this._lastChecked = $tr; + this.updateSelectionSummary(); + }, + + /** + * Event handler for when selecting/deselecting all files + */ + _onClickSelectAll: function(e) { + var checked = $(e.target).prop('checked'); + this.$fileList.find('td.filename>input:checkbox').prop('checked', checked) + .closest('tr').toggleClass('selected', checked); + this._selectedFiles = {}; + this._selectionSummary.clear(); + if (checked) { + for (var i = 0; i < this.files.length; i++) { + var fileData = this.files[i]; + this._selectedFiles[fileData.id] = fileData; + this._selectionSummary.add(fileData); + } } - var $checkbox = $tr.find('td.filename>input:checkbox'); - this._selectFileEl($tr, !$checkbox.prop('checked')); this.updateSelectionSummary(); - } else { - var filename = $tr.attr('data-file'); - var renaming = $tr.data('renaming'); - if (!renaming) { - FileActions.currentFile = $tr.find('td'); - var mime=FileActions.getCurrentMimeType(); - var type=FileActions.getCurrentType(); - var permissions = FileActions.getCurrentPermissions(); - var action=FileActions.getDefault(mime,type, permissions); - if (action) { - event.preventDefault(); - action(filename); + }, + + /** + * Event handler for when clicking on "Download" for the selected files + */ + _onClickDownloadSelected: function(event) { + var files; + var dir = this.getCurrentDirectory(); + if (this.isAllSelected()) { + files = OC.basename(dir); + dir = OC.dirname(dir) || '/'; + } + else { + files = _.pluck(this.getSelectedFiles(), 'name'); + } + OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.')); + OC.redirect(this.getDownloadUrl(files, dir)); + return false; + }, + + /** + * Event handler for when clicking on "Delete" for the selected files + */ + _onClickDeleteSelected: function(event) { + var files = null; + if (!this.isAllSelected()) { + files = _.pluck(this.getSelectedFiles(), 'name'); + } + this.do_delete(files); + event.preventDefault(); + return false; + }, + + /** + * Event handler when clicking on a table header + */ + _onClickHeader: function(e) { + var $target = $(e.target); + var sort; + if (!$target.is('a')) { + $target = $target.closest('a'); + } + sort = $target.attr('data-sort'); + if (sort) { + if (this._sort === sort) { + this.setSort(sort, (this._sortDirection === 'desc')?'asc':'desc'); } + else { + this.setSort(sort, 'asc'); + } + this.reload(); + } + }, + + /** + * Event handler when clicking on a bread crumb + */ + _onClickBreadCrumb: function(e) { + var $el = $(e.target).closest('.crumb'), + $targetDir = $el.data('dir'); + + if ($targetDir !== undefined) { + e.preventDefault(); + this.changeDirectory($targetDir); + } + }, + + /** + * Event handler for when scrolling the list container. + * This appends/renders the next page of entries when reaching the bottom. + */ + _onScroll: function(e) { + if (this.$container.scrollTop() + this.$container.height() > this.$el.height() - 100) { + this._nextPage(true); + } + }, + + /** + * Event handler when dropping on a breadcrumb + */ + _onDropOnBreadCrumb: function( event, ui ) { + var $target = $(event.target); + if (!$target.is('.crumb')) { + $target = $target.closest('.crumb'); + } + var targetPath = $(event.target).data('dir'); + var dir = this.getCurrentDirectory(); + while (dir.substr(0,1) === '/') {//remove extra leading /'s + dir = dir.substr(1); + } + dir = '/' + dir; + if (dir.substr(-1,1) !== '/') { + dir = dir + '/'; + } + // do nothing if dragged on current dir + if (targetPath === dir || targetPath + '/' === dir) { + return; } - } - }, - /** - * Event handler for when clicking on a file's checkbox - */ - _onClickFileCheckbox: function(e) { - var $tr = $(e.target).closest('tr'); - this._selectFileEl($tr, !$tr.hasClass('selected')); - this._lastChecked = $tr; - this.updateSelectionSummary(); - }, + var files = this.getSelectedFiles(); + if (files.length === 0) { + // single one selected without checkbox? + files = _.map(ui.helper.find('tr'), this.elementToFile); + } - /** - * Event handler for when selecting/deselecting all files - */ - _onClickSelectAll: function(e) { - var checked = $(e.target).prop('checked'); - this.$fileList.find('td.filename>input:checkbox').prop('checked', checked) - .closest('tr').toggleClass('selected', checked); - this._selectedFiles = {}; - this._selectionSummary.clear(); - if (checked) { - for (var i = 0; i < this.files.length; i++) { - var fileData = this.files[i]; - this._selectedFiles[fileData.id] = fileData; - this._selectionSummary.add(fileData); + this.move(_.pluck(files, 'name'), targetPath); + }, + + /** + * Sets a new page title + */ + setPageTitle: function(title){ + if (title) { + title += ' - '; + } else { + title = ''; } - } - this.updateSelectionSummary(); - }, + title += this.appName; + // Sets the page title with the " - ownCloud" suffix as in templates + window.document.title = title + ' - ' + oc_defaults.title; - /** - * Event handler for when clicking on "Download" for the selected files - */ - _onClickDownloadSelected: function(event) { - var files; - var dir = this.getCurrentDirectory(); - if (this.isAllSelected()) { - files = OC.basename(dir); - dir = OC.dirname(dir) || '/'; - } - else { - files = _.pluck(this.getSelectedFiles(), 'name'); - } - OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.')); - OC.redirect(Files.getDownloadUrl(files, dir)); - return false; - }, + return true; + }, + /** + * Returns the tr element for a given file name + * @param fileName file name + */ + findFileEl: function(fileName){ + // use filterAttr to avoid escaping issues + return this.$fileList.find('tr').filterAttr('data-file', fileName); + }, + + /** + * Returns the file data from a given file element. + * @param $el file tr element + * @return file data + */ + elementToFile: function($el){ + $el = $($el); + return { + id: parseInt($el.attr('data-id'), 10), + name: $el.attr('data-file'), + mimetype: $el.attr('data-mime'), + type: $el.attr('data-type'), + size: parseInt($el.attr('data-size'), 10), + etag: $el.attr('data-etag') + }; + }, + + /** + * Appends the next page of files into the table + * @param animate true to animate the new elements + */ + _nextPage: function(animate) { + var index = this.$fileList.children().length, + count = this.pageSize, + tr, + fileData, + newTrs = [], + isAllSelected = this.isAllSelected(); + + if (index >= this.files.length) { + return; + } - /** - * Event handler for when clicking on "Delete" for the selected files - */ - _onClickDeleteSelected: function(event) { - var files = null; - if (!FileList.isAllSelected()) { - files = _.pluck(this.getSelectedFiles(), 'name'); - } - this.do_delete(files); - event.preventDefault(); - return false; - }, + while (count > 0 && index < this.files.length) { + fileData = this.files[index]; + tr = this._renderRow(fileData, {updateSummary: false}); + this.$fileList.append(tr); + if (isAllSelected || this._selectedFiles[fileData.id]) { + tr.addClass('selected'); + tr.find('input:checkbox').prop('checked', true); + } + if (animate) { + tr.addClass('appear transparent'); + newTrs.push(tr); + } + index++; + count--; + } - /** - * Event handler when clicking on a bread crumb - */ - _onClickBreadCrumb: function(e) { - var $el = $(e.target).closest('.crumb'), - $targetDir = $el.data('dir'); + if (animate) { + // defer, for animation + window.setTimeout(function() { + for (var i = 0; i < newTrs.length; i++ ) { + newTrs[i].removeClass('transparent'); + } + }, 0); + } + }, - if ($targetDir !== undefined) { - e.preventDefault(); - FileList.changeDirectory($targetDir); - } - }, + /** + * Sets the files to be displayed in the list. + * This operation will re-render the list and update the summary. + * @param filesArray array of file data (map) + */ + setFiles: function(filesArray) { + // detach to make adding multiple rows faster + this.files = filesArray; - _onScroll: function(e) { - if ($(window).scrollTop() + $(window).height() > $(document).height() - 500) { - this._nextPage(true); - } - }, + this.$fileList.detach(); + this.$fileList.empty(); - /** - * Event handler when dropping on a breadcrumb - */ - _onDropOnBreadCrumb: function( event, ui ) { - var $target = $(event.target); - if (!$target.is('.crumb')) { - $target = $target.closest('.crumb'); - } - var targetPath = $(event.target).data('dir'); - var dir = this.getCurrentDirectory(); - while (dir.substr(0,1) === '/') {//remove extra leading /'s - dir = dir.substr(1); - } - dir = '/' + dir; - if (dir.substr(-1,1) !== '/') { - dir = dir + '/'; - } - // do nothing if dragged on current dir - if (targetPath === dir || targetPath + '/' === dir) { - return; - } + // clear "Select all" checkbox + this.$el.find('.select-all').prop('checked', false); - var files = this.getSelectedFiles(); - if (files.length === 0) { - // single one selected without checkbox? - files = _.map(ui.helper.find('tr'), FileList.elementToFile); - } + this.isEmpty = this.files.length === 0; + this._nextPage(); - FileList.move(_.pluck(files, 'name'), targetPath); - }, + this.$el.find('thead').after(this.$fileList); - /** - * Sets a new page title - */ - setPageTitle: function(title){ - if (title) { - title += ' - '; - } else { - title = ''; - } - title += FileList.appName; - // Sets the page title with the " - ownCloud" suffix as in templates - window.document.title = title + ' - ' + oc_defaults.title; + this.updateEmptyContent(); + this.$fileList.trigger(jQuery.Event("fileActionsReady")); - return true; - }, - /** - * Returns the tr element for a given file name - * @param fileName file name - */ - findFileEl: function(fileName){ - // use filterAttr to avoid escaping issues - return this.$fileList.find('tr').filterAttr('data-file', fileName); - }, + this.fileSummary.calculate(filesArray); - /** - * Returns the file data from a given file element. - * @param $el file tr element - * @return file data - */ - elementToFile: function($el){ - $el = $($el); - return { - id: parseInt($el.attr('data-id'), 10), - name: $el.attr('data-file'), - mimetype: $el.attr('data-mime'), - type: $el.attr('data-type'), - size: parseInt($el.attr('data-size'), 10), - etag: $el.attr('data-etag') - }; - }, + this.updateSelectionSummary(); + $(window).scrollTop(0); + + this.$fileList.trigger(jQuery.Event("updated")); + }, + /** + * Creates a new table row element using the given file data. + * @param fileData map of file attributes + * @param options map of attribute "loading" whether the entry is currently loading + * @return new tr element (not appended to the table) + */ + _createRow: function(fileData, options) { + var td, simpleSize, basename, extension, sizeColor, + icon = OC.Util.replaceSVGIcon(fileData.icon), + name = fileData.name, + type = fileData.type || 'file', + mtime = parseInt(fileData.mtime, 10) || new Date().getTime(), + mime = fileData.mimetype, + linkUrl; + options = options || {}; + + if (type === 'dir') { + mime = mime || 'httpd/unix-directory'; + } - /** - * Appends the next page of files into the table - * @param animate true to animate the new elements - */ - _nextPage: function(animate) { - var index = this.$fileList.children().length, - count = this.pageSize, - tr, - fileData, - newTrs = [], - isAllSelected = this.isAllSelected(); - - if (index >= this.files.length) { - return; - } + //containing tr + var tr = $('').attr({ + "data-id" : fileData.id, + "data-type": type, + "data-size": fileData.size, + "data-file": name, + "data-mime": mime, + "data-mtime": mtime, + "data-etag": fileData.etag, + "data-permissions": fileData.permissions || this.getDirectoryPermissions() + }); - while (count > 0 && index < this.files.length) { - fileData = this.files[index]; - tr = this._renderRow(fileData, {updateSummary: false}); - this.$fileList.append(tr); - if (isAllSelected || this._selectedFiles[fileData.id]) { - tr.addClass('selected'); - tr.find('input:checkbox').prop('checked', true); + if (type === 'dir') { + // use default folder icon + icon = icon || OC.imagePath('core', 'filetypes/folder'); } - if (animate) { - tr.addClass('appear transparent'); - newTrs.push(tr); + else { + icon = icon || OC.imagePath('core', 'filetypes/file'); } - index++; - count--; - } - if (animate) { - // defer, for animation - window.setTimeout(function() { - for (var i = 0; i < newTrs.length; i++ ) { - newTrs[i].removeClass('transparent'); - } - }, 0); - } - }, + // filename td + td = $('').attr({ + "class": "filename", + "style": 'background-image:url(' + icon + '); background-size: 32px;' + }); - /** - * Sets the files to be displayed in the list. - * This operation will re-render the list and update the summary. - * @param filesArray array of file data (map) - */ - setFiles: function(filesArray) { - // detach to make adding multiple rows faster - this.files = filesArray; + // linkUrl + if (type === 'dir') { + linkUrl = this.linkTo(this.getCurrentDirectory() + '/' + name); + } + else { + linkUrl = this.getDownloadUrl(name, this.getCurrentDirectory()); + } + td.append(''); + var linkElem = $('').attr({ + "class": "name", + "href": linkUrl + }); - this.$fileList.detach(); - this.$fileList.empty(); + // from here work on the display name + name = fileData.displayName || name; - // clear "Select all" checkbox - this.$el.find('#select_all').prop('checked', false); + // split extension from filename for non dirs + if (type !== 'dir' && name.indexOf('.') !== -1) { + basename = name.substr(0, name.lastIndexOf('.')); + extension = name.substr(name.lastIndexOf('.')); + } else { + basename = name; + extension = false; + } + var nameSpan=$('').addClass('nametext').text(basename); + linkElem.append(nameSpan); + if (extension) { + nameSpan.append($('').addClass('extension').text(extension)); + } + // dirs can show the number of uploaded files + if (type === 'dir') { + linkElem.append($('').attr({ + 'class': 'uploadtext', + 'currentUploads': 0 + })); + } + td.append(linkElem); + tr.append(td); - this.isEmpty = this.files.length === 0; - this._nextPage(); + // size column + if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) { + simpleSize = humanFileSize(parseInt(fileData.size, 10)); + sizeColor = Math.round(160-Math.pow((fileData.size/(1024*1024)),2)); + } else { + simpleSize = t('files', 'Pending'); + } - this.$el.find('thead').after(this.$fileList); + td = $('').attr({ + "class": "filesize", + "style": 'color:rgb(' + sizeColor + ',' + sizeColor + ',' + sizeColor + ')' + }).text(simpleSize); + tr.append(td); + + // date column + var modifiedColor = Math.round((Math.round((new Date()).getTime() / 1000) - mtime)/60/60/24*5); + td = $('').attr({ "class": "date" }); + td.append($('').attr({ + "class": "modified", + "title": formatDate(mtime), + "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' + }).text( relative_modified_date(mtime / 1000) )); + tr.find('.filesize').text(simpleSize); + tr.append(td); + return tr; + }, + + /** + * Adds an entry to the files array and also into the DOM + * in a sorted manner. + * + * @param fileData map of file attributes + * @param options map of attributes: + * - "updateSummary" true to update the summary after adding (default), false otherwise + * @return new tr element (not appended to the table) + */ + add: function(fileData, options) { + var index = -1; + var $tr; + var $rows; + var $insertionPoint; + options = options || {}; + + // there are three situations to cover: + // 1) insertion point is visible on the current page + // 2) insertion point is on a not visible page (visible after scrolling) + // 3) insertion point is at the end of the list + + $rows = this.$fileList.children(); + index = this._findInsertionIndex(fileData); + if (index > this.files.length) { + index = this.files.length; + } + else { + $insertionPoint = $rows.eq(index); + } - this.updateEmptyContent(); - this.$fileList.trigger(jQuery.Event("fileActionsReady")); - // "Files" might not be loaded in extending apps - if (window.Files) { - Files.setupDragAndDrop(); - } + // is the insertion point visible ? + if ($insertionPoint.length) { + // only render if it will really be inserted + $tr = this._renderRow(fileData, options); + $insertionPoint.before($tr); + } + else { + // if insertion point is after the last visible + // entry, append + if (index === $rows.length) { + $tr = this._renderRow(fileData, options); + this.$fileList.append($tr); + } + } - this.fileSummary.calculate(filesArray); + this.isEmpty = false; + this.files.splice(index, 0, fileData); - FileList.updateSelectionSummary(); - $(window).scrollTop(0); + if ($tr && options.animate) { + $tr.addClass('appear transparent'); + window.setTimeout(function() { + $tr.removeClass('transparent'); + }); + } - this.$fileList.trigger(jQuery.Event("updated")); - }, - /** - * Creates a new table row element using the given file data. - * @param fileData map of file attributes - * @param options map of attribute "loading" whether the entry is currently loading - * @return new tr element (not appended to the table) - */ - _createRow: function(fileData, options) { - var td, simpleSize, basename, extension, sizeColor, - icon = OC.Util.replaceSVGIcon(fileData.icon), - name = fileData.name, - type = fileData.type || 'file', - mtime = parseInt(fileData.mtime, 10) || new Date().getTime(), - mime = fileData.mimetype, - linkUrl; - options = options || {}; - - if (type === 'dir') { - mime = mime || 'httpd/unix-directory'; - } + // defaults to true if not defined + if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { + this.fileSummary.add(fileData, true); + this.updateEmptyContent(); + } - // user should always be able to rename a share mount point - var allowRename = 0; - if (fileData.isShareMountPoint) { - allowRename = OC.PERMISSION_UPDATE; - } + return $tr; + }, + + /** + * Creates a new row element based on the given attributes + * and returns it. + * + * @param fileData map of file attributes + * @param options map of attributes: + * - "index" optional index at which to insert the element + * - "updateSummary" true to update the summary after adding (default), false otherwise + * @return new tr element (not appended to the table) + */ + _renderRow: function(fileData, options) { + options = options || {}; + var type = fileData.type || 'file', + mime = fileData.mimetype, + permissions = parseInt(fileData.permissions, 10) || 0; + + if (fileData.isShareMountPoint) { + permissions = permissions | OC.PERMISSION_UPDATE; + } - //containing tr - var tr = $('').attr({ - "data-id" : fileData.id, - "data-type": type, - "data-size": fileData.size, - "data-file": name, - "data-mime": mime, - "data-mtime": mtime, - "data-etag": fileData.etag, - "data-permissions": fileData.permissions | allowRename || this.getDirectoryPermissions() - }); - - if (type === 'dir') { - // use default folder icon - icon = icon || OC.imagePath('core', 'filetypes/folder'); - } - else { - icon = icon || OC.imagePath('core', 'filetypes/file'); - } + if (type === 'dir') { + mime = mime || 'httpd/unix-directory'; + } + var tr = this._createRow( + fileData, + options + ); + var filenameTd = tr.find('td.filename'); + + // TODO: move dragging to FileActions ? + // enable drag only for deletable files + if (this._dragOptions && permissions & OC.PERMISSION_DELETE) { + filenameTd.draggable(this._dragOptions); + } + // allow dropping on folders + if (this._folderDropOptions && fileData.type === 'dir') { + filenameTd.droppable(this._folderDropOptions); + } - // filename td - td = $('').attr({ - "class": "filename", - "style": 'background-image:url(' + icon + '); background-size: 32px;' - }); + if (options.hidden) { + tr.addClass('hidden'); + } - // linkUrl - if (type === 'dir') { - linkUrl = FileList.linkTo(FileList.getCurrentDirectory() + '/' + name); - } - else { - linkUrl = Files.getDownloadUrl(name, FileList.getCurrentDirectory()); - } - td.append(''); - var linkElem = $('').attr({ - "class": "name", - "href": linkUrl - }); - - // from here work on the display name - name = fileData.displayName || name; - - // split extension from filename for non dirs - if (type !== 'dir' && name.indexOf('.') !== -1) { - basename = name.substr(0, name.lastIndexOf('.')); - extension = name.substr(name.lastIndexOf('.')); - } else { - basename = name; - extension = false; - } - var nameSpan=$('').addClass('nametext').text(basename); - linkElem.append(nameSpan); - if (extension) { - nameSpan.append($('').addClass('extension').text(extension)); - } - // dirs can show the number of uploaded files - if (type === 'dir') { - linkElem.append($('').attr({ - 'class': 'uploadtext', - 'currentUploads': 0 - })); - } - td.append(linkElem); - tr.append(td); - - // size column - if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) { - simpleSize = humanFileSize(parseInt(fileData.size, 10)); - sizeColor = Math.round(160-Math.pow((fileData.size/(1024*1024)),2)); - } else { - simpleSize = t('files', 'Pending'); - } + // display actions + this.fileActions.display(filenameTd, false); + + if (fileData.isPreviewAvailable) { + // lazy load / newly inserted td ? + if (!fileData.icon) { + this.lazyLoadPreview({ + path: this.getCurrentDirectory() + '/' + fileData.name, + mime: mime, + etag: fileData.etag, + callback: function(url) { + filenameTd.css('background-image', 'url(' + url + ')'); + } + }); + } + else { + // set the preview URL directly + var urlSpec = { + file: this.getCurrentDirectory() + '/' + fileData.name, + c: fileData.etag + }; + var previewUrl = this.generatePreviewUrl(urlSpec); + previewUrl = previewUrl.replace('(', '%28').replace(')', '%29'); + filenameTd.css('background-image', 'url(' + previewUrl + ')'); + } + } + return tr; + }, + /** + * Returns the current directory + * @return current directory + */ + getCurrentDirectory: function(){ + return this._currentDirectory || this.$el.find('#dir').val() || '/'; + }, + /** + * Returns the directory permissions + * @return permission value as integer + */ + getDirectoryPermissions: function() { + return parseInt(this.$el.find('#permissions').val(), 10); + }, + /** + * @brief Changes the current directory and reload the file list. + * @param targetDir target directory (non URL encoded) + * @param changeUrl false if the URL must not be changed (defaults to true) + * @param {boolean} force set to true to force changing directory + */ + changeDirectory: function(targetDir, changeUrl, force) { + var currentDir = this.getCurrentDirectory(); + targetDir = targetDir || '/'; + if (!force && currentDir === targetDir) { + return; + } + this._setCurrentDir(targetDir, changeUrl); + this.reload(); + }, + linkTo: function(dir) { + return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); + }, + + /** + * Sets the file actions handler + */ + setFileActions: function(fileActions) { + this.fileActions = fileActions; + }, + + /** + * Sets the current directory name and updates the breadcrumb. + * @param targetDir directory to display + * @param changeUrl true to also update the URL, false otherwise (default) + */ + _setCurrentDir: function(targetDir, changeUrl) { + var previousDir = this.getCurrentDirectory(), + baseDir = OC.basename(targetDir); + + if (baseDir !== '') { + this.setPageTitle(baseDir); + } + else { + this.setPageTitle(); + } - td = $('').attr({ - "class": "filesize", - "style": 'color:rgb(' + sizeColor + ',' + sizeColor + ',' + sizeColor + ')' - }).text(simpleSize); - tr.append(td); - - // date column - var modifiedColor = Math.round((Math.round((new Date()).getTime() / 1000) - mtime)/60/60/24*5); - td = $('').attr({ "class": "date" }); - td.append($('').attr({ - "class": "modified", - "title": formatDate(mtime), - "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' - }).text( relative_modified_date(mtime / 1000) )); - tr.find('.filesize').text(simpleSize); - tr.append(td); - return tr; - }, + this._currentDirectory = targetDir; - /** - * Adds an entry to the files array and also into the DOM - * in a sorted manner. - * - * @param fileData map of file attributes - * @param options map of attributes: - * - "updateSummary" true to update the summary after adding (default), false otherwise - * @return new tr element (not appended to the table) - */ - add: function(fileData, options) { - var index = -1; - var $tr; - var $rows; - var $insertionPoint; - options = options || {}; - - // there are three situations to cover: - // 1) insertion point is visible on the current page - // 2) insertion point is on a not visible page (visible after scrolling) - // 3) insertion point is at the end of the list - - $rows = this.$fileList.children(); - index = this._findInsertionIndex(fileData); - if (index > this.files.length) { - index = this.files.length; - } - else { - $insertionPoint = $rows.eq(index); - } + // legacy stuff + this.$el.find('#dir').val(targetDir); - // is the insertion point visible ? - if ($insertionPoint.length) { - // only render if it will really be inserted - $tr = this._renderRow(fileData, options); - $insertionPoint.before($tr); - } - else { - // if insertion point is after the last visible - // entry, append - if (index === $rows.length) { - $tr = this._renderRow(fileData, options); - this.$fileList.append($tr); + if (changeUrl !== false) { + this.$el.trigger(jQuery.Event('changeDirectory', { + dir: targetDir, + previousDir: previousDir + })); } - } - - this.isEmpty = false; - this.files.splice(index, 0, fileData); - - if ($tr && options.animate) { - $tr.addClass('appear transparent'); - window.setTimeout(function() { - $tr.removeClass('transparent'); + this.breadcrumb.setDirectory(this.getCurrentDirectory()); + }, + /** + * Sets the current sorting and refreshes the list + * + * @param sort sort attribute name + * @param direction sort direction, one of "asc" or "desc" + */ + setSort: function(sort, direction) { + var comparator = FileList.Comparators[sort] || FileList.Comparators.name; + this._sort = sort; + this._sortDirection = (direction === 'desc')?'desc':'asc'; + this._sortComparator = comparator; + if (direction === 'desc') { + this._sortComparator = function(fileInfo1, fileInfo2) { + return -comparator(fileInfo1, fileInfo2); + }; + } + this.$el.find('thead th .sort-indicator') + .removeClass(this.SORT_INDICATOR_ASC_CLASS + ' ' + this.SORT_INDICATOR_DESC_CLASS); + this.$el.find('thead th.column-' + sort + ' .sort-indicator') + .addClass(direction === 'desc' ? this.SORT_INDICATOR_DESC_CLASS : this.SORT_INDICATOR_ASC_CLASS); + }, + /** + * @brief Reloads the file list using ajax call + */ + reload: function() { + var self = this; + this._selectedFiles = {}; + this._selectionSummary.clear(); + this.$el.find('.select-all').prop('checked', false); + this.showMask(); + if (this._reloadCall) { + this._reloadCall.abort(); + } + this._reloadCall = $.ajax({ + url: this.getAjaxUrl('list'), + data: { + dir : this.getCurrentDirectory(), + sort: this._sort, + sortdirection: this._sortDirection + }, + error: function(result) { + self.reloadCallback(result); + }, + success: function(result) { + self.reloadCallback(result); + } }); - } - - // defaults to true if not defined - if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { - this.fileSummary.add(fileData, true); - this.updateEmptyContent(); - } - - return $tr; - }, - - /** - * Creates a new row element based on the given attributes - * and returns it. - * - * @param fileData map of file attributes - * @param options map of attributes: - * - "index" optional index at which to insert the element - * - "updateSummary" true to update the summary after adding (default), false otherwise - * @return new tr element (not appended to the table) - */ - _renderRow: function(fileData, options) { - options = options || {}; - var type = fileData.type || 'file', - mime = fileData.mimetype, - permissions = parseInt(fileData.permissions, 10) || 0; - - if (fileData.isShareMountPoint) { - permissions = permissions | OC.PERMISSION_UPDATE; - } + }, + reloadCallback: function(result) { + delete this._reloadCall; + this.hideMask(); + + if (!result || result.status === 'error') { + OC.Notification.show(result.data.message); + return; + } - if (type === 'dir') { - mime = mime || 'httpd/unix-directory'; - } - var tr = this._createRow( - fileData, - options - ); - var filenameTd = tr.find('td.filename'); - - // TODO: move dragging to FileActions ? - // enable drag only for deletable files - if (permissions & OC.PERMISSION_DELETE) { - filenameTd.draggable(dragOptions); - } - // allow dropping on folders - if (fileData.type === 'dir') { - filenameTd.droppable(folderDropOptions); - } + if (result.status === 404) { + // go back home + this.changeDirectory('/'); + return; + } + // aborted ? + if (result.status === 0){ + return; + } - if (options.hidden) { - tr.addClass('hidden'); - } + // TODO: should rather return upload file size through + // the files list ajax call + this.updateStorageStatistics(true); - // display actions - FileActions.display(filenameTd, false); + if (result.data.permissions) { + this.setDirectoryPermissions(result.data.permissions); + } - if (fileData.isPreviewAvailable) { - // lazy load / newly inserted td ? - if (!fileData.icon) { - Files.lazyLoadPreview(getPathForPreview(fileData.name), mime, function(url) { - filenameTd.css('background-image', 'url(' + url + ')'); - }, null, null, fileData.etag); + this.setFiles(result.data.files); + }, + + updateStorageStatistics: function(force) { + OCA.Files.Files.updateStorageStatistics(this.getCurrentDirectory(), force); + }, + + getAjaxUrl: function(action, params) { + return OCA.Files.Files.getAjaxUrl(action, params); + }, + + getDownloadUrl: function(files, dir) { + return OCA.Files.Files.getDownloadUrl(files, dir || this.getCurrentDirectory()); + }, + + /** + * Generates a preview URL based on the URL space. + * @param urlSpec map with {x: width, y: height, file: file path} + * @return preview URL + */ + generatePreviewUrl: function(urlSpec) { + urlSpec = urlSpec || {}; + if (!urlSpec.x) { + urlSpec.x = this.$table.data('preview-x') || 36; } - else { - // set the preview URL directly - var urlSpec = { - file: FileList.getCurrentDirectory() + '/' + fileData.name, - c: fileData.etag - }; - var previewUrl = Files.generatePreviewUrl(urlSpec); - previewUrl = previewUrl.replace('(', '%28').replace(')', '%29'); - filenameTd.css('background-image', 'url(' + previewUrl + ')'); + if (!urlSpec.y) { + urlSpec.y = this.$table.data('preview-y') || 36; } - } - return tr; - }, - /** - * Returns the current directory - * @return current directory - */ - getCurrentDirectory: function(){ - return $('#dir').val() || '/'; - }, - /** - * Returns the directory permissions - * @return permission value as integer - */ - getDirectoryPermissions: function() { - return parseInt($('#permissions').val(), 10); - }, - /** - * @brief Changes the current directory and reload the file list. - * @param targetDir target directory (non URL encoded) - * @param changeUrl false if the URL must not be changed (defaults to true) - * @param {boolean} force set to true to force changing directory - */ - changeDirectory: function(targetDir, changeUrl, force) { - var $dir = $('#dir'), - currentDir = $dir.val() || '/'; - targetDir = targetDir || '/'; - if (!force && currentDir === targetDir) { - return; - } - FileList._setCurrentDir(targetDir, changeUrl); - $('#fileList').trigger( - jQuery.Event('changeDirectory', { - dir: targetDir, - previousDir: currentDir - } - )); - this._selectedFiles = {}; - this._selectionSummary.clear(); - this.reload(); - }, - linkTo: function(dir) { - return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/'); - }, - - /** - * Sets the current directory name and updates the breadcrumb. - * @param targetDir directory to display - * @param changeUrl true to also update the URL, false otherwise (default) - */ - _setCurrentDir: function(targetDir, changeUrl) { - var url, - baseDir = OC.basename(targetDir); + urlSpec.y *= window.devicePixelRatio; + urlSpec.x *= window.devicePixelRatio; + urlSpec.forceIcon = 0; + return OC.generateUrl('/core/preview.png?') + $.param(urlSpec); + }, + + /** + * Lazy load a file's preview. + * + * @param path path of the file + * @param mime mime type + * @param callback callback function to call when the image was loaded + * @param etag file etag (for caching) + */ + lazyLoadPreview : function(options) { + var self = this; + var path = options.path; + var mime = options.mime; + var ready = options.callback; + var etag = options.etag; + + // get mime icon url + OCA.Files.Files.getMimeIcon(mime, function(iconURL) { + var previewURL, + urlSpec = {}; + ready(iconURL); // set mimeicon URL + + urlSpec.file = OCA.Files.Files.fixPath(path); + + if (etag){ + // use etag as cache buster + urlSpec.c = etag; + } + else { + console.warn('OCA.Files.FileList.lazyLoadPreview(): missing etag argument'); + } - if (baseDir !== '') { - FileList.setPageTitle(baseDir); - } - else { - FileList.setPageTitle(); - } + previewURL = self.generatePreviewUrl(urlSpec); + previewURL = previewURL.replace('(', '%28'); + previewURL = previewURL.replace(')', '%29'); + + // preload image to prevent delay + // this will make the browser cache the image + var img = new Image(); + img.onload = function(){ + // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 + if (img.width > 5) { + ready(previewURL); + } + }; + img.src = previewURL; + }); + }, - $('#dir').val(targetDir); - if (changeUrl !== false) { - if (window.history.pushState && changeUrl !== false) { - url = FileList.linkTo(targetDir); - window.history.pushState({dir: targetDir}, '', url); + setDirectoryPermissions: function(permissions) { + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + this.$el.find('#permissions').val(permissions); + this.$el.find('.creatable').toggleClass('hidden', !isCreatable); + this.$el.find('.notCreatable').toggleClass('hidden', isCreatable); + }, + /** + * Shows/hides action buttons + * + * @param show true for enabling, false for disabling + */ + showActions: function(show){ + this.$el.find('.actions,#file_action_panel').toggleClass('hidden', !show); + if (show){ + // make sure to display according to permissions + var permissions = this.getDirectoryPermissions(); + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + this.$el.find('.creatable').toggleClass('hidden', !isCreatable); + this.$el.find('.notCreatable').toggleClass('hidden', isCreatable); + // remove old style breadcrumbs (some apps might create them) + this.$el.find('#controls .crumb').remove(); + // refresh breadcrumbs in case it was replaced by an app + this.breadcrumb.render(); } - // use URL hash for IE8 else{ - window.location.hash = '?dir='+ encodeURIComponent(targetDir).replace(/%2F/g, '/'); + this.$el.find('.creatable, .notCreatable').addClass('hidden'); + } + }, + /** + * Enables/disables viewer mode. + * In viewer mode, apps can embed themselves under the controls bar. + * In viewer mode, the actions of the file list will be hidden. + * @param show true for enabling, false for disabling + */ + setViewerMode: function(show){ + this.showActions(!show); + this.$el.find('#filestable').toggleClass('hidden', show); + this.$el.trigger(new $.Event('changeViewerMode', {viewerModeEnabled: show})); + }, + /** + * Removes a file entry from the list + * @param name name of the file to remove + * @param options optional options as map: + * "updateSummary": true to update the summary (default), false otherwise + * @return deleted element + */ + remove: function(name, options){ + options = options || {}; + var fileEl = this.findFileEl(name); + var index = fileEl.index(); + if (!fileEl.length) { + return null; + } + if (this._selectedFiles[fileEl.data('id')]) { + // remove from selection first + this._selectFileEl(fileEl, false); + this.updateSelectionSummary(); + } + if (this._dragOptions && (fileEl.data('permissions') & OC.PERMISSION_DELETE)) { + // file is only draggable when delete permissions are set + fileEl.find('td.filename').draggable('destroy'); + } + this.files.splice(index, 1); + fileEl.remove(); + // TODO: improve performance on batch update + this.isEmpty = !this.files.length; + if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { + this.updateEmptyContent(); + this.fileSummary.remove({type: fileEl.attr('data-type'), size: fileEl.attr('data-size')}, true); } - } - this.breadcrumb.setDirectory(this.getCurrentDirectory()); - }, - /** - * @brief Reloads the file list using ajax call - */ - reload: function() { - FileList.showMask(); - if (FileList._reloadCall) { - FileList._reloadCall.abort(); - } - FileList._reloadCall = $.ajax({ - url: Files.getAjaxUrl('list'), - data: { - dir : $('#dir').val() - }, - error: function(result) { - FileList.reloadCallback(result); - }, - success: function(result) { - FileList.reloadCallback(result); - } - }); - }, - reloadCallback: function(result) { - delete this._reloadCall; - this.hideMask(); - - if (!result || result.status === 'error') { - OC.Notification.show(result.data.message); - return; - } - if (result.status === 404) { - // go back home - this.changeDirectory('/'); - return; - } - // aborted ? - if (result.status === 0){ - return; - } + var lastIndex = this.$fileList.children().length; + // if there are less elements visible than one page + // but there are still pending elements in the array, + // then directly append the next page + if (lastIndex < this.files.length && lastIndex < this.pageSize) { + this._nextPage(true); + } - // TODO: should rather return upload file size through - // the files list ajax call - Files.updateStorageStatistics(true); + return fileEl; + }, + /** + * Finds the index of the row before which the given + * fileData should be inserted, considering the current + * sorting + */ + _findInsertionIndex: function(fileData) { + var index = 0; + while (index < this.files.length && this._sortComparator(fileData, this.files[index]) > 0) { + index++; + } + return index; + }, + /** + * Moves a file to a given target folder. + * + * @param fileNames array of file names to move + * @param targetPath absolute target path + */ + move: function(fileNames, targetPath) { + var self = this; + var dir = this.getCurrentDirectory(); + var target = OC.basename(targetPath); + if (!_.isArray(fileNames)) { + fileNames = [fileNames]; + } + _.each(fileNames, function(fileName) { + var $tr = self.findFileEl(fileName); + var $td = $tr.children('td.filename'); + var oldBackgroundImage = $td.css('background-image'); + $td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); + // TODO: improve performance by sending all file names in a single call + $.post( + OC.filePath('files', 'ajax', 'move.php'), + { + dir: dir, + file: fileName, + target: targetPath + }, + function(result) { + if (result) { + if (result.status === 'success') { + // if still viewing the same directory + if (self.getCurrentDirectory() === dir) { + // recalculate folder size + var oldFile = self.findFileEl(target); + var newFile = self.findFileEl(fileName); + var oldSize = oldFile.data('size'); + var newSize = oldSize + newFile.data('size'); + oldFile.data('size', newSize); + oldFile.find('td.filesize').text(OC.Util.humanFileSize(newSize)); + + // TODO: also update entry in FileList.files + + self.remove(fileName); + } + } else { + OC.Notification.hide(); + if (result.status === 'error' && result.data.message) { + OC.Notification.show(result.data.message); + } + else { + OC.Notification.show(t('files', 'Error moving file.')); + } + // hide notification after 10 sec + setTimeout(function() { + OC.Notification.hide(); + }, 10000); + } + } else { + OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error')); + } + $td.css('background-image', oldBackgroundImage); + } + ); + }); - if (result.data.permissions) { - this.setDirectoryPermissions(result.data.permissions); - } + }, + + /** + * Triggers file rename input field for the given file name. + * If the user enters a new name, the file will be renamed. + * + * @param oldname file name of the file to rename + */ + rename: function(oldname) { + var self = this; + var tr, td, input, form; + tr = this.findFileEl(oldname); + var oldFileInfo = this.files[tr.index()]; + tr.data('renaming',true); + td = tr.children('td.filename'); + input = $('').val(oldname); + form = $('
'); + form.append(input); + td.children('a.name').hide(); + td.append(form); + input.focus(); + //preselect input + var len = input.val().lastIndexOf('.'); + if ( len === -1 || + tr.data('type') === 'dir' ) { + len = input.val().length; + } + input.selectRange(0, len); + var checkInput = function () { + var filename = input.val(); + if (filename !== oldname) { + // Files.isFileNameValid(filename) throws an exception itself + OCA.Files.Files.isFileNameValid(filename); + if (self.inList(filename)) { + throw t('files', '{new_name} already exists', {new_name: filename}); + } + } + return true; + }; - this.setFiles(result.data.files); - }, - setDirectoryPermissions: function(permissions) { - var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; - $('#permissions').val(permissions); - $('.creatable').toggleClass('hidden', !isCreatable); - $('.notCreatable').toggleClass('hidden', isCreatable); - }, - /** - * Shows/hides action buttons - * - * @param show true for enabling, false for disabling - */ - showActions: function(show){ - $('.actions,#file_action_panel').toggleClass('hidden', !show); - if (show){ - // make sure to display according to permissions - var permissions = this.getDirectoryPermissions(); - var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; - $('.creatable').toggleClass('hidden', !isCreatable); - $('.notCreatable').toggleClass('hidden', isCreatable); - // remove old style breadcrumbs (some apps might create them) - $('#controls .crumb').remove(); - // refresh breadcrumbs in case it was replaced by an app - this.breadcrumb.render(); - } - else{ - $('.creatable, .notCreatable').addClass('hidden'); - } - }, - /** - * Enables/disables viewer mode. - * In viewer mode, apps can embed themselves under the controls bar. - * In viewer mode, the actions of the file list will be hidden. - * @param show true for enabling, false for disabling - */ - setViewerMode: function(show){ - this.showActions(!show); - $('#filestable').toggleClass('hidden', show); - }, - /** - * Removes a file entry from the list - * @param name name of the file to remove - * @param options optional options as map: - * "updateSummary": true to update the summary (default), false otherwise - * @return deleted element - */ - remove: function(name, options){ - options = options || {}; - var fileEl = FileList.findFileEl(name); - var index = fileEl.index(); - if (!fileEl.length) { - return null; - } - if (this._selectedFiles[fileEl.data('id')]) { - // remove from selection first - this._selectFileEl(fileEl, false); - this.updateSelectionSummary(); - } - if (fileEl.data('permissions') & OC.PERMISSION_DELETE) { - // file is only draggable when delete permissions are set - fileEl.find('td.filename').draggable('destroy'); - } - this.files.splice(index, 1); - fileEl.remove(); - // TODO: improve performance on batch update - FileList.isEmpty = !this.files.length; - if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) { - FileList.updateEmptyContent(); - this.fileSummary.remove({type: fileEl.attr('data-type'), size: fileEl.attr('data-size')}, true); - } + form.submit(function(event) { + event.stopPropagation(); + event.preventDefault(); + try { + var newName = input.val(); + input.tipsy('hide'); + form.remove(); + + if (newName !== oldname) { + checkInput(); + // mark as loading (temp element) + td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); + tr.attr('data-file', newName); + var basename = newName; + if (newName.indexOf('.') > 0 && tr.data('type') !== 'dir') { + basename = newName.substr(0, newName.lastIndexOf('.')); + } + td.find('a.name span.nametext').text(basename); + td.children('a.name').show(); + tr.find('.fileactions, .action').addClass('hidden'); + + $.ajax({ + url: OC.filePath('files','ajax','rename.php'), + data: { + dir : self.getCurrentDirectory(), + newname: newName, + file: oldname + }, + success: function(result) { + var fileInfo; + if (!result || result.status === 'error') { + OC.dialogs.alert(result.data.message, t('core', 'Could not rename file')); + fileInfo = oldFileInfo; + } + else { + fileInfo = result.data; + } + // reinsert row + self.files.splice(tr.index(), 1); + tr.remove(); + self.add(fileInfo, {updateSummary: false}); + self.$fileList.trigger($.Event('fileActionsReady')); + } + }); + } else { + // add back the old file info when cancelled + self.files.splice(tr.index(), 1); + tr.remove(); + self.add(oldFileInfo, {updateSummary: false}); + self.$fileList.trigger($.Event('fileActionsReady')); + } + } catch (error) { + input.attr('title', error); + input.tipsy({gravity: 'w', trigger: 'manual'}); + input.tipsy('show'); + input.addClass('error'); + } + return false; + }); + input.keyup(function(event) { + // verify filename on typing + try { + checkInput(); + input.tipsy('hide'); + input.removeClass('error'); + } catch (error) { + input.attr('title', error); + input.tipsy({gravity: 'w', trigger: 'manual'}); + input.tipsy('show'); + input.addClass('error'); + } + if (event.keyCode === 27) { + input.tipsy('hide'); + tr.data('renaming',false); + form.remove(); + td.children('a.name').show(); + } + }); + input.click(function(event) { + event.stopPropagation(); + event.preventDefault(); + }); + input.blur(function() { + form.trigger('submit'); + }); + }, + inList:function(file) { + return this.findFileEl(file).length; + }, + /** + * Delete the given files from the given dir + * @param files file names list (without path) + * @param dir directory in which to delete the files, defaults to the current + * directory + */ + do_delete:function(files, dir) { + var self = this; + var params; + if (files && files.substr) { + files=[files]; + } + if (files) { + for (var i=0; itd.date .action.delete').removeClass('delete-icon').addClass('progress-icon'); + } - return fileEl; - }, - /** - * Finds the index of the row before which the given - * fileData should be inserted, considering the current - * sorting - */ - _findInsertionIndex: function(fileData) { - var index = 0; - while (index < this.files.length && this._fileInfoCompare(fileData, this.files[index]) > 0) { - index++; - } - return index; - }, - /** - * Moves a file to a given target folder. - * - * @param fileNames array of file names to move - * @param targetPath absolute target path - */ - move: function(fileNames, targetPath) { - var self = this; - var dir = this.getCurrentDirectory(); - var target = OC.basename(targetPath); - if (!_.isArray(fileNames)) { - fileNames = [fileNames]; - } - _.each(fileNames, function(fileName) { - var $tr = self.findFileEl(fileName); - var $td = $tr.children('td.filename'); - var oldBackgroundImage = $td.css('background-image'); - $td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); - // TODO: improve performance by sending all file names in a single call - $.post( - OC.filePath('files', 'ajax', 'move.php'), - { - dir: dir, - file: fileName, - target: targetPath - }, - function(result) { - if (result) { + $.post(OC.filePath('files', 'ajax', 'delete.php'), + params, + function(result) { if (result.status === 'success') { - // if still viewing the same directory - if (self.getCurrentDirectory() === dir) { - // recalculate folder size - var oldFile = self.findFileEl(target); - var newFile = self.findFileEl(fileName); - var oldSize = oldFile.data('size'); - var newSize = oldSize + newFile.data('size'); - oldFile.data('size', newSize); - oldFile.find('td.filesize').text(OC.Util.humanFileSize(newSize)); - - // TODO: also update entry in FileList.files - - self.remove(fileName); + if (params.allfiles) { + self.setFiles([]); + } + else { + $.each(files,function(index,file) { + var fileEl = self.remove(file, {updateSummary: false}); + // FIXME: not sure why we need this after the + // element isn't even in the DOM any more + fileEl.find('input[type="checkbox"]').prop('checked', false); + fileEl.removeClass('selected'); + self.fileSummary.remove({type: fileEl.attr('data-type'), size: fileEl.attr('data-size')}); + }); } + // TODO: this info should be returned by the ajax call! + self.updateEmptyContent(); + self.fileSummary.update(); + self.updateSelectionSummary(); + self.updateStorageStatistics(); } else { - OC.Notification.hide(); if (result.status === 'error' && result.data.message) { OC.Notification.show(result.data.message); } else { - OC.Notification.show(t('files', 'Error moving file.')); + OC.Notification.show(t('files', 'Error deleting file.')); } // hide notification after 10 sec setTimeout(function() { OC.Notification.hide(); }, 10000); - } - } else { - OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error')); - } - $td.css('background-image', oldBackgroundImage); - }); - }); - - }, - - /** - * Triggers file rename input field for the given file name. - * If the user enters a new name, the file will be renamed. - * - * @param oldname file name of the file to rename - */ - rename: function(oldname) { - var tr, td, input, form; - tr = FileList.findFileEl(oldname); - var oldFileInfo = this.files[tr.index()]; - tr.data('renaming',true); - td = tr.children('td.filename'); - input = $('').val(oldname); - form = $('
'); - form.append(input); - td.children('a.name').hide(); - td.append(form); - input.focus(); - //preselect input - var len = input.val().lastIndexOf('.'); - if ( len === -1 || - tr.data('type') === 'dir' ) { - len = input.val().length; - } - input.selectRange(0, len); - var checkInput = function () { - var filename = input.val(); - if (filename !== oldname) { - // Files.isFileNameValid(filename) throws an exception itself - Files.isFileNameValid(filename); - if (FileList.inList(filename)) { - throw t('files', '{new_name} already exists', {new_name: filename}); - } - } - return true; - }; - - form.submit(function(event) { - event.stopPropagation(); - event.preventDefault(); - try { - var newName = input.val(); - if (newName !== oldname) { - checkInput(); - // mark as loading - td.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); - $.ajax({ - url: OC.filePath('files','ajax','rename.php'), - data: { - dir : $('#dir').val(), - newname: newName, - file: oldname - }, - success: function(result) { - var fileInfo; - if (!result || result.status === 'error') { - OC.dialogs.alert(result.data.message, t('core', 'Could not rename file')); - fileInfo = oldFileInfo; + if (params.allfiles) { + // reload the page as we don't know what files were deleted + // and which ones remain + self.reload(); } else { - fileInfo = result.data; + $.each(files,function(index,file) { + var deleteAction = self.findFileEl(file).find('.action.delete'); + deleteAction.removeClass('progress-icon').addClass('delete-icon'); + }); } - // reinsert row - FileList.files.splice(tr.index(), 1); - tr.remove(); - FileList.add(fileInfo); } }); - } - input.tipsy('hide'); - tr.data('renaming',false); - tr.attr('data-file', newName); - var path = td.children('a.name').attr('href'); - // FIXME this will fail if the path contains the filename. - td.children('a.name').attr('href', path.replace(encodeURIComponent(oldname), encodeURIComponent(newName))); - var basename = newName; - if (newName.indexOf('.') > 0 && tr.data('type') !== 'dir') { - basename = newName.substr(0, newName.lastIndexOf('.')); - } - td.find('a.name span.nametext').text(basename); - if (newName.indexOf('.') > 0 && tr.data('type') !== 'dir') { - if ( ! td.find('a.name span.extension').exists() ) { - td.find('a.name span.nametext').append(''); - } - td.find('a.name span.extension').text(newName.substr(newName.lastIndexOf('.'))); - } - form.remove(); - FileActions.display( tr.find('td.filename'), true); - td.children('a.name').show(); - } catch (error) { - input.attr('title', error); - input.tipsy({gravity: 'w', trigger: 'manual'}); - input.tipsy('show'); - input.addClass('error'); - } - return false; - }); - input.keyup(function(event) { - // verify filename on typing - try { - checkInput(); - input.tipsy('hide'); - input.removeClass('error'); - } catch (error) { - input.attr('title', error); - input.tipsy({gravity: 'w', trigger: 'manual'}); - input.tipsy('show'); - input.addClass('error'); - } - if (event.keyCode === 27) { - input.tipsy('hide'); - tr.data('renaming',false); - form.remove(); - td.children('a.name').show(); - } - }); - input.click(function(event) { - event.stopPropagation(); - event.preventDefault(); - }); - input.blur(function() { - form.trigger('submit'); - }); - }, - inList:function(file) { - return FileList.findFileEl(file).length; - }, - /** - * Delete the given files from the given dir - * @param files file names list (without path) - * @param dir directory in which to delete the files, defaults to the current - * directory - */ - do_delete:function(files, dir) { - var params; - if (files && files.substr) { - files=[files]; - } - if (files) { - for (var i=0; i'); + this.$el.find('tfoot').append($tr); + + return new OCA.Files.FileSummary($tr); + }, + updateEmptyContent: function() { + var permissions = this.getDirectoryPermissions(); + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + this.$el.find('#emptycontent').toggleClass('hidden', !isCreatable || !this.isEmpty); + this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty); + }, + /** + * Shows the loading mask. + * + * @see #hideMask + */ + showMask: function() { + // in case one was shown before + var $mask = this.$el.find('.mask'); + if ($mask.exists()) { + return; } - } - // Finish any existing actions - if (FileList.lastAction) { - FileList.lastAction(); - } - - params = { - dir: dir || FileList.getCurrentDirectory() - }; - if (files) { - params.files = JSON.stringify(files); - } - else { - // no files passed, delete all in current dir - params.allfiles = true; - // show spinner for all files - this.$fileList.find('tr>td.date .action.delete').removeClass('delete-icon').addClass('progress-icon'); - } - $.post(OC.filePath('files', 'ajax', 'delete.php'), - params, - function(result) { - if (result.status === 'success') { - if (params.allfiles) { - FileList.setFiles([]); - } - else { - $.each(files,function(index,file) { - var fileEl = FileList.remove(file, {updateSummary: false}); - // FIXME: not sure why we need this after the - // element isn't even in the DOM any more - fileEl.find('input[type="checkbox"]').prop('checked', false); - fileEl.removeClass('selected'); - FileList.fileSummary.remove({type: fileEl.attr('data-type'), size: fileEl.attr('data-size')}); - }); - } - // TODO: this info should be returned by the ajax call! - checkTrashStatus(); - FileList.updateEmptyContent(); - FileList.fileSummary.update(); - FileList.updateSelectionSummary(); - Files.updateStorageStatistics(); - } else { - if (result.status === 'error' && result.data.message) { - OC.Notification.show(result.data.message); - } - else { - OC.Notification.show(t('files', 'Error deleting file.')); - } - // hide notification after 10 sec - setTimeout(function() { - OC.Notification.hide(); - }, 10000); - if (params.allfiles) { - // reload the page as we don't know what files were deleted - // and which ones remain - FileList.reload(); - } - else { - $.each(files,function(index,file) { - var deleteAction = FileList.findFileEl(file).find('.action.delete'); - deleteAction.removeClass('progress-icon').addClass('delete-icon'); - }); - } - } + this.$table.addClass('hidden'); + + $mask = $('
'); + + $mask.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); + $mask.css('background-repeat', 'no-repeat'); + this.$el.append($mask); + + $mask.removeClass('transparent'); + }, + /** + * Hide the loading mask. + * @see #showMask + */ + hideMask: function() { + this.$el.find('.mask').remove(); + this.$table.removeClass('hidden'); + }, + scrollTo:function(file) { + //scroll to and highlight preselected file + var $scrollToRow = this.findFileEl(file); + if ($scrollToRow.exists()) { + $scrollToRow.addClass('searchresult'); + $(window).scrollTop($scrollToRow.position().top); + //remove highlight when hovered over + $scrollToRow.one('hover', function() { + $scrollToRow.removeClass('searchresult'); }); - }, - /** - * Creates the file summary section - */ - _createSummary: function() { - var $tr = $(''); - this.$el.find('tfoot').append($tr); - - return new FileSummary($tr); - }, - updateEmptyContent: function() { - var permissions = $('#permissions').val(); - var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; - $('#emptycontent').toggleClass('hidden', !isCreatable || !FileList.isEmpty); - $('#filestable thead th').toggleClass('hidden', FileList.isEmpty); - }, - /** - * Shows the loading mask. - * - * @see #hideMask - */ - showMask: function() { - // in case one was shown before - var $mask = $('#content .mask'); - if ($mask.exists()) { - return; - } - - this.$el.addClass('hidden'); - - $mask = $('
'); - - $mask.css('background-image', 'url('+ OC.imagePath('core', 'loading.gif') + ')'); - $mask.css('background-repeat', 'no-repeat'); - $('#content').append($mask); - - $mask.removeClass('transparent'); - }, - /** - * Hide the loading mask. - * @see #showMask - */ - hideMask: function() { - $('#content .mask').remove(); - this.$el.removeClass('hidden'); - }, - scrollTo:function(file) { - //scroll to and highlight preselected file - var $scrollToRow = FileList.findFileEl(file); - if ($scrollToRow.exists()) { - $scrollToRow.addClass('searchresult'); - $(window).scrollTop($scrollToRow.position().top); - //remove highlight when hovered over - $scrollToRow.one('hover', function() { - $scrollToRow.removeClass('searchresult'); + } + }, + filter:function(query) { + this.$fileList.find('tr').each(function(i,e) { + if ($(e).data('file').toString().toLowerCase().indexOf(query.toLowerCase()) !== -1) { + $(e).addClass("searchresult"); + } else { + $(e).removeClass("searchresult"); + } }); - } - }, - filter:function(query) { - $('#fileList tr').each(function(i,e) { - if ($(e).data('file').toString().toLowerCase().indexOf(query.toLowerCase()) !== -1) { - $(e).addClass("searchresult"); - } else { + //do not use scrollto to prevent removing searchresult css class + var first = this.$fileList.find('tr.searchresult').first(); + if (first.exists()) { + $(window).scrollTop(first.position().top); + } + }, + unfilter:function() { + this.$fileList.find('tr.searchresult').each(function(i,e) { $(e).removeClass("searchresult"); + }); + }, + /** + * Update UI based on the current selection + */ + updateSelectionSummary: function() { + var summary = this._selectionSummary.summary; + var canDelete; + if (summary.totalFiles === 0 && summary.totalDirs === 0) { + this.$el.find('#headerName a.name>span:first').text(t('files','Name')); + this.$el.find('#headerSize a>span:first').text(t('files','Size')); + this.$el.find('#modified a>span:first').text(t('files','Modified')); + this.$el.find('table').removeClass('multiselect'); + this.$el.find('.selectedActions').addClass('hidden'); } - }); - //do not use scrollto to prevent removing searchresult css class - var first = $('#fileList tr.searchresult').first(); - if (first.exists()) { - $(window).scrollTop(first.position().top); - } - }, - unfilter:function() { - $('#fileList tr.searchresult').each(function(i,e) { - $(e).removeClass("searchresult"); - }); - }, - /** - * Update UI based on the current selection - */ - updateSelectionSummary: function() { - var summary = this._selectionSummary.summary; - if (summary.totalFiles === 0 && summary.totalDirs === 0) { - $('#headerName span.name').text(t('files','Name')); - $('#headerSize').text(t('files','Size')); - $('#modified').text(t('files','Modified')); - $('table').removeClass('multiselect'); - $('.selectedActions').addClass('hidden'); - } - else { - $('.selectedActions').removeClass('hidden'); - $('#headerSize').text(OC.Util.humanFileSize(summary.totalSize)); - var selection = ''; - if (summary.totalDirs > 0) { - selection += n('files', '%n folder', '%n folders', summary.totalDirs); + else { + canDelete = (this.getDirectoryPermissions() & OC.PERMISSION_DELETE); + this.$el.find('.selectedActions').removeClass('hidden'); + this.$el.find('#headerSize a>span:first').text(OC.Util.humanFileSize(summary.totalSize)); + var selection = ''; + if (summary.totalDirs > 0) { + selection += n('files', '%n folder', '%n folders', summary.totalDirs); + if (summary.totalFiles > 0) { + selection += ' & '; + } + } if (summary.totalFiles > 0) { - selection += ' & '; + selection += n('files', '%n file', '%n files', summary.totalFiles); } + this.$el.find('#headerName a.name>span:first').text(selection); + this.$el.find('#modified a>span:first').text(''); + this.$el.find('table').addClass('multiselect'); + this.$el.find('.delete-selected').toggleClass('hidden', !canDelete); } - if (summary.totalFiles > 0) { - selection += n('files', '%n file', '%n files', summary.totalFiles); + }, + + /** + * Returns whether all files are selected + * @return true if all files are selected, false otherwise + */ + isAllSelected: function() { + return this.$el.find('.select-all').prop('checked'); + }, + + /** + * Returns the file info of the selected files + * + * @return array of file names + */ + getSelectedFiles: function() { + return _.values(this._selectedFiles); + }, + + getUniqueName: function(name) { + if (this.findFileEl(name).exists()) { + var numMatch; + var parts=name.split('.'); + var extension = ""; + if (parts.length > 1) { + extension=parts.pop(); + } + var base=parts.join('.'); + numMatch=base.match(/\((\d+)\)/); + var num=2; + if (numMatch && numMatch.length>0) { + num=parseInt(numMatch[numMatch.length-1])+1; + base=base.split('('); + base.pop(); + base=$.trim(base.join('(')); + } + name=base+' ('+num+')'; + if (extension) { + name = name+'.'+extension; + } + // FIXME: ugly recursion + return this.getUniqueName(name); } - $('#headerName span.name').text(selection); - $('#modified').text(''); - $('table').addClass('multiselect'); - } - }, + return name; + }, - /** - * Returns whether all files are selected - * @return true if all files are selected, false otherwise - */ - isAllSelected: function() { - return this.$el.find('#select_all').prop('checked'); - }, + /** + * Setup file upload events related to the file-upload plugin + */ + setupUploadEvents: function() { + var self = this; - /** - * Returns the file info of the selected files - * - * @return array of file names - */ - getSelectedFiles: function() { - return _.values(this._selectedFiles); - } -}; + // handle upload events + var fileUploadStart = this.$el.find('#file_upload_start'); -$(document).ready(function() { - FileList.initialize(); + fileUploadStart.on('fileuploaddrop', function(e, data) { + OC.Upload.log('filelist handle fileuploaddrop', e, data); - // handle upload events - var fileUploadStart = $('#file_upload_start'); + var dropTarget = $(e.originalEvent.target).closest('tr, .crumb'); + // check if dropped inside this list at all + if (dropTarget && !self.$el.has(dropTarget).length) { + return false; + } - fileUploadStart.on('fileuploaddrop', function(e, data) { - OC.Upload.log('filelist handle fileuploaddrop', e, data); + if (dropTarget && (dropTarget.data('type') === 'dir' || dropTarget.hasClass('crumb'))) { // drag&drop upload to folder - var dropTarget = $(e.originalEvent.target).closest('tr, .crumb'); - if (dropTarget && (dropTarget.data('type') === 'dir' || dropTarget.hasClass('crumb'))) { // drag&drop upload to folder + // remember as context + data.context = dropTarget; - // remember as context - data.context = dropTarget; + var dir = dropTarget.data('file'); + // if from file list, need to prepend parent dir + if (dir) { + var parentDir = self.getCurrentDirectory(); + if (parentDir[parentDir.length - 1] !== '/') { + parentDir += '/'; + } + dir = parentDir + dir; + } + else{ + // read full path from crumb + dir = dropTarget.data('dir') || '/'; + } - var dir = dropTarget.data('file'); - // if from file list, need to prepend parent dir - if (dir) { - var parentDir = $('#dir').val() || '/'; - if (parentDir[parentDir.length - 1] !== '/') { - parentDir += '/'; + // update folder in form + data.formData = function(form) { + return [ + {name: 'dir', value: dir}, + {name: 'requesttoken', value: oc_requesttoken}, + {name: 'file_directory', value: data.files[0].relativePath} + ]; + }; + } else { + // cancel uploads to current dir if no permission + var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0; + if (!isCreatable) { + return false; + } } - dir = parentDir + dir; - } - else{ - // read full path from crumb - dir = dropTarget.data('dir') || '/'; - } + }); + fileUploadStart.on('fileuploadadd', function(e, data) { + OC.Upload.log('filelist handle fileuploadadd', e, data); - // update folder in form - data.formData = function(form) { - return [ - {name: 'dir', value: dir}, - {name: 'requesttoken', value: oc_requesttoken}, - {name: 'file_directory', value: data.files[0].relativePath} - ]; - }; - } else { - // cancel uploads to current dir if no permission - var isCreatable = (FileList.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0; - if (!isCreatable) { - return false; - } - } - }); - fileUploadStart.on('fileuploadadd', function(e, data) { - OC.Upload.log('filelist handle fileuploadadd', e, data); + //finish delete if we are uploading a deleted file + if (self.deleteFiles && self.deleteFiles.indexOf(data.files[0].name)!==-1) { + self.finishDelete(null, true); //delete file before continuing + } - //finish delete if we are uploading a deleted file - if (FileList.deleteFiles && FileList.deleteFiles.indexOf(data.files[0].name)!==-1) { - FileList.finishDelete(null, true); //delete file before continuing - } + // add ui visualization to existing folder + if (data.context && data.context.data('type') === 'dir') { + // add to existing folder + + // update upload counter ui + var uploadText = data.context.find('.uploadtext'); + var currentUploads = parseInt(uploadText.attr('currentUploads'), 10); + currentUploads += 1; + uploadText.attr('currentUploads', currentUploads); + + var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); + if (currentUploads === 1) { + var img = OC.imagePath('core', 'loading.gif'); + data.context.find('td.filename').attr('style','background-image:url('+img+')'); + uploadText.text(translatedText); + uploadText.show(); + } else { + uploadText.text(translatedText); + } + } - // add ui visualization to existing folder - if (data.context && data.context.data('type') === 'dir') { - // add to existing folder - - // update upload counter ui - var uploadText = data.context.find('.uploadtext'); - var currentUploads = parseInt(uploadText.attr('currentUploads'), 10); - currentUploads += 1; - uploadText.attr('currentUploads', currentUploads); - - var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); - if (currentUploads === 1) { - var img = OC.imagePath('core', 'loading.gif'); - data.context.find('td.filename').attr('style','background-image:url('+img+')'); - uploadText.text(translatedText); - uploadText.show(); - } else { - uploadText.text(translatedText); - } - } + }); + /* + * when file upload done successfully add row to filelist + * update counter when uploading to sub folder + */ + fileUploadStart.on('fileuploaddone', function(e, data) { + OC.Upload.log('filelist handle fileuploaddone', e, data); + + var response; + if (typeof data.result === 'string') { + response = data.result; + } else { + // fetch response from iframe + response = data.result[0].body.innerText; + } + var result=$.parseJSON(response); + + if (typeof result[0] !== 'undefined' && result[0].status === 'success') { + var file = result[0]; + var size = 0; + + if (data.context && data.context.data('type') === 'dir') { + + // update upload counter ui + var uploadText = data.context.find('.uploadtext'); + var currentUploads = parseInt(uploadText.attr('currentUploads'), 10); + currentUploads -= 1; + uploadText.attr('currentUploads', currentUploads); + var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); + if (currentUploads === 0) { + var img = OC.imagePath('core', 'filetypes/folder'); + data.context.find('td.filename').attr('style','background-image:url('+img+')'); + uploadText.text(translatedText); + uploadText.hide(); + } else { + uploadText.text(translatedText); + } - }); - /* - * when file upload done successfully add row to filelist - * update counter when uploading to sub folder - */ - fileUploadStart.on('fileuploaddone', function(e, data) { - OC.Upload.log('filelist handle fileuploaddone', e, data); - - var response; - if (typeof data.result === 'string') { - response = data.result; - } else { - // fetch response from iframe - response = data.result[0].body.innerText; - } - var result=$.parseJSON(response); + // update folder size + size = parseInt(data.context.data('size'), 10); + size += parseInt(file.size, 10); + data.context.attr('data-size', size); + data.context.find('td.filesize').text(humanFileSize(size)); + } else { + // only append new file if uploaded into the current folder + if (file.directory !== '/' && file.directory !== self.getCurrentDirectory()) { + + var fileDirectory = file.directory.replace('/','').replace(/\/$/, "").split('/'); + + if (fileDirectory.length === 1) { + fileDirectory = fileDirectory[0]; + + // Get the directory + var fd = self.findFileEl(fileDirectory); + if (fd.length === 0) { + var dir = { + name: fileDirectory, + type: 'dir', + mimetype: 'httpd/unix-directory', + permissions: file.permissions, + size: 0, + id: file.parentId + }; + self.add(dir, {insert: true}); + } + } else { + fileDirectory = fileDirectory[0]; + } - if (typeof result[0] !== 'undefined' && result[0].status === 'success') { - var file = result[0]; - var size = 0; + fileDirectory = self.findFileEl(fileDirectory); - if (data.context && data.context.data('type') === 'dir') { + // update folder size + size = parseInt(fileDirectory.attr('data-size'), 10); + size += parseInt(file.size, 10); + fileDirectory.attr('data-size', size); + fileDirectory.find('td.filesize').text(humanFileSize(size)); - // update upload counter ui - var uploadText = data.context.find('.uploadtext'); - var currentUploads = parseInt(uploadText.attr('currentUploads'), 10); - currentUploads -= 1; - uploadText.attr('currentUploads', currentUploads); - var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); - if (currentUploads === 0) { - var img = OC.imagePath('core', 'filetypes/folder'); - data.context.find('td.filename').attr('style','background-image:url('+img+')'); - uploadText.text(translatedText); - uploadText.hide(); - } else { - uploadText.text(translatedText); - } + return; + } - // update folder size - size = parseInt(data.context.data('size'), 10); - size += parseInt(file.size, 10); - data.context.attr('data-size', size); - data.context.find('td.filesize').text(humanFileSize(size)); - } else { - // only append new file if uploaded into the current folder - if (file.directory !== '/' && file.directory !== FileList.getCurrentDirectory()) { - - var fileDirectory = file.directory.replace('/','').replace(/\/$/, "").split('/'); - - if (fileDirectory.length === 1) { - fileDirectory = fileDirectory[0]; - - // Get the directory - var fd = FileList.findFileEl(fileDirectory); - if (fd.length === 0) { - var dir = { - name: fileDirectory, - type: 'dir', - mimetype: 'httpd/unix-directory', - permissions: file.permissions, - size: 0, - id: file.parentId - }; - FileList.add(dir, {insert: true}); + // add as stand-alone row to filelist + size = t('files', 'Pending'); + if (data.files[0].size>=0) { + size=data.files[0].size; } - } else { - fileDirectory = fileDirectory[0]; - } - - fileDirectory = FileList.findFileEl(fileDirectory); + //should the file exist in the list remove it + self.remove(file.name); - // update folder size - size = parseInt(fileDirectory.attr('data-size'), 10); - size += parseInt(file.size, 10); - fileDirectory.attr('data-size', size); - fileDirectory.find('td.filesize').text(humanFileSize(size)); + // create new file context + data.context = self.add(file, {animate: true}); + } + } + }); + fileUploadStart.on('fileuploadstop', function(e, data) { + OC.Upload.log('filelist handle fileuploadstop', e, data); - return; + //if user pressed cancel hide upload chrome + if (data.errorThrown === 'abort') { + //cleanup uploading to a dir + var uploadText = $('tr .uploadtext'); + var img = OC.imagePath('core', 'filetypes/folder'); + uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); + uploadText.fadeOut(); + uploadText.attr('currentUploads', 0); } + self.updateStorageStatistics(); + }); + fileUploadStart.on('fileuploadfail', function(e, data) { + OC.Upload.log('filelist handle fileuploadfail', e, data); - // add as stand-alone row to filelist - size = t('files', 'Pending'); - if (data.files[0].size>=0) { - size=data.files[0].size; + //if user pressed cancel hide upload chrome + if (data.errorThrown === 'abort') { + //cleanup uploading to a dir + var uploadText = $('tr .uploadtext'); + var img = OC.imagePath('core', 'filetypes/folder'); + uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); + uploadText.fadeOut(); + uploadText.attr('currentUploads', 0); } - //should the file exist in the list remove it - FileList.remove(file.name); + self.updateStorageStatistics(); + }); - // create new file context - data.context = FileList.add(file, {animate: true}); - } } - }); - fileUploadStart.on('fileuploadstop', function(e, data) { - OC.Upload.log('filelist handle fileuploadstop', e, data); - - //if user pressed cancel hide upload chrome - if (data.errorThrown === 'abort') { - //cleanup uploading to a dir - var uploadText = $('tr .uploadtext'); - var img = OC.imagePath('core', 'filetypes/folder'); - uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); - uploadText.fadeOut(); - uploadText.attr('currentUploads', 0); - } - }); - fileUploadStart.on('fileuploadfail', function(e, data) { - OC.Upload.log('filelist handle fileuploadfail', e, data); - - //if user pressed cancel hide upload chrome - if (data.errorThrown === 'abort') { - //cleanup uploading to a dir - var uploadText = $('tr .uploadtext'); - var img = OC.imagePath('core', 'filetypes/folder'); - uploadText.parents('td.filename').attr('style','background-image:url('+img+')'); - uploadText.fadeOut(); - uploadText.attr('currentUploads', 0); - } - }); + }; - $('#notification').hide(); - $('#notification:first-child').on('click', '.replace', function() { - OC.Notification.hide(function() { - FileList.replace( - $('#notification > span').attr('data-oldName'), - $('#notification > span').attr('data-newName'), - $('#notification > span').attr('data-isNewFile')); - }); - }); - $('#notification:first-child').on('click', '.suggest', function() { - var file = $('#notification > span').attr('data-oldName'); - FileList.findFileEl(file).removeClass('hidden'); - OC.Notification.hide(); - }); - $('#notification:first-child').on('click', '.cancel', function() { - if ($('#notification > span').attr('data-isNewFile')) { - FileList.deleteCanceled = false; - FileList.deleteFiles = [$('#notification > span').attr('data-oldName')]; + /** + * Sort comparators. + */ + FileList.Comparators = { + /** + * Compares two file infos by name, making directories appear + * first. + * + * @param fileInfo1 file info + * @param fileInfo2 file info + * @return -1 if the first file must appear before the second one, + * 0 if they are identify, 1 otherwise. + */ + name: function(fileInfo1, fileInfo2) { + if (fileInfo1.type === 'dir' && fileInfo2.type !== 'dir') { + return -1; + } + if (fileInfo1.type !== 'dir' && fileInfo2.type === 'dir') { + return 1; + } + return fileInfo1.name.localeCompare(fileInfo2.name); + }, + /** + * Compares two file infos by size. + * + * @param fileInfo1 file info + * @param fileInfo2 file info + * @return -1 if the first file must appear before the second one, + * 0 if they are identify, 1 otherwise. + */ + size: function(fileInfo1, fileInfo2) { + return fileInfo1.size - fileInfo2.size; + }, + /** + * Compares two file infos by timestamp. + * + * @param fileInfo1 file info + * @param fileInfo2 file info + * @return -1 if the first file must appear before the second one, + * 0 if they are identify, 1 otherwise. + */ + mtime: function(fileInfo1, fileInfo2) { + return fileInfo1.mtime - fileInfo2.mtime; } - }); - FileList.useUndo=(window.onbeforeunload)?true:false; + }; + + OCA.Files.FileList = FileList; +})(); + +$(document).ready(function() { + // FIXME: unused ? + OCA.Files.FileList.useUndo = (window.onbeforeunload)?true:false; $(window).bind('beforeunload', function () { - if (FileList.lastAction) { - FileList.lastAction(); + if (OCA.Files.FileList.lastAction) { + OCA.Files.FileList.lastAction(); } }); $(window).unload(function () { $(window).trigger('beforeunload'); }); - function decodeQuery(query) { - return query.replace(/\+/g, ' '); - } - - function parseHashQuery() { - var hash = window.location.hash, - pos = hash.indexOf('?'); - if (pos >= 0) { - return hash.substr(pos + 1); - } - return ''; - } - - function parseCurrentDirFromUrl() { - var query = parseHashQuery(), - params; - // try and parse from URL hash first - if (query) { - params = OC.parseQueryString(decodeQuery(query)); - } - // else read from query attributes - if (!params) { - params = OC.parseQueryString(decodeQuery(location.search)); - } - return (params && params.dir) || '/'; - } - - // disable ajax/history API for public app (TODO: until it gets ported) - // fallback to hashchange when no history support - if (!window.history.pushState) { - $(window).on('hashchange', function() { - FileList.changeDirectory(parseCurrentDirFromUrl(), false); - }); - } - window.onpopstate = function(e) { - var targetDir; - if (e.state && e.state.dir) { - targetDir = e.state.dir; - } - else{ - // read from URL - targetDir = parseCurrentDirFromUrl(); - } - if (targetDir) { - FileList.changeDirectory(targetDir, false); - } - }; - - $(window).scroll(function(e) {FileList._onScroll(e);}); - - var dir = parseCurrentDirFromUrl(); - // trigger ajax load, deferred to let sub-apps do their overrides first - setTimeout(function() { - FileList.changeDirectory(dir, false, true); - }, 0); }); - diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 6d167851e64465249f0a3e23a1299e3da22c1cb4..92f97f5d3c055fd724b4d25e954ab3f3772fa17f 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -8,257 +8,296 @@ * */ -/* global OC, t, FileList */ /* global getURLParameter */ -var Files = { - // file space size sync - _updateStorageStatistics: function() { - Files._updateStorageStatisticsTimeout = null; - var currentDir = FileList.getCurrentDirectory(), - state = Files.updateStorageStatistics; - if (state.dir){ - if (state.dir === currentDir) { +/** + * Utility class for file related operations + */ +(function() { + var Files = { + // file space size sync + _updateStorageStatistics: function(currentDir) { + var state = Files.updateStorageStatistics; + if (state.dir){ + if (state.dir === currentDir) { + return; + } + // cancel previous call, as it was for another dir + state.call.abort(); + } + state.dir = currentDir; + state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) { + state.dir = null; + state.call = null; + Files.updateMaxUploadFilesize(response); + }); + }, + /** + * Update storage statistics such as free space, max upload, + * etc based on the given directory. + * + * Note this function is debounced to avoid making too + * many ajax calls in a row. + * + * @param dir directory + * @param force whether to force retrieving + */ + updateStorageStatistics: function(dir, force) { + if (!OC.currentUser) { return; } - // cancel previous call, as it was for another dir - state.call.abort(); - } - state.dir = currentDir; - state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) { - state.dir = null; - state.call = null; - Files.updateMaxUploadFilesize(response); - }); - }, - updateStorageStatistics: function(force) { - if (!OC.currentUser) { - return; - } - - // debounce to prevent calling too often - if (Files._updateStorageStatisticsTimeout) { - clearTimeout(Files._updateStorageStatisticsTimeout); - } - if (force) { - Files._updateStorageStatistics(); - } - else { - Files._updateStorageStatisticsTimeout = setTimeout(Files._updateStorageStatistics, 250); - } - }, - - updateMaxUploadFilesize:function(response) { - if (response === undefined) { - return; - } - if (response.data !== undefined && response.data.uploadMaxFilesize !== undefined) { - $('#max_upload').val(response.data.uploadMaxFilesize); - $('#free_space').val(response.data.freeSpace); - $('#upload.button').attr('original-title', response.data.maxHumanFilesize); - $('#usedSpacePercent').val(response.data.usedSpacePercent); - Files.displayStorageWarnings(); - } - if (response[0] === undefined) { - return; - } - if (response[0].uploadMaxFilesize !== undefined) { - $('#max_upload').val(response[0].uploadMaxFilesize); - $('#upload.button').attr('original-title', response[0].maxHumanFilesize); - $('#usedSpacePercent').val(response[0].usedSpacePercent); - Files.displayStorageWarnings(); - } - - }, - - /** - * Fix path name by removing double slash at the beginning, if any - */ - fixPath: function(fileName) { - if (fileName.substr(0, 2) == '//') { - return fileName.substr(1); - } - return fileName; - }, - /** - * Checks whether the given file name is valid. - * @param name file name to check - * @return true if the file name is valid. - * Throws a string exception with an error message if - * the file name is not valid - */ - isFileNameValid: function (name) { - var trimmedName = name.trim(); - if (trimmedName === '.' || trimmedName === '..') - { - throw t('files', '"{name}" is an invalid file name.', {name: name}); - } else if (trimmedName.length === 0) { - throw t('files', 'File name cannot be empty.'); - } - // check for invalid characters - var invalidCharacters = - ['\\', '/', '<', '>', ':', '"', '|', '?', '*', '\n']; - for (var i = 0; i < invalidCharacters.length; i++) { - if (trimmedName.indexOf(invalidCharacters[i]) !== -1) { - throw t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."); + if (force) { + Files._updateStorageStatistics(dir); } - } - return true; - }, - displayStorageWarnings: function() { - if (!OC.Notification.isHidden()) { - return; - } - - var usedSpacePercent = $('#usedSpacePercent').val(); - if (usedSpacePercent > 98) { - OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!')); - return; - } - if (usedSpacePercent > 90) { - OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', - {usedSpacePercent: usedSpacePercent})); - } - }, - - displayEncryptionWarning: function() { - - if (!OC.Notification.isHidden()) { - return; - } + else { + Files._updateStorageStatisticsDebounced(dir); + } + }, - var encryptedFiles = $('#encryptedFiles').val(); - var initStatus = $('#encryptionInitStatus').val(); - if (initStatus === '0') { // enc not initialized, but should be - OC.Notification.show(t('files', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again')); - return; - } - if (initStatus === '1') { // encryption tried to init but failed - OC.Notification.show(t('files', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.')); - return; - } - if (encryptedFiles === '1') { - OC.Notification.show(t('files', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.')); - return; - } - }, + updateMaxUploadFilesize:function(response) { + if (response === undefined) { + return; + } + if (response.data !== undefined && response.data.uploadMaxFilesize !== undefined) { + $('#max_upload').val(response.data.uploadMaxFilesize); + $('#free_space').val(response.data.freeSpace); + $('#upload.button').attr('original-title', response.data.maxHumanFilesize); + $('#usedSpacePercent').val(response.data.usedSpacePercent); + Files.displayStorageWarnings(); + } + if (response[0] === undefined) { + return; + } + if (response[0].uploadMaxFilesize !== undefined) { + $('#max_upload').val(response[0].uploadMaxFilesize); + $('#upload.button').attr('original-title', response[0].maxHumanFilesize); + $('#usedSpacePercent').val(response[0].usedSpacePercent); + Files.displayStorageWarnings(); + } - // TODO: move to FileList class - setupDragAndDrop: function() { - var $fileList = $('#fileList'); + }, - //drag/drop of files - $fileList.find('tr td.filename').each(function(i,e) { - if ($(e).parent().data('permissions') & OC.PERMISSION_DELETE) { - $(e).draggable(dragOptions); + /** + * Fix path name by removing double slash at the beginning, if any + */ + fixPath: function(fileName) { + if (fileName.substr(0, 2) == '//') { + return fileName.substr(1); } - }); - - $fileList.find('tr[data-type="dir"] td.filename').each(function(i,e) { - if ($(e).parent().data('permissions') & OC.PERMISSION_CREATE) { - $(e).droppable(folderDropOptions); + return fileName; + }, + + /** + * Checks whether the given file name is valid. + * @param name file name to check + * @return true if the file name is valid. + * Throws a string exception with an error message if + * the file name is not valid + */ + isFileNameValid: function (name) { + var trimmedName = name.trim(); + if (trimmedName === '.' || trimmedName === '..') + { + throw t('files', '"{name}" is an invalid file name.', {name: name}); + } else if (trimmedName.length === 0) { + throw t('files', 'File name cannot be empty.'); + } + // check for invalid characters + var invalidCharacters = + ['\\', '/', '<', '>', ':', '"', '|', '?', '*', '\n']; + for (var i = 0; i < invalidCharacters.length; i++) { + if (trimmedName.indexOf(invalidCharacters[i]) !== -1) { + throw t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."); + } + } + return true; + }, + displayStorageWarnings: function() { + if (!OC.Notification.isHidden()) { + return; } - }); - }, - - /** - * Returns the download URL of the given file(s) - * @param filename string or array of file names to download - * @param dir optional directory in which the file name is, defaults to the current directory - */ - getDownloadUrl: function(filename, dir) { - if ($.isArray(filename)) { - filename = JSON.stringify(filename); - } - var params = { - dir: dir || FileList.getCurrentDirectory(), - files: filename - }; - return this.getAjaxUrl('download', params); - }, - /** - * Returns the ajax URL for a given action - * @param action action string - * @param params optional params map - */ - getAjaxUrl: function(action, params) { - var q = ''; - if (params) { - q = '?' + OC.buildQueryString(params); - } - return OC.filePath('files', 'ajax', action + '.php') + q; - } -}; -$(document).ready(function() { - // FIXME: workaround for trashbin app - if (window.trashBinApp) { - return; - } - Files.displayEncryptionWarning(); - Files.bindKeyboardShortcuts(document, jQuery); + var usedSpacePercent = $('#usedSpacePercent').val(); + if (usedSpacePercent > 98) { + OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!')); + return; + } + if (usedSpacePercent > 90) { + OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', + {usedSpacePercent: usedSpacePercent})); + } + }, - Files.setupDragAndDrop(); + displayEncryptionWarning: function() { - $('#file_action_panel').attr('activeAction', false); + if (!OC.Notification.isHidden()) { + return; + } - // Triggers invisible file input - $('#upload a').on('click', function() { - $(this).parent().children('#file_upload_start').trigger('click'); - return false; - }); + var encryptedFiles = $('#encryptedFiles').val(); + var initStatus = $('#encryptionInitStatus').val(); + if (initStatus === '0') { // enc not initialized, but should be + OC.Notification.show(t('files', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again')); + return; + } + if (initStatus === '1') { // encryption tried to init but failed + OC.Notification.show(t('files', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.')); + return; + } + if (encryptedFiles === '1') { + OC.Notification.show(t('files', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.')); + return; + } + }, + + /** + * Returns the download URL of the given file(s) + * @param filename string or array of file names to download + * @param dir optional directory in which the file name is, defaults to the current directory + */ + getDownloadUrl: function(filename, dir) { + if ($.isArray(filename)) { + filename = JSON.stringify(filename); + } + var params = { + dir: dir, + files: filename + }; + return this.getAjaxUrl('download', params); + }, + + /** + * Returns the ajax URL for a given action + * @param action action string + * @param params optional params map + */ + getAjaxUrl: function(action, params) { + var q = ''; + if (params) { + q = '?' + OC.buildQueryString(params); + } + return OC.filePath('files', 'ajax', action + '.php') + q; + }, + + getMimeIcon: function(mime, ready) { + if (Files.getMimeIcon.cache[mime]) { + ready(Files.getMimeIcon.cache[mime]); + } else { + $.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) { + if(OC.Util.hasSVGSupport()){ + path = path.substr(0, path.length-4) + '.svg'; + } + Files.getMimeIcon.cache[mime]=path; + ready(Files.getMimeIcon.cache[mime]); + }); + } + }, + + /** + * Generates a preview URL based on the URL space. + * @param urlSpec map with {x: width, y: height, file: file path} + * @return preview URL + * @deprecated used OCA.Files.FileList.generatePreviewUrl instead + */ + generatePreviewUrl: function(urlSpec) { + console.warn('DEPRECATED: please use generatePreviewUrl() from an OCA.Files.FileList instance'); + return OCA.Files.App.fileList.generatePreviewUrl(urlSpec); + }, + + /** + * Lazy load preview + * @deprecated used OCA.Files.FileList.lazyLoadPreview instead + */ + lazyLoadPreview : function(path, mime, ready, width, height, etag) { + console.warn('DEPRECATED: please use lazyLoadPreview() from an OCA.Files.FileList instance'); + return OCA.Files.App.fileList.lazyLoadPreview({ + path: path, + mime: mime, + callback: ready, + width: width, + height: height, + etag: etag + }); + }, + + /** + * Initialize the files view + */ + initialize: function() { + Files.getMimeIcon.cache = {}; + Files.displayEncryptionWarning(); + Files.bindKeyboardShortcuts(document, $); + + // TODO: move file list related code (upload) to OCA.Files.FileList + $('#file_action_panel').attr('activeAction', false); + + // Triggers invisible file input + $('#upload a').on('click', function() { + $(this).parent().children('#file_upload_start').trigger('click'); + return false; + }); - // Trigger cancelling of file upload - $('#uploadprogresswrapper .stop').on('click', function() { - OC.Upload.cancelUploads(); - FileList.updateSelectionSummary(); - }); + // Trigger cancelling of file upload + $('#uploadprogresswrapper .stop').on('click', function() { + OC.Upload.cancelUploads(); + }); - // Show trash bin - $('#trash').on('click', function() { - window.location=OC.filePath('files_trashbin', '', 'index.php'); - }); + // drag&drop support using jquery.fileupload + // TODO use OC.dialogs + $(document).bind('drop dragover', function (e) { + e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone + }); + + //do a background scan if needed + scanFiles(); + + // display storage warnings + setTimeout(Files.displayStorageWarnings, 100); + OC.Notification.setDefault(Files.displayStorageWarnings); + + // only possible at the moment if user is logged in or the files app is loaded + if (OC.currentUser && OCA.Files.App) { + // start on load - we ask the server every 5 minutes + var updateStorageStatisticsInterval = 5*60*1000; + var updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval); + + // TODO: this should also stop when switching to another view + // Use jquery-visibility to de-/re-activate file stats sync + if ($.support.pageVisibility) { + $(document).on({ + 'show.visibility': function() { + if (!updateStorageStatisticsIntervalId) { + updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval); + } + }, + 'hide.visibility': function() { + clearInterval(updateStorageStatisticsIntervalId); + updateStorageStatisticsIntervalId = 0; + } + }); + } + } - // drag&drop support using jquery.fileupload - // TODO use OC.dialogs - $(document).bind('drop dragover', function (e) { - e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone - }); - - //do a background scan if needed - scanFiles(); - - // display storage warnings - setTimeout(Files.displayStorageWarnings, 100); - OC.Notification.setDefault(Files.displayStorageWarnings); - - // only possible at the moment if user is logged in - if (OC.currentUser) { - // start on load - we ask the server every 5 minutes - var updateStorageStatisticsInterval = 5*60*1000; - var updateStorageStatisticsIntervalId = setInterval(Files.updateStorageStatistics, updateStorageStatisticsInterval); - - // Use jquery-visibility to de-/re-activate file stats sync - if ($.support.pageVisibility) { - $(document).on({ - 'show.visibility': function() { - if (!updateStorageStatisticsIntervalId) { - updateStorageStatisticsIntervalId = setInterval(Files.updateStorageStatistics, updateStorageStatisticsInterval); - } - }, - 'hide.visibility': function() { - clearInterval(updateStorageStatisticsIntervalId); - updateStorageStatisticsIntervalId = 0; + $('#app-settings-header').on('click', function() { + var $settings = $('#app-settings'); + $settings.toggleClass('opened'); + if ($settings.hasClass('opened')) { + $settings.find('input').focus(); } }); + + //scroll to and highlight preselected file + /* + if (getURLParameter('scrollto')) { + FileList.scrollTo(getURLParameter('scrollto')); + } + */ } } - //scroll to and highlight preselected file - if (getURLParameter('scrollto')) { - FileList.scrollTo(getURLParameter('scrollto')); - } -}); + Files._updateStorageStatisticsDebounced = _.debounce(Files._updateStorageStatistics, 250); + OCA.Files.Files = Files; +})(); function scanFiles(force, dir, users) { if (!OC.currentUser) { @@ -292,7 +331,9 @@ function scanFiles(force, dir, users) { scannerEventSource.listen('done',function(count) { scanFiles.scanning=false; console.log('done after ' + count + ' files'); - Files.updateStorageStatistics(); + if (OCA.Files.App) { + OCA.Files.App.fileList.updateStorageStatistics(true); + } }); scannerEventSource.listen('user',function(user) { console.log('scanning files for ' + user); @@ -303,6 +344,7 @@ scanFiles.scanning=false; // TODO: move to FileList var createDragShadow = function(event) { //select dragged file + var FileList = OCA.Files.App.fileList; var isDragSelected = $(event.target).parents('tr').find('td input:first').prop('checked'); if (!isDragSelected) { //select dragged file @@ -311,7 +353,7 @@ var createDragShadow = function(event) { // do not show drag shadow for too many files var selectedFiles = _.first(FileList.getSelectedFiles(), FileList.pageSize); - selectedFiles.sort(FileList._fileInfoCompare); + selectedFiles = _.sortBy(selectedFiles, FileList._fileInfoCompare); if (!isDragSelected && selectedFiles.length === 1) { //revert the selection @@ -323,7 +365,7 @@ var createDragShadow = function(event) { var tbody = $(''); dragshadow.append(tbody); - var dir=$('#dir').val(); + var dir = FileList.getCurrentDirectory(); $(selectedFiles).each(function(i,elem) { var newtr = $('') @@ -336,8 +378,8 @@ var createDragShadow = function(event) { if (elem.type === 'dir') { newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')'); } else { - var path = getPathForPreview(elem.name); - Files.lazyLoadPreview(path, elem.mime, function(previewpath) { + var path = dir + '/' + elem.name; + OCA.Files.App.files.lazyLoadPreview(path, elem.mime, function(previewpath) { newtr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }, null, null, elem.etag); } @@ -350,9 +392,14 @@ var createDragShadow = function(event) { //start&stop handlers needs some cleaning up // TODO: move to FileList class var dragOptions={ - revert: 'invalid', revertDuration: 300, - opacity: 0.7, zIndex: 100, appendTo: 'body', cursorAt: { left: 24, top: 18 }, - helper: createDragShadow, cursor: 'move', + revert: 'invalid', + revertDuration: 300, + opacity: 0.7, + zIndex: 100, + appendTo: 'body', + cursorAt: { left: 24, top: 18 }, + helper: createDragShadow, + cursor: 'move', start: function(event, ui){ var $selectedFiles = $('td.filename input:checkbox:checked'); if($selectedFiles.length > 1){ @@ -383,6 +430,7 @@ var folderDropOptions = { hoverClass: "canDrop", drop: function( event, ui ) { // don't allow moving a file into a selected folder + var FileList = OCA.Files.App.fileList; if ($(event.target).parents('tr').find('td input:first').prop('checked') === true) { return false; } @@ -400,115 +448,11 @@ var folderDropOptions = { tolerance: 'pointer' }; -Files.getMimeIcon = function(mime, ready) { - if (Files.getMimeIcon.cache[mime]) { - ready(Files.getMimeIcon.cache[mime]); - } else { - $.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) { - if(OC.Util.hasSVGSupport()){ - path = path.substr(0, path.length-4) + '.svg'; - } - Files.getMimeIcon.cache[mime]=path; - ready(Files.getMimeIcon.cache[mime]); - }); - } -} -Files.getMimeIcon.cache={}; - -function getPathForPreview(name) { - var path = $('#dir').val() + '/' + name; - return path; -} - -/** - * Generates a preview URL based on the URL space. - * @param urlSpec map with {x: width, y: height, file: file path} - * @return preview URL - */ -Files.generatePreviewUrl = function(urlSpec) { - urlSpec = urlSpec || {}; - if (!urlSpec.x) { - urlSpec.x = $('#filestable').data('preview-x'); - } - if (!urlSpec.y) { - urlSpec.y = $('#filestable').data('preview-y'); - } - urlSpec.y *= window.devicePixelRatio; - urlSpec.x *= window.devicePixelRatio; - urlSpec.forceIcon = 0; - return OC.generateUrl('/core/preview.png?') + $.param(urlSpec); -}; - -Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) { - // get mime icon url - Files.getMimeIcon(mime, function(iconURL) { - var previewURL, - urlSpec = {}; - ready(iconURL); // set mimeicon URL - - urlSpec.file = Files.fixPath(path); - - if (etag){ - // use etag as cache buster - urlSpec.c = etag; - } - else { - console.warn('Files.lazyLoadPreview(): missing etag argument'); - } - - previewURL = Files.generatePreviewUrl(urlSpec); - previewURL = previewURL.replace('(', '%28'); - previewURL = previewURL.replace(')', '%29'); - - // preload image to prevent delay - // this will make the browser cache the image - var img = new Image(); - img.onload = function(){ - // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 - if (img.width > 5) { - ready(previewURL); - } - }; - img.src = previewURL; - }); -}; - -function getUniqueName(name) { - if (FileList.findFileEl(name).exists()) { - var numMatch; - var parts=name.split('.'); - var extension = ""; - if (parts.length > 1) { - extension=parts.pop(); - } - var base=parts.join('.'); - numMatch=base.match(/\((\d+)\)/); - var num=2; - if (numMatch && numMatch.length>0) { - num=parseInt(numMatch[numMatch.length-1])+1; - base=base.split('('); - base.pop(); - base=$.trim(base.join('(')); - } - name=base+' ('+num+')'; - if (extension) { - name = name+'.'+extension; - } - return getUniqueName(name); - } - return name; -} - -function checkTrashStatus() { - $.post(OC.filePath('files_trashbin', 'ajax', 'isEmpty.php'), function(result) { - if (result.data.isEmpty === false) { - $("input[type=button][id=trash]").removeAttr("disabled"); - } - }); -} - // override core's fileDownloadPath (legacy) function fileDownloadPath(dir, file) { - return Files.getDownloadUrl(file, dir); + return OCA.Files.Files.getDownloadUrl(file, dir); } +// for backward compatibility +window.Files = OCA.Files.Files; + diff --git a/apps/files/js/filesummary.js b/apps/files/js/filesummary.js index b5130247cc99911f068fe1a952b7f72fd738b29a..104dabf1b04ec5e533ee08b30e8a7884a54f8387 100644 --- a/apps/files/js/filesummary.js +++ b/apps/files/js/filesummary.js @@ -190,6 +190,6 @@ this.$el.append($summary); } }; - window.FileSummary = FileSummary; + OCA.Files.FileSummary = FileSummary; })(); diff --git a/apps/files/js/keyboardshortcuts.js b/apps/files/js/keyboardshortcuts.js index 9d6c3ae8c3308ddeeb7774ca000aaf95f8886ef3..b2f2cd0e5828ad9b6ea861c0ebd6eaf7d317eaf2 100644 --- a/apps/files/js/keyboardshortcuts.js +++ b/apps/files/js/keyboardshortcuts.js @@ -12,7 +12,6 @@ * enter: open file/folder * delete/backspace: delete file/folder *****************************/ -var Files = Files || {}; (function(Files) { var keys = []; var keyCodes = { @@ -167,4 +166,4 @@ var Files = Files || {}; removeA(keys, event.keyCode); }); }; -})(Files); +})((OCA.Files && OCA.Files.Files) || {}); diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js new file mode 100644 index 0000000000000000000000000000000000000000..c58a284e83fe01eb36ff1fcea06427e6788df1e5 --- /dev/null +++ b/apps/files/js/navigation.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2014 + * + * @author Vincent Petry + * @copyright 2014 Vincent Petry + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +(function() { + + var Navigation = function($el) { + this.initialize($el); + }; + + Navigation.prototype = { + + /** + * Currently selected item in the list + */ + _activeItem: null, + + /** + * Currently selected container + */ + $currentContent: null, + + /** + * Initializes the navigation from the given container + * @param $el element containing the navigation + */ + initialize: function($el) { + this.$el = $el; + this._activeItem = null; + this.$currentContent = null; + this._setupEvents(); + }, + + /** + * Setup UI events + */ + _setupEvents: function() { + this.$el.on('click', 'li a', _.bind(this._onClickItem, this)); + }, + + /** + * Returns the container of the currently active app. + * + * @return app container + */ + getActiveContainer: function() { + return this.$currentContent; + }, + + /** + * Returns the currently active item + * + * @return item ID + */ + getActiveItem: function() { + return this._activeItem; + }, + + /** + * Switch the currently selected item, mark it as selected and + * make the content container visible, if any. + * + * @param string itemId id of the navigation item to select + * @param array options "silent" to not trigger event + */ + setActiveItem: function(itemId, options) { + var oldItemId = this._activeItem; + if (itemId === this._activeItem) { + if (!options || !options.silent) { + this.$el.trigger( + new $.Event('itemChanged', {itemId: itemId, previousItemId: oldItemId}) + ); + } + return; + } + this.$el.find('li').removeClass('selected'); + if (this.$currentContent) { + this.$currentContent.addClass('hidden'); + this.$currentContent.trigger(jQuery.Event('hide')); + } + this._activeItem = itemId; + this.$el.find('li[data-id=' + itemId + ']').addClass('selected'); + this.$currentContent = $('#app-content-' + itemId); + this.$currentContent.removeClass('hidden'); + if (!options || !options.silent) { + this.$currentContent.trigger(jQuery.Event('show')); + this.$el.trigger( + new $.Event('itemChanged', {itemId: itemId, previousItemId: oldItemId}) + ); + } + }, + + /** + * Returns whether a given item exists + */ + itemExists: function(itemId) { + return this.$el.find('li[data-id=' + itemId + ']').length; + }, + + /** + * Event handler for when clicking on an item. + */ + _onClickItem: function(ev) { + var $target = $(ev.target); + var itemId = $target.closest('li').attr('data-id'); + this.setActiveItem(itemId); + return false; + } + }; + + OCA.Files.Navigation = Navigation; + +})(); diff --git a/apps/files/l10n/ar.php b/apps/files/l10n/ar.php index 6779141c5eece747e39125b5bf96c651d057d87b..72effe3e207c396ddbdd5384bbf04b443f8a7aa8 100644 --- a/apps/files/l10n/ar.php +++ b/apps/files/l10n/ar.php @@ -52,19 +52,19 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 = غير محدود", "Maximum input size for ZIP files" => "الحد الأقصى المسموح به لملفات ZIP", "Save" => "حفظ", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "استخدم هذا العنوان لـ الدخول الى ملفاتك عن طريق WebDAV", "New" => "جديد", "Text file" => "ملف", "New folder" => "مجلد جديد", "Folder" => "مجلد", "From link" => "من رابط", -"Deleted files" => "حذف الملفات", "Cancel upload" => "إلغاء رفع الملفات", "Nothing in here. Upload something!" => "لا يوجد شيء هنا. إرفع بعض الملفات!", "Download" => "تحميل", "Delete" => "إلغاء", "Upload too large" => "حجم الترفيع أعلى من المسموح", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "حجم الملفات التي تريد ترفيعها أعلى من المسموح على الخادم.", -"Files are being scanned, please wait." => "يرجى الانتظار , جاري فحص الملفات .", -"Current scanning" => "الفحص الحالي" +"Files are being scanned, please wait." => "يرجى الانتظار , جاري فحص الملفات ." ); $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/l10n/ast.php b/apps/files/l10n/ast.php index 7dfeaf8cde70c9245459e4b12c15547bf9f09522..b0d7e42d5d0ab1d134ad3bb8032217d487fa7db5 100644 --- a/apps/files/l10n/ast.php +++ b/apps/files/l10n/ast.php @@ -1,30 +1,93 @@ "Nun pudo movese %s - Yá existe un ficheru con esi nome.", +"Could not move %s" => "Nun pudo movese %s", "File name cannot be empty." => "El nome de ficheru nun pue quedar baleru.", +"\"%s\" is an invalid file name." => "\"%s\" ye un nome de ficheru inválidu.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome inválidu, los caráuteres \"\\\", \"/\", \"<\", \">\", \":\", \"\", \"|\" \"?\" y \"*\" nun tán permitíos.", +"The target folder has been moved or deleted." => "La carpeta oxetivu movióse o desanicióse.", +"The name %s is already used in the folder %s. Please choose a different name." => "El nome %s yá ta n'usu na carpeta %s. Por favor, escueyi un nome diferente.", +"Not a valid source" => "Nun ye una fonte válida", +"Server is not allowed to open URLs, please check the server configuration" => "Nun se-y permite al sirvidor abrir URLs, por favor comprueba la configuración del sirvidor", +"Error while downloading %s to %s" => "Fallu cuando se descargaba %s a %s", +"Error when creating the file" => "Fallu cuando se creaba'l ficheru", +"Folder name cannot be empty." => "El nome la carpeta nun pue tar baleru.", +"Error when creating the folder" => "Fallu cuando se creaba la carpeta", +"Unable to set upload directory." => "Nun pue afitase la carpeta de xubida.", +"Invalid Token" => "Token inválidu", "No file was uploaded. Unknown error" => "Nun se xubió dengún ficheru. Fallu desconocíu", "There is no error, the file uploaded with success" => "Nun hai dengún fallu, el ficheru xubióse ensin problemes", +"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "El ficheru xubíu perpasa la direutiva \"upload_max_filesize\" del ficheru php.ini", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "El ficheru xubíu perpasa la direutiva \"MAX_FILE_SIZE\" especificada nel formulariu HTML", "The uploaded file was only partially uploaded" => "El ficheru xubióse de mou parcial", "No file was uploaded" => "Nun se xubió dengún ficheru", "Missing a temporary folder" => "Falta una carpeta temporal", "Failed to write to disk" => "Fallu al escribir al discu", "Not enough storage available" => "Nun hai abondu espaciu disponible", +"Upload failed. Could not find uploaded file" => "Xubida fallía. Nun se pudo atopar el ficheru xubíu.", +"Upload failed. Could not get file info." => "Falló la xubida. Nun se pudo obtener la información del ficheru.", +"Invalid directory." => "Direutoriu non válidu.", "Files" => "Ficheros", +"All files" => "Tolos ficheros", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nun se pudo xubir {filename}, paez que ye un directoriu o tien 0 bytes", +"Total file size {size1} exceeds upload limit {size2}" => "El tamañu de ficheru total {size1} perpasa'l llímite de xuba {size2}", +"Not enough free space, you are uploading {size1} but only {size2} is left" => "Nun hai abondu espaciu llibre, tas xubiendo {size1} pero namái falta {size2}", +"Upload cancelled." => "Xuba encaboxada.", +"Could not get result from server." => "Nun se pudo obtener el resultáu del servidor.", +"File upload is in progress. Leaving the page now will cancel the upload." => "La xuba del ficheru ta en progresu. Si dexes agora la páxina, la xuba nun s'encaboxará.", +"URL cannot be empty" => "La URL nun pue tar balera", +"{new_name} already exists" => "{new_name} yá existe", +"Could not create file" => "Nun pudo crease'l ficheru", +"Could not create folder" => "Nun pudo crease la carpeta", "Share" => "Compartir", +"Delete permanently" => "Desaniciar dafechu", "Rename" => "Renomar", +"Your download is being prepared. This might take some time if the files are big." => "Ta preparándose la to descarga. Esto podría llevar dalgún tiempu si los ficheros son grandes.", +"Pending" => "Pendiente", +"Error moving file." => "Fallu moviendo'l ficheru.", +"Error moving file" => "Fallu moviendo'l ficheru", "Error" => "Fallu", +"Could not rename file" => "Nun pudo renomase'l ficheru", +"Error deleting file." => "Fallu desaniciando'l ficheru.", "Name" => "Nome", "Size" => "Tamañu", -"_%n folder_::_%n folders_" => array("",""), -"_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Modified" => "Modificáu", +"_%n folder_::_%n folders_" => array("%n carpeta","%n carpetes"), +"_%n file_::_%n files_" => array("%n ficheru","%n ficheros"), +"_Uploading %n file_::_Uploading %n files_" => array("Xubiendo %n ficheru","Xubiendo %n ficheros"), +"\"{name}\" is an invalid file name." => "\"{name}\" ye un nome de ficheru inválidu.", +"Your storage is full, files can not be updated or synced anymore!" => "L'almacenamientu ta completu, ¡yá nun se pueden anovar o sincronizar ficheros!", +"Your storage is almost full ({usedSpacePercent}%)" => "L'almacenamientu ta casi completu ({usedSpacePercent}%)", +"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "L'aplicación Encryption ta habilitada pero les tos claves nun s'aniciaron, por favor zarra sesión y aníciala de nueves", +"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Clave privada non válida pa Encryption. Por favor, anova la to contraseña de clave nos tos axustes personales pa recuperar l'accesu a los tos ficheros cifraos.", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Deshabilitose'l cifráu pero los tos ficheros tovía tan cifraos. Por favor, vete a los axustes personales pa descrifrar los tos ficheros.", +"{dirs} and {files}" => "{dirs} y {files}", +"%s could not be renamed" => "Nun se puede renomar %s ", +"Upload (max. %s)" => "Xuba (máx. %s)", +"File handling" => "Alministración de ficheros", +"Maximum upload size" => "Tamañu máximu de xubida", +"max. possible: " => "máx. posible:", +"Needed for multi-file and folder downloads." => "Ye necesariu pa descargues multificheru y de carpetes", +"Enable ZIP-download" => "Activar descarga ZIP", +"0 is unlimited" => "0 ye illimitao", +"Maximum input size for ZIP files" => "Tamañu máximu d'entrada pa ficheros ZIP", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Usa esta direición pa acceder a los ficheros a traviés de WebDAV", +"New" => "Nuevu", +"New text file" => "Ficheru de testu nuevu", +"Text file" => "Ficheru de testu", "New folder" => "Nueva carpeta", "Folder" => "Carpeta", -"Deleted files" => "Ficheros desaniciaos", +"From link" => "Dende enllaz", "Cancel upload" => "Encaboxar xuba", +"You don’t have permission to upload or create files here" => "Nun tienes permisu pa xubir o crear ficheros equí", +"Nothing in here. Upload something!" => "Nun hai nada equí. ¡Xubi daqué!", "Download" => "Descargar", -"Delete" => "Desaniciar" +"Delete" => "Desaniciar", +"Upload too large" => "La xuba ye abondo grande", +"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los ficheros que tas intentando xubir perpasen el tamañu máximu pa les xubíes de ficheros nesti servidor.", +"Files are being scanned, please wait." => "Tan escaniándose los ficheros, espera por favor.", +"Currently scanning" => "Anguaño escaneando" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/bg_BG.php b/apps/files/l10n/bg_BG.php index f9ef3750b5ce8c46b75aec0ce6250fc4bbd9720f..7b5bac636d793089cf2f4586d39cb5d7deaa2e37 100644 --- a/apps/files/l10n/bg_BG.php +++ b/apps/files/l10n/bg_BG.php @@ -23,6 +23,7 @@ $TRANSLATIONS = array( "Maximum upload size" => "Максимален размер за качване", "0 is unlimited" => "Ползвайте 0 за без ограничения", "Save" => "Запис", +"WebDAV" => "WebDAV", "New" => "Ново", "Text file" => "Текстов файл", "New folder" => "Нова папка", diff --git a/apps/files/l10n/bn_BD.php b/apps/files/l10n/bn_BD.php index b96d2515f1c7439186420e872a57179915ab2efb..55bafd1a8fdae1b6296bde9c07108fe3c54b26b5 100644 --- a/apps/files/l10n/bn_BD.php +++ b/apps/files/l10n/bn_BD.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "0 is unlimited" => "০ এর অর্থ অসীম", "Maximum input size for ZIP files" => "ZIP ফাইলের ইনপুটের সর্বোচ্চ আকার", "Save" => "সংরক্ষণ", +"WebDAV" => "WebDAV", "New" => "নতুন", "Text file" => "টেক্সট ফাইল", "Folder" => "ফোল্ডার", @@ -45,7 +46,6 @@ $TRANSLATIONS = array( "Delete" => "মুছে", "Upload too large" => "আপলোডের আকারটি অনেক বড়", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "আপনি এই সার্ভারে আপলোড করার জন্য অনুমোদিত ফাইলের সর্বোচ্চ আকারের চেয়ে বৃহদাকার ফাইল আপলোড করার চেষ্টা করছেন ", -"Files are being scanned, please wait." => "ফাইলগুলো স্ক্যান করা হচ্ছে, দয়া করে অপেক্ষা করুন।", -"Current scanning" => "বর্তমান স্ক্যানিং" +"Files are being scanned, please wait." => "ফাইলগুলো স্ক্যান করা হচ্ছে, দয়া করে অপেক্ষা করুন।" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/bn_IN.php b/apps/files/l10n/bn_IN.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/bn_IN.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php index 94ad8cbb1223b38da3c993cb434547115e02107f..9929cfea88d2bbf5506ea9a149cf35aa91da74e5 100644 --- a/apps/files/l10n/ca.php +++ b/apps/files/l10n/ca.php @@ -71,13 +71,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 és sense límit", "Maximum input size for ZIP files" => "Mida màxima d'entrada per fitxers ZIP", "Save" => "Desa", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Useu aquesta adreça per accedir als fitxers via WebDAV", "New" => "Nou", "New text file" => "Nou fitxer de text", "Text file" => "Fitxer de text", "New folder" => "Carpeta nova", "Folder" => "Carpeta", "From link" => "Des d'enllaç", -"Deleted files" => "Fitxers esborrats", "Cancel upload" => "Cancel·la la pujada", "You don’t have permission to upload or create files here" => "No teniu permisos per a pujar o crear els fitxers aquí", "Nothing in here. Upload something!" => "Res per aquí. Pugeu alguna cosa!", @@ -85,7 +86,6 @@ $TRANSLATIONS = array( "Delete" => "Esborra", "Upload too large" => "La pujada és massa gran", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Els fitxers que esteu intentant pujar excedeixen la mida màxima de pujada del servidor", -"Files are being scanned, please wait." => "S'estan escanejant els fitxers, espereu", -"Current scanning" => "Actualment escanejant" +"Files are being scanned, please wait." => "S'estan escanejant els fitxers, espereu" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php index 8fa0bb21370d0e6b81d4a620ce61840014d6ee63..ebfc2e6add78eca5ae2be368336e370f74a14e80 100644 --- a/apps/files/l10n/cs_CZ.php +++ b/apps/files/l10n/cs_CZ.php @@ -72,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 znamená bez omezení", "Maximum input size for ZIP files" => "Maximální velikost vstupu pro ZIP soubory", "Save" => "Uložit", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Použijte tuto adresu pro přístup k vašim souborům přes WebDAV", "New" => "Nový", "New text file" => "Nový textový soubor", "Text file" => "Textový soubor", "New folder" => "Nová složka", "Folder" => "Složka", "From link" => "Z odkazu", -"Deleted files" => "Odstraněné soubory", "Cancel upload" => "Zrušit odesílání", "You don’t have permission to upload or create files here" => "Nemáte oprávnění zde nahrávat či vytvářet soubory", "Nothing in here. Upload something!" => "Žádný obsah. Nahrajte něco.", @@ -86,7 +87,6 @@ $TRANSLATIONS = array( "Delete" => "Smazat", "Upload too large" => "Odesílaný soubor je příliš velký", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Soubory, které se snažíte odeslat, překračují limit velikosti odesílání na tomto serveru.", -"Files are being scanned, please wait." => "Soubory se prohledávají, prosím čekejte.", -"Current scanning" => "Aktuální prohledávání" +"Files are being scanned, please wait." => "Soubory se prohledávají, prosím čekejte." ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files/l10n/cy_GB.php b/apps/files/l10n/cy_GB.php index 6ed94e5c77c79dad87a5d83b87229e0b27bf52ab..443d21667ccfec2df1054397a4d93aad4cd1cf5f 100644 --- a/apps/files/l10n/cy_GB.php +++ b/apps/files/l10n/cy_GB.php @@ -44,14 +44,12 @@ $TRANSLATIONS = array( "Text file" => "Ffeil destun", "Folder" => "Plygell", "From link" => "Dolen o", -"Deleted files" => "Ffeiliau ddilewyd", "Cancel upload" => "Diddymu llwytho i fyny", "Nothing in here. Upload something!" => "Does dim byd fan hyn. Llwythwch rhywbeth i fyny!", "Download" => "Llwytho i lawr", "Delete" => "Dileu", "Upload too large" => "Maint llwytho i fyny'n rhy fawr", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Mae'r ffeiliau rydych yn ceisio llwytho i fyny'n fwy na maint mwyaf llwytho ffeiliau i fyny ar y gweinydd hwn.", -"Files are being scanned, please wait." => "Arhoswch, mae ffeiliau'n cael eu sganio.", -"Current scanning" => "Sganio cyfredol" +"Files are being scanned, please wait." => "Arhoswch, mae ffeiliau'n cael eu sganio." ); $PLURAL_FORMS = "nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;"; diff --git a/apps/files/l10n/da.php b/apps/files/l10n/da.php index 076fa46b4c38f6f13638f37d9d9b5fc0585781e2..95b848a50e510e729099164d9c3ec92044540bdb 100644 --- a/apps/files/l10n/da.php +++ b/apps/files/l10n/da.php @@ -72,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ubegrænset", "Maximum input size for ZIP files" => "Maksimal størrelse på ZIP filer", "Save" => "Gem", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Brug denne adresse for at tilgå dine filer via WebDAV", "New" => "Ny", "New text file" => "Ny tekstfil", "Text file" => "Tekstfil", "New folder" => "Ny Mappe", "Folder" => "Mappe", "From link" => "Fra link", -"Deleted files" => "Slettede filer", "Cancel upload" => "Fortryd upload", "You don’t have permission to upload or create files here" => "Du har ikke tilladelse til at uploade eller oprette filer her", "Nothing in here. Upload something!" => "Her er tomt. Upload noget!", @@ -86,7 +87,6 @@ $TRANSLATIONS = array( "Delete" => "Slet", "Upload too large" => "Upload er for stor", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Filerne, du prøver at uploade, er større end den maksimale størrelse for fil-upload på denne server.", -"Files are being scanned, please wait." => "Filerne bliver indlæst, vent venligst.", -"Current scanning" => "Indlæser" +"Files are being scanned, please wait." => "Filerne bliver indlæst, vent venligst." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php index 8ad0f8909f194e2c84b1edb1f62fd0aec7fa9690..685d84854b1967c420647cf871133f1f62a2401f 100644 --- a/apps/files/l10n/de.php +++ b/apps/files/l10n/de.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.", "Invalid directory." => "Ungültiges Verzeichnis.", "Files" => "Dateien", +"All files" => "Alle Dateien", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", "Total file size {size1} exceeds upload limit {size2}" => "Die Gesamt-Größe {size1} überschreitet die Upload-Begrenzung {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Nicht genügend freier Speicherplatz, du möchtest {size1} hochladen, es sind jedoch nur noch {size2} verfügbar.", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 bedeutet unbegrenzt", "Maximum input size for ZIP files" => "Maximale Größe für ZIP-Dateien", "Save" => "Speichern", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Verwenden Sie diese Adresse, um via WebDAV auf Ihre Dateien zuzugreifen", "New" => "Neu", "New text file" => "Neue Textdatei", "Text file" => "Textdatei", "New folder" => "Neuer Ordner", "Folder" => "Ordner", "From link" => "Von einem Link", -"Deleted files" => "Gelöschte Dateien", "Cancel upload" => "Upload abbrechen", "You don’t have permission to upload or create files here" => "Du besitzt hier keine Berechtigung, um Dateien hochzuladen oder zu erstellen", "Nothing in here. Upload something!" => "Alles leer. Lade etwas hoch!", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Der Upload ist zu groß", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.", "Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", -"Current scanning" => "Scanne" +"Currently scanning" => "Durchsuchen läuft" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/de_CH.php b/apps/files/l10n/de_CH.php index 625b9387b0ab630144cf74ed14dcebb2763ac5a5..536b0c055c95970de62f9650d43574b18d08ee91 100644 --- a/apps/files/l10n/de_CH.php +++ b/apps/files/l10n/de_CH.php @@ -44,19 +44,18 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 bedeutet unbegrenzt", "Maximum input size for ZIP files" => "Maximale Grösse für ZIP-Dateien", "Save" => "Speichern", +"WebDAV" => "WebDAV", "New" => "Neu", "Text file" => "Textdatei", "New folder" => "Neues Verzeichnis", "Folder" => "Ordner", "From link" => "Von einem Link", -"Deleted files" => "Gelöschte Dateien", "Cancel upload" => "Upload abbrechen", "Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!", "Download" => "Herunterladen", "Delete" => "Löschen", "Upload too large" => "Der Upload ist zu gross", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgrösse für Uploads auf diesem Server.", -"Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", -"Current scanning" => "Scanne" +"Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php index 9a834f1cc31733d5c4a3014a5a060a0678142ea8..bc7e12b066f9925cac7038e05ecbfe6c5792588c 100644 --- a/apps/files/l10n/de_DE.php +++ b/apps/files/l10n/de_DE.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Die Dateiinformationen konnten nicht abgerufen werden.", "Invalid directory." => "Ungültiges Verzeichnis.", "Files" => "Dateien", +"All files" => "Alle Dateien", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Die Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist", "Total file size {size1} exceeds upload limit {size2}" => "Die Gesamt-Größe {size1} überschreitet die Upload-Begrenzung {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Nicht genügend freier Speicherplatz, Sie möchten {size1} hochladen, es sind jedoch nur noch {size2} verfügbar.", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 bedeutet unbegrenzt", "Maximum input size for ZIP files" => "Maximale Größe für ZIP-Dateien", "Save" => "Speichern", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Verwenden Sie diese Adresse, um via WebDAV auf Ihre Dateien zuzugreifen", "New" => "Neu", "New text file" => "Neue Textdatei", "Text file" => "Textdatei", "New folder" => "Neuer Ordner", "Folder" => "Ordner", "From link" => "Von einem Link", -"Deleted files" => "Gelöschte Dateien", "Cancel upload" => "Upload abbrechen", "You don’t have permission to upload or create files here" => "Sie besitzen hier keine Berechtigung Dateien hochzuladen oder zu erstellen", "Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Der Upload ist zu groß", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.", "Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", -"Current scanning" => "Scanne" +"Currently scanning" => "Durchsuchen läuft" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php index 5ba92033d13360b780be3d1f0cac1d11e43f47be..1ea2c3cc3d2bcf3ef355b93577d0664272bb3761 100644 --- a/apps/files/l10n/el.php +++ b/apps/files/l10n/el.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Η φόρτωση απέτυχε. Αδυναμία λήψης πληροφοριών αρχείων.", "Invalid directory." => "Μη έγκυρος φάκελος.", "Files" => "Αρχεία", +"All 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}", @@ -44,6 +45,7 @@ $TRANSLATIONS = array( "Rename" => "Μετονομασία", "Your download is being prepared. This might take some time if the files are big." => "Η λήψη προετοιμάζεται. Αυτό μπορεί να πάρει ώρα εάν τα αρχεία έχουν μεγάλο μέγεθος.", "Pending" => "Εκκρεμεί", +"Error moving file." => "Σφάλμα κατά τη μετακίνηση του αρχείου.", "Error moving file" => "Σφάλμα κατά τη μετακίνηση του αρχείου", "Error" => "Σφάλμα", "Could not rename file" => "Αδυναμία μετονομασίας αρχείου", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 για απεριόριστο", "Maximum input size for ZIP files" => "Μέγιστο μέγεθος για αρχεία ZIP", "Save" => "Αποθήκευση", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Χρησιμοποιήστε αυτήν την διεύθυνση για να αποκτήσετε πρόσβαση στα αρχεία σας μέσω WebDAV", "New" => "Νέο", "New text file" => "Νέο αρχείο κειμένου", "Text file" => "Αρχείο κειμένου", "New folder" => "Νέος κατάλογος", "Folder" => "Φάκελος", "From link" => "Από σύνδεσμο", -"Deleted files" => "Διαγραμμένα αρχεία", "Cancel upload" => "Ακύρωση αποστολής", "You don’t have permission to upload or create files here" => "Δεν έχετε δικαιώματα φόρτωσης ή δημιουργίας αρχείων εδώ", "Nothing in here. Upload something!" => "Δεν υπάρχει τίποτα εδώ. Ανεβάστε κάτι!", @@ -85,7 +88,6 @@ $TRANSLATIONS = array( "Delete" => "Διαγραφή", "Upload too large" => "Πολύ μεγάλο αρχείο προς αποστολή", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Τα αρχεία που προσπαθείτε να ανεβάσετε υπερβαίνουν το μέγιστο μέγεθος αποστολής αρχείων σε αυτόν τον διακομιστή.", -"Files are being scanned, please wait." => "Τα αρχεία σαρώνονται, παρακαλώ περιμένετε.", -"Current scanning" => "Τρέχουσα ανίχνευση" +"Files are being scanned, please wait." => "Τα αρχεία σαρώνονται, παρακαλώ περιμένετε." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/en_GB.php b/apps/files/l10n/en_GB.php index 5ebc141b80e74b175f4be917cbf0be3c8e3305dc..37229a45808885f6090a06ab36af1b16d3ea4b28 100644 --- a/apps/files/l10n/en_GB.php +++ b/apps/files/l10n/en_GB.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Upload failed. Could not get file info.", "Invalid directory." => "Invalid directory.", "Files" => "Files", +"All files" => "All files", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Unable to upload {filename} as it is a directory or has 0 bytes", "Total file size {size1} exceeds upload limit {size2}" => "Total file size {size1} exceeds upload limit {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Not enough free space, you are uploading {size1} but only {size2} is left", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 is unlimited", "Maximum input size for ZIP files" => "Maximum input size for ZIP files", "Save" => "Save", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Use this address to access your Files via WebDAV", "New" => "New", "New text file" => "New text file", "Text file" => "Text file", "New folder" => "New folder", "Folder" => "Folder", "From link" => "From link", -"Deleted files" => "Deleted files", "Cancel upload" => "Cancel upload", "You don’t have permission to upload or create files here" => "You don’t have permission to upload or create files here", "Nothing in here. Upload something!" => "Nothing in here. Upload something!", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Upload too large", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "The files you are trying to upload exceed the maximum size for file uploads on this server.", "Files are being scanned, please wait." => "Files are being scanned, please wait.", -"Current scanning" => "Currently scanning" +"Currently scanning" => "Currently scanning" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/eo.php b/apps/files/l10n/eo.php index eebd94abc33263042a211434e3cdfde4f2a54bc0..651948dfeb0301261bc8e9ad98cc5c3e084e50c0 100644 --- a/apps/files/l10n/eo.php +++ b/apps/files/l10n/eo.php @@ -58,12 +58,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 signifas senlime", "Maximum input size for ZIP files" => "Maksimuma enirgrando por ZIP-dosieroj", "Save" => "Konservi", +"WebDAV" => "WebDAV", "New" => "Nova", "Text file" => "Tekstodosiero", "New folder" => "Nova dosierujo", "Folder" => "Dosierujo", "From link" => "El ligilo", -"Deleted files" => "Forigitaj dosieroj", "Cancel upload" => "Nuligi alŝuton", "You don’t have permission to upload or create files here" => "Vi ne havas permeson alŝuti aŭ krei dosierojn ĉi tie", "Nothing in here. Upload something!" => "Nenio estas ĉi tie. Alŝutu ion!", @@ -71,7 +71,6 @@ $TRANSLATIONS = array( "Delete" => "Forigi", "Upload too large" => "Alŝuto tro larĝa", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "La dosieroj, kiujn vi provas alŝuti, transpasas la maksimuman grandon por dosieralŝutoj en ĉi tiu servilo.", -"Files are being scanned, please wait." => "Dosieroj estas skanataj, bonvolu atendi.", -"Current scanning" => "Nuna skano" +"Files are being scanned, please wait." => "Dosieroj estas skanataj, bonvolu atendi." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php index ba115e6af7883183e91ce9957be1afd16d66b6bb..9449f90f1c984e6e96e8a78730d10d2fd00c030d 100644 --- a/apps/files/l10n/es.php +++ b/apps/files/l10n/es.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Actualización fallida. No se pudo obtener información del archivo.", "Invalid directory." => "Directorio inválido.", "Files" => "Archivos", +"All files" => "Todos los archivos", "Unable to upload {filename} as it is a directory or has 0 bytes" => "No ha sido posible subir {filename} porque es un directorio o tiene 0 bytes", "Total file size {size1} exceeds upload limit {size2}" => "El tamaño total del archivo {size1} excede el límite {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "No hay suficiente espacio libre. Quiere subir {size1} pero solo quedan {size2}", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Use esta URL para acceder via WebDAV", "New" => "Nuevo", "New text file" => "Nuevo archivo de texto", "Text file" => "Archivo de texto", "New folder" => "Nueva carpeta", "Folder" => "Carpeta", "From link" => "Desde enlace", -"Deleted files" => "Archivos eliminados", "Cancel upload" => "Cancelar subida", "You don’t have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí.", "Nothing in here. Upload something!" => "No hay nada aquí. ¡Suba algo!", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Subida demasido grande", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los archivos que estás intentando subir sobrepasan el tamaño máximo permitido en este servidor.", "Files are being scanned, please wait." => "Los archivos están siendo escaneados, por favor espere.", -"Current scanning" => "Escaneo actual" +"Currently scanning" => "Escaneando en este momento" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_AR.php b/apps/files/l10n/es_AR.php index 7d1eb0fb4aaa0f7b20ed60e832804fcab626f54d..3bef48950552e41e1e9d9329b679c66847a4fef8 100644 --- a/apps/files/l10n/es_AR.php +++ b/apps/files/l10n/es_AR.php @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Usar esta dirección para acceder a tus archivos vía WebDAV", "New" => "Nuevo", "New text file" => "Nuevo archivo de texto", "Text file" => "Archivo de texto", "New folder" => "Nueva Carpeta", "Folder" => "Carpeta", "From link" => "Desde enlace", -"Deleted files" => "Archivos borrados", "Cancel upload" => "Cancelar subida", "You don’t have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí", "Nothing in here. Upload something!" => "No hay nada. ¡Subí contenido!", @@ -79,7 +80,6 @@ $TRANSLATIONS = array( "Delete" => "Borrar", "Upload too large" => "El tamaño del archivo que querés subir es demasiado grande", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los archivos que intentás subir sobrepasan el tamaño máximo ", -"Files are being scanned, please wait." => "Se están escaneando los archivos, por favor esperá.", -"Current scanning" => "Escaneo actual" +"Files are being scanned, please wait." => "Se están escaneando los archivos, por favor esperá." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_BO.php b/apps/files/l10n/es_BO.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_BO.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_MX.php b/apps/files/l10n/es_MX.php index b6d06d941363d443f68d95ceb1577b74e5fcac01..3743a33f606d7744e0b1e2d12f3c3fd22c535574 100644 --- a/apps/files/l10n/es_MX.php +++ b/apps/files/l10n/es_MX.php @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utilice esta dirección para acceder a sus archivos vía WebDAV", "New" => "Nuevo", "New text file" => "Nuevo archivo de texto", "Text file" => "Archivo de texto", "New folder" => "Nueva carpeta", "Folder" => "Carpeta", "From link" => "Desde enlace", -"Deleted files" => "Archivos eliminados", "Cancel upload" => "Cancelar subida", "You don’t have permission to upload or create files here" => "No tienes permisos para subir o crear archivos aquí.", "Nothing in here. Upload something!" => "No hay nada aquí. ¡Suba algo!", @@ -79,7 +80,6 @@ $TRANSLATIONS = array( "Delete" => "Eliminar", "Upload too large" => "Subida demasido grande", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los archivos que estás intentando subir sobrepasan el tamaño máximo permitido en este servidor.", -"Files are being scanned, please wait." => "Los archivos están siendo escaneados, por favor espere.", -"Current scanning" => "Escaneo actual" +"Files are being scanned, please wait." => "Los archivos están siendo escaneados, por favor espere." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_PY.php b/apps/files/l10n/es_PY.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_PY.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/es_US.php b/apps/files/l10n/es_US.php new file mode 100644 index 0000000000000000000000000000000000000000..0157af093e92200cc7790497227e92e62d80165f --- /dev/null +++ b/apps/files/l10n/es_US.php @@ -0,0 +1,7 @@ + array("",""), +"_%n file_::_%n files_" => array("",""), +"_Uploading %n file_::_Uploading %n files_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php index 4956e3fb45b72d440b74271ce243d72d3aa032ad..7e8a84cdf65b2d8f7e715844808106a098d4b249 100644 --- a/apps/files/l10n/et_EE.php +++ b/apps/files/l10n/et_EE.php @@ -71,13 +71,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 tähendab piiramatut", "Maximum input size for ZIP files" => "Maksimaalne ZIP-faili sisestatava faili suurus", "Save" => "Salvesta", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Kasuta seda aadressi oma failidele ligipääsuks WebDAV kaudu", "New" => "Uus", "New text file" => "Uus tekstifail", "Text file" => "Tekstifail", "New folder" => "Uus kaust", "Folder" => "Kaust", "From link" => "Allikast", -"Deleted files" => "Kustutatud failid", "Cancel upload" => "Tühista üleslaadimine", "You don’t have permission to upload or create files here" => "Sul puuduvad õigused siia failide üleslaadimiseks või tekitamiseks", "Nothing in here. Upload something!" => "Siin pole midagi. Lae midagi üles!", @@ -85,7 +86,6 @@ $TRANSLATIONS = array( "Delete" => "Kustuta", "Upload too large" => "Üleslaadimine on liiga suur", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Failid, mida sa proovid üles laadida, ületab serveri poolt üleslaetavatele failidele määratud maksimaalse suuruse.", -"Files are being scanned, please wait." => "Faile skannitakse, palun oota.", -"Current scanning" => "Praegune skannimine" +"Files are being scanned, please wait." => "Faile skannitakse, palun oota." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php index 3ad25d2fe4e5982f75ed9f473be57cc096b1c49d..b60358e4202c640af4d32c4d93a8892651f4e040 100644 --- a/apps/files/l10n/eu.php +++ b/apps/files/l10n/eu.php @@ -72,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 mugarik gabe esan nahi du", "Maximum input size for ZIP files" => "ZIP fitxategien gehienezko tamaina", "Save" => "Gorde", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "helbidea erabili zure fitxategiak WebDAV bidez eskuratzeko", "New" => "Berria", "New text file" => "Testu fitxategi berria", "Text file" => "Testu fitxategia", "New folder" => "Karpeta berria", "Folder" => "Karpeta", "From link" => "Estekatik", -"Deleted files" => "Ezabatutako fitxategiak", "Cancel upload" => "Ezeztatu igoera", "You don’t have permission to upload or create files here" => "Ez duzu fitxategiak hona igotzeko edo hemen sortzeko baimenik", "Nothing in here. Upload something!" => "Ez dago ezer. Igo zerbait!", @@ -86,7 +87,6 @@ $TRANSLATIONS = array( "Delete" => "Ezabatu", "Upload too large" => "Igoera handiegia da", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Igotzen saiatzen ari zaren fitxategiak zerbitzari honek igotzeko onartzen duena baino handiagoak dira.", -"Files are being scanned, please wait." => "Fitxategiak eskaneatzen ari da, itxoin mezedez.", -"Current scanning" => "Orain eskaneatzen ari da" +"Files are being scanned, please wait." => "Fitxategiak eskaneatzen ari da, itxoin mezedez." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/fa.php b/apps/files/l10n/fa.php index ce4efe00e2ccb19900a8f8a31f6ace5c31f21b20..46e8dca52349031e0c92af62742d81cd461f9871 100644 --- a/apps/files/l10n/fa.php +++ b/apps/files/l10n/fa.php @@ -43,19 +43,19 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 نامحدود است", "Maximum input size for ZIP files" => "حداکثرمقدار برای بار گزاری پرونده های فشرده", "Save" => "ذخیره", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "از این آدرس استفاده کنید تا بتوانید به فایل‌های خود توسط WebDAV دسترسی پیدا کنید", "New" => "جدید", "Text file" => "فایل متنی", "New folder" => "پوشه جدید", "Folder" => "پوشه", "From link" => "از پیوند", -"Deleted files" => "فایل های حذف شده", "Cancel upload" => "متوقف کردن بار گذاری", "Nothing in here. Upload something!" => "اینجا هیچ چیز نیست.", "Download" => "دانلود", "Delete" => "حذف", "Upload too large" => "سایز فایل برای آپلود زیاد است(م.تنظیمات در php.ini)", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "فایلها بیش از حد تعیین شده در این سرور هستند\nمترجم:با تغییر فایل php,ini میتوان این محدودیت را برطرف کرد", -"Files are being scanned, please wait." => "پرونده ها در حال بازرسی هستند لطفا صبر کنید", -"Current scanning" => "بازرسی کنونی" +"Files are being scanned, please wait." => "پرونده ها در حال بازرسی هستند لطفا صبر کنید" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/fi_FI.php b/apps/files/l10n/fi_FI.php index 2a5c02277f683fba20511db1c3af8f6dae213861..668f85cfc45de31b6f5be3f1c6329c5f1be9693e 100644 --- a/apps/files/l10n/fi_FI.php +++ b/apps/files/l10n/fi_FI.php @@ -27,6 +27,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Lähetys epäonnistui. Lähettävää tiedostoa ei löydetty.", "Invalid directory." => "Virheellinen kansio.", "Files" => "Tiedostot", +"All files" => "Kaikki tiedostot", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Kohdetta {filename} ei voi lähettää, koska se on joko kansio tai sen koko on 0 tavua", "Total file size {size1} exceeds upload limit {size2}" => "Yhteiskoko {size1} ylittää lähetysrajan {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Ei riittävästi vapaata tilaa. Lähetyksesi koko on {size1}, mutta vain {size2} on jäljellä", @@ -71,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 on rajoittamaton", "Maximum input size for ZIP files" => "ZIP-tiedostojen enimmäiskoko", "Save" => "Tallenna", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Käytä tätä osoitetta käyttääksesi tiedostojasi WebDAVin kautta", "New" => "Uusi", "New text file" => "Uusi tekstitiedosto", "Text file" => "Tekstitiedosto", "New folder" => "Uusi kansio", "Folder" => "Kansio", "From link" => "Linkistä", -"Deleted files" => "Poistetut tiedostot", "Cancel upload" => "Peru lähetys", "You don’t have permission to upload or create files here" => "Käyttöoikeutesi eivät riitä tiedostojen lähettämiseen tai kansioiden luomiseen tähän sijaintiin", "Nothing in here. Upload something!" => "Täällä ei ole mitään. Lähetä tänne jotakin!", @@ -86,6 +88,6 @@ $TRANSLATIONS = array( "Upload too large" => "Lähetettävä tiedosto on liian suuri", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Lähetettäväksi valitsemasi tiedostot ylittävät palvelimen salliman tiedostokoon rajan.", "Files are being scanned, please wait." => "Tiedostoja tarkistetaan, odota hetki.", -"Current scanning" => "Tämänhetkinen tutkinta" +"Currently scanning" => "Tutkitaan parhaillaan" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php index 3e61c782a5631bded7d7ee1bdb72d9e998619ef1..fcba687f4b474fb77a81f5b4001dd9ecdec667ae 100644 --- a/apps/files/l10n/fr.php +++ b/apps/files/l10n/fr.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "L'envoi a échoué. Impossible d'obtenir les informations du fichier.", "Invalid directory." => "Dossier invalide.", "Files" => "Fichiers", +"All files" => "Tous les fichiers", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossible d'envoyer {filename} car il s'agit d'un répertoire ou d'un fichier de taille nulle", "Total file size {size1} exceeds upload limit {size2}" => "La taille totale du fichier {size1} excède la taille maximale d'envoi {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Espace insuffisant : vous tentez d'envoyer {size1} mais seulement {size2} sont disponibles", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 est illimité", "Maximum input size for ZIP files" => "Taille maximale pour les fichiers ZIP", "Save" => "Sauvegarder", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utiliser cette adresse pour accéder à vos fichiers par WebDAV", "New" => "Nouveau", "New text file" => "Nouveau fichier texte", "Text file" => "Fichier texte", "New folder" => "Nouveau dossier", "Folder" => "Dossier", "From link" => "Depuis le lien", -"Deleted files" => "Fichiers supprimés", "Cancel upload" => "Annuler l'envoi", "You don’t have permission to upload or create files here" => "Vous n'avez pas la permission de téléverser ou de créer des fichiers ici", "Nothing in here. Upload something!" => "Il n'y a rien ici ! Envoyez donc quelque chose :)", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Téléversement trop volumineux", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Les fichiers que vous essayez d'envoyer dépassent la taille maximale permise par ce serveur.", "Files are being scanned, please wait." => "Les fichiers sont en cours d'analyse, veuillez patienter.", -"Current scanning" => "Analyse en cours" +"Currently scanning" => "Analyse en cours de traitement" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/gl.php b/apps/files/l10n/gl.php index 66d981c45430ad376fcdc9bcf09450511c76865b..611809e506c58d84923787c486fc1c275938d5ad 100644 --- a/apps/files/l10n/gl.php +++ b/apps/files/l10n/gl.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "O envío fracasou. Non foi posíbel obter información do ficheiro.", "Invalid directory." => "O directorio é incorrecto.", "Files" => "Ficheiros", +"All files" => "Todos os ficheiros", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Non é posíbel enviar {filename}, xa que ou é un directorio ou ten 0 bytes", "Total file size {size1} exceeds upload limit {size2}" => "O tamaño total do ficheiro {size1} excede do límite de envío {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Non hai espazo libre abondo, o seu envío é de {size1} mais só dispón de {size2}", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 significa ilimitado", "Maximum input size for ZIP files" => "Tamaño máximo de descarga para os ficheiros ZIP", "Save" => "Gardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Empregue esta ligazón para acceder aos seus ficheiros mediante WebDAV", "New" => "Novo", "New text file" => "Ficheiro novo de texto", "Text file" => "Ficheiro de texto", "New folder" => "Novo cartafol", "Folder" => "Cartafol", "From link" => "Desde a ligazón", -"Deleted files" => "Ficheiros eliminados", "Cancel upload" => "Cancelar o envío", "You don’t have permission to upload or create files here" => "Non ten permisos para enviar ou crear ficheiros aquí.", "Nothing in here. Upload something!" => "Aquí non hai nada. Envíe algo.", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Envío demasiado grande", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Os ficheiros que tenta enviar exceden do tamaño máximo permitido neste servidor", "Files are being scanned, please wait." => "Estanse analizando os ficheiros. Agarde.", -"Current scanning" => "Análise actual" +"Currently scanning" => "Análise actual" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/he.php b/apps/files/l10n/he.php index 7f155176546295843a074f1f8d861680af5055fe..56810eaabefe0e872a888777eb7a710ef0ad30d5 100644 --- a/apps/files/l10n/he.php +++ b/apps/files/l10n/he.php @@ -40,18 +40,17 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 - ללא הגבלה", "Maximum input size for ZIP files" => "גודל הקלט המרבי לקובצי ZIP", "Save" => "שמירה", +"WebDAV" => "WebDAV", "New" => "חדש", "Text file" => "קובץ טקסט", "Folder" => "תיקייה", "From link" => "מקישור", -"Deleted files" => "קבצים שנמחקו", "Cancel upload" => "ביטול ההעלאה", "Nothing in here. Upload something!" => "אין כאן שום דבר. אולי ברצונך להעלות משהו?", "Download" => "הורדה", "Delete" => "מחיקה", "Upload too large" => "העלאה גדולה מידי", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "הקבצים שניסית להעלות חרגו מהגודל המקסימלי להעלאת קבצים על שרת זה.", -"Files are being scanned, please wait." => "הקבצים נסרקים, נא להמתין.", -"Current scanning" => "הסריקה הנוכחית" +"Files are being scanned, please wait." => "הקבצים נסרקים, נא להמתין." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/hr.php b/apps/files/l10n/hr.php index 4e8deeed5131962f3646b897e1076f81c3ade21b..626a7d6a6e0cded1e98eeb6955edf90afeca707d 100644 --- a/apps/files/l10n/hr.php +++ b/apps/files/l10n/hr.php @@ -36,7 +36,6 @@ $TRANSLATIONS = array( "Delete" => "Obriši", "Upload too large" => "Prijenos je preobiman", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Datoteke koje pokušavate prenijeti prelaze maksimalnu veličinu za prijenos datoteka na ovom poslužitelju.", -"Files are being scanned, please wait." => "Datoteke se skeniraju, molimo pričekajte.", -"Current scanning" => "Trenutno skeniranje" +"Files are being scanned, please wait." => "Datoteke se skeniraju, molimo pričekajte." ); $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/l10n/hu_HU.php b/apps/files/l10n/hu_HU.php index 3cfb54726147845c03b6baf534ee82bae554ac17..02ca5866e2fde7fbece99be2fc77583e493902b6 100644 --- a/apps/files/l10n/hu_HU.php +++ b/apps/files/l10n/hu_HU.php @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 = korlátlan", "Maximum input size for ZIP files" => "ZIP-fájlok maximális kiindulási mérete", "Save" => "Mentés", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Ezt a címet használd, hogy hozzáférj a fileokhoz WebDAV-on keresztül", "New" => "Új", "New text file" => "Új szöveges file", "Text file" => "Szövegfájl", "New folder" => "Új mappa", "Folder" => "Mappa", "From link" => "Feltöltés linkről", -"Deleted files" => "Törölt fájlok", "Cancel upload" => "A feltöltés megszakítása", "You don’t have permission to upload or create files here" => "Önnek nincs jogosultsága ahhoz, hogy ide állományokat töltsön föl, vagy itt újakat hozzon létre", "Nothing in here. Upload something!" => "Itt nincs semmi. Töltsön fel valamit!", @@ -79,7 +80,6 @@ $TRANSLATIONS = array( "Delete" => "Törlés", "Upload too large" => "A feltöltés túl nagy", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "A feltöltendő állományok mérete meghaladja a kiszolgálón megengedett maximális méretet.", -"Files are being scanned, please wait." => "A fájllista ellenőrzése zajlik, kis türelmet!", -"Current scanning" => "Ellenőrzés alatt" +"Files are being scanned, please wait." => "A fájllista ellenőrzése zajlik, kis türelmet!" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/id.php b/apps/files/l10n/id.php index e4a2529e5ed629fbe917a5b30b21d9f84c3ca24c..67896a2a6ddf683f42455637bfceceab21101c0a 100644 --- a/apps/files/l10n/id.php +++ b/apps/files/l10n/id.php @@ -63,13 +63,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 berarti tidak terbatas", "Maximum input size for ZIP files" => "Ukuran masukan maksimum untuk berkas ZIP", "Save" => "Simpan", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Gunakan alamat ini untuk mengakses Berkas via WebDAV", "New" => "Baru", "New text file" => "Berkas teks baru", "Text file" => "Berkas teks", "New folder" => "Map baru", "Folder" => "Folder", "From link" => "Dari tautan", -"Deleted files" => "Berkas yang dihapus", "Cancel upload" => "Batal pengunggahan", "You don’t have permission to upload or create files here" => "Anda tidak memiliki akses untuk mengunggah atau membuat berkas disini", "Nothing in here. Upload something!" => "Tidak ada apa-apa di sini. Unggah sesuatu!", @@ -77,7 +78,6 @@ $TRANSLATIONS = array( "Delete" => "Hapus", "Upload too large" => "Yang diunggah terlalu besar", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Berkas yang dicoba untuk diunggah melebihi ukuran maksimum pengunggahan berkas di server ini.", -"Files are being scanned, please wait." => "Berkas sedang dipindai, silakan tunggu.", -"Current scanning" => "Yang sedang dipindai" +"Files are being scanned, please wait." => "Berkas sedang dipindai, silakan tunggu." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/is.php b/apps/files/l10n/is.php index 82b3db81d651f4859b5781ce62fa33d3be0861be..fef4df6ea1750d4ca0d534ef3551d36a0467b829 100644 --- a/apps/files/l10n/is.php +++ b/apps/files/l10n/is.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ótakmarkað", "Maximum input size for ZIP files" => "Hámarks inntaksstærð fyrir ZIP skrár", "Save" => "Vista", +"WebDAV" => "WebDAV", "New" => "Nýtt", "Text file" => "Texta skrá", "Folder" => "Mappa", @@ -45,7 +46,6 @@ $TRANSLATIONS = array( "Delete" => "Eyða", "Upload too large" => "Innsend skrá er of stór", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Skrárnar sem þú ert að senda inn eru stærri en hámarks innsendingarstærð á þessum netþjóni.", -"Files are being scanned, please wait." => "Verið er að skima skrár, vinsamlegast hinkraðu.", -"Current scanning" => "Er að skima" +"Files are being scanned, please wait." => "Verið er að skima skrár, vinsamlegast hinkraðu." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/it.php b/apps/files/l10n/it.php index d55c80091602ff8815f3d4aaf7dec6eba06896e2..e7bdf24e455c59bc18339d12a8306404e9659c57 100644 --- a/apps/files/l10n/it.php +++ b/apps/files/l10n/it.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Caricamento non riuscito. Impossibile ottenere informazioni sul file.", "Invalid directory." => "Cartella non valida.", "Files" => "File", +"All files" => "Tutti i file", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossibile caricare {filename} poiché è una cartella oppure ha una dimensione di 0 byte.", "Total file size {size1} exceeds upload limit {size2}" => "La dimensione totale del file {size1} supera il limite di caricamento {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Spazio insufficiente, stai caricando {size1}, ma è rimasto solo {size2}", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 è illimitato", "Maximum input size for ZIP files" => "Dimensione massima per i file ZIP", "Save" => "Salva", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utilizza questo indirizzo per accedere ai tuoi file con WebDAV", "New" => "Nuovo", "New text file" => "Nuovo file di testo", "Text file" => "File di testo", "New folder" => "Nuova cartella", "Folder" => "Cartella", "From link" => "Da collegamento", -"Deleted files" => "File eliminati", "Cancel upload" => "Annulla invio", "You don’t have permission to upload or create files here" => "Qui non hai i permessi di caricare o creare file", "Nothing in here. Upload something!" => "Non c'è niente qui. Carica qualcosa!", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Caricamento troppo grande", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "I file che stai provando a caricare superano la dimensione massima consentita su questo server.", "Files are being scanned, please wait." => "Scansione dei file in corso, attendi", -"Current scanning" => "Scansione corrente" +"Currently scanning" => "Scansione in corso" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ja.php b/apps/files/l10n/ja.php index 0b00594d71c4406316ae8f08e153f75c7b62e56e..c0e0468bafd69ce5365e1c967040507e81b322ee 100644 --- a/apps/files/l10n/ja.php +++ b/apps/files/l10n/ja.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "アップロードに失敗。ファイル情報を取得できませんでした。", "Invalid directory." => "無効なディレクトリです。", "Files" => "ファイル", +"All files" => "すべてのファイル", "Unable to upload {filename} as it is a directory or has 0 bytes" => "ディレクトリもしくは0バイトのため {filename} をアップロードできません", "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} しか残っていません。", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0を指定した場合は無制限", "Maximum input size for ZIP files" => "ZIPファイルでの最大入力サイズ", "Save" => "保存", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "WebDAV 経由でファイルにアクセス するにはこのアドレスを利用してください", "New" => "新規作成", "New text file" => "新規のテキストファイル作成", "Text file" => "テキストファイル", "New folder" => "新しいフォルダー", "Folder" => "フォルダー", "From link" => "リンク", -"Deleted files" => "ゴミ箱", "Cancel upload" => "アップロードをキャンセル", "You don’t have permission to upload or create files here" => "ここにファイルをアップロードもしくは作成する権限がありません", "Nothing in here. Upload something!" => "ここには何もありません。何かアップロードしてください。", @@ -86,7 +88,6 @@ $TRANSLATIONS = array( "Delete" => "削除", "Upload too large" => "アップロードには大きすぎます。", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "アップロードしようとしているファイルは、サーバーで規定された最大サイズを超えています。", -"Files are being scanned, please wait." => "ファイルをスキャンしています、しばらくお待ちください。", -"Current scanning" => "スキャン中" +"Files are being scanned, please wait." => "ファイルをスキャンしています、しばらくお待ちください。" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/ka_GE.php b/apps/files/l10n/ka_GE.php index d9f5244fa736df165fcb5aacfae014612ae9323e..82f3404cfe8a8db02b9994210186c176c1afa8a3 100644 --- a/apps/files/l10n/ka_GE.php +++ b/apps/files/l10n/ka_GE.php @@ -40,19 +40,18 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 is unlimited", "Maximum input size for ZIP files" => "ZIP ფაილების მაქსიმუმ დასაშვები ზომა", "Save" => "შენახვა", +"WebDAV" => "WebDAV", "New" => "ახალი", "Text file" => "ტექსტური ფაილი", "New folder" => "ახალი ფოლდერი", "Folder" => "საქაღალდე", "From link" => "მისამართიდან", -"Deleted files" => "წაშლილი ფაილები", "Cancel upload" => "ატვირთვის გაუქმება", "Nothing in here. Upload something!" => "აქ არაფერი არ არის. ატვირთე რამე!", "Download" => "ჩამოტვირთვა", "Delete" => "წაშლა", "Upload too large" => "ასატვირთი ფაილი ძალიან დიდია", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "ფაილის ზომა რომლის ატვირთვასაც თქვენ აპირებთ, აჭარბებს სერვერზე დაშვებულ მაქსიმუმს.", -"Files are being scanned, please wait." => "მიმდინარეობს ფაილების სკანირება, გთხოვთ დაელოდოთ.", -"Current scanning" => "მიმდინარე სკანირება" +"Files are being scanned, please wait." => "მიმდინარეობს ფაილების სკანირება, გთხოვთ დაელოდოთ." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/km.php b/apps/files/l10n/km.php index d6394241e1294605613b9c3246ef991a26fdf209..3cfb33854bc9c2b54c21726a5ef3a488b129e8f4 100644 --- a/apps/files/l10n/km.php +++ b/apps/files/l10n/km.php @@ -22,12 +22,12 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 គឺ​មិន​កំណត់", "Maximum input size for ZIP files" => "ទំហំ​ចូល​ជា​អតិបរមា​សម្រាប់​ឯកសារ ZIP", "Save" => "រក្សាទុក", +"WebDAV" => "WebDAV", "New" => "ថ្មី", "Text file" => "ឯកសារ​អក្សរ", "New folder" => "ថត​ថ្មី", "Folder" => "ថត", "From link" => "ពី​តំណ", -"Deleted files" => "បាន​លុប​ឯកសារ", "Cancel upload" => "បោះបង់​ការ​ផ្ទុកឡើង", "Nothing in here. Upload something!" => "គ្មាន​អ្វី​នៅ​ទីនេះ​ទេ។ ផ្ទុក​ឡើង​អ្វី​មួយ!", "Download" => "ទាញយក", diff --git a/apps/files/l10n/ko.php b/apps/files/l10n/ko.php index bfb69bb4445a85b4fa4777889449e4712aa2e42c..1caab50ecf21b376e16dc9c148834a2660985592 100644 --- a/apps/files/l10n/ko.php +++ b/apps/files/l10n/ko.php @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0은 무제한입니다", "Maximum input size for ZIP files" => "ZIP 파일 최대 크기", "Save" => "저장", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "WebDAV로 파일에 접근하려면 이 주소를 사용하십시오", "New" => "새로 만들기", "New text file" => "새 텍스트 파일", "Text file" => "텍스트 파일", "New folder" => "새 폴더", "Folder" => "폴더", "From link" => "링크에서", -"Deleted files" => "삭제된 파일", "Cancel upload" => "업로드 취소", "You don’t have permission to upload or create files here" => "여기에 파일을 업로드하거나 만들 권한이 없습니다", "Nothing in here. Upload something!" => "내용이 없습니다. 업로드할 수 있습니다!", @@ -79,7 +80,6 @@ $TRANSLATIONS = array( "Delete" => "삭제", "Upload too large" => "업로드한 파일이 너무 큼", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "이 파일이 서버에서 허용하는 최대 업로드 가능 용량보다 큽니다.", -"Files are being scanned, please wait." => "파일을 검색하고 있습니다. 기다려 주십시오.", -"Current scanning" => "현재 검색" +"Files are being scanned, please wait." => "파일을 검색하고 있습니다. 기다려 주십시오." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/lb.php b/apps/files/l10n/lb.php index b742be43c35e6ee90e92f4b414869306d1699c69..95efe7e1be72629d0b1e80d308e84383c7a1ee97 100644 --- a/apps/files/l10n/lb.php +++ b/apps/files/l10n/lb.php @@ -35,7 +35,6 @@ $TRANSLATIONS = array( "Delete" => "Läschen", "Upload too large" => "Upload ze grouss", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Déi Dateien déi Dir probéiert erop ze lueden sinn méi grouss wei déi Maximal Gréisst déi op dësem Server erlaabt ass.", -"Files are being scanned, please wait." => "Fichieren gi gescannt, war weg.", -"Current scanning" => "Momentane Scan" +"Files are being scanned, please wait." => "Fichieren gi gescannt, war weg." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php index b2055162d98458046420c40839056aaefca5c5b2..0204f7e80a8e94c3b5aa86697540e38699d6f154 100644 --- a/apps/files/l10n/lt_LT.php +++ b/apps/files/l10n/lt_LT.php @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 yra neribotas", "Maximum input size for ZIP files" => "Maksimalus ZIP archyvo failo dydis", "Save" => "Išsaugoti", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Naudokite šį adresą, kad pasiektumėte savo failus per WebDAV", "New" => "Naujas", "New text file" => "Naujas tekstinis failas", "Text file" => "Teksto failas", "New folder" => "Naujas aplankas", "Folder" => "Katalogas", "From link" => "Iš nuorodos", -"Deleted files" => "Ištrinti failai", "Cancel upload" => "Atšaukti siuntimą", "You don’t have permission to upload or create files here" => "Jūs neturite leidimo čia įkelti arba kurti failus", "Nothing in here. Upload something!" => "Čia tuščia. Įkelkite ką nors!", @@ -79,7 +80,6 @@ $TRANSLATIONS = array( "Delete" => "Ištrinti", "Upload too large" => "Įkėlimui failas per didelis", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Bandomų įkelti failų dydis viršija maksimalų, kuris leidžiamas šiame serveryje", -"Files are being scanned, please wait." => "Skenuojami failai, prašome palaukti.", -"Current scanning" => "Šiuo metu skenuojama" +"Files are being scanned, please wait." => "Skenuojami failai, prašome palaukti." ); $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/l10n/lv.php b/apps/files/l10n/lv.php index c5a9b9338a7494b606a715888b67f8227f26f1de..8eb939a2789efbf4379637c73a0143807a1003a0 100644 --- a/apps/files/l10n/lv.php +++ b/apps/files/l10n/lv.php @@ -44,19 +44,18 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 ir neierobežots", "Maximum input size for ZIP files" => "Maksimālais ievades izmērs ZIP datnēm", "Save" => "Saglabāt", +"WebDAV" => "WebDAV", "New" => "Jauna", "Text file" => "Teksta datne", "New folder" => "Jauna mape", "Folder" => "Mape", "From link" => "No saites", -"Deleted files" => "Dzēstās datnes", "Cancel upload" => "Atcelt augšupielādi", "Nothing in here. Upload something!" => "Te vēl nekas nav. Rīkojies, sāc augšupielādēt!", "Download" => "Lejupielādēt", "Delete" => "Dzēst", "Upload too large" => "Datne ir par lielu, lai to augšupielādētu", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Augšupielādējamās datnes pārsniedz servera pieļaujamo datņu augšupielādes apjomu", -"Files are being scanned, please wait." => "Datnes šobrīd tiek caurskatītas, lūdzu, uzgaidiet.", -"Current scanning" => "Šobrīd tiek caurskatīts" +"Files are being scanned, please wait." => "Datnes šobrīd tiek caurskatītas, lūdzu, uzgaidiet." ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"; diff --git a/apps/files/l10n/mk.php b/apps/files/l10n/mk.php index 4a1f16c7921af3a3c5c2485c6799cab65ec4391b..d006b2e8dde060e00f925a4ead3d17014e6ffa22 100644 --- a/apps/files/l10n/mk.php +++ b/apps/files/l10n/mk.php @@ -56,18 +56,17 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 е неограничено", "Maximum input size for ZIP files" => "Максимална големина за внес на ZIP датотеки", "Save" => "Сними", +"WebDAV" => "WebDAV", "New" => "Ново", "Text file" => "Текстуална датотека", "Folder" => "Папка", "From link" => "Од врска", -"Deleted files" => "Избришани датотеки", "Cancel upload" => "Откажи прикачување", "Nothing in here. Upload something!" => "Тука нема ништо. Снимете нешто!", "Download" => "Преземи", "Delete" => "Избриши", "Upload too large" => "Фајлот кој се вчитува е преголем", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Датотеките кои се обидувате да ги подигнете ја надминуваат максималната големина за подигнување датотеки на овој сервер.", -"Files are being scanned, please wait." => "Се скенираат датотеки, ве молам почекајте.", -"Current scanning" => "Моментално скенирам" +"Files are being scanned, please wait." => "Се скенираат датотеки, ве молам почекајте." ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php index 81d3de6299e4f8b87a56fcfcd03738b82897f8b1..e3fee81a15848790770393007a60e016356d2c46 100644 --- a/apps/files/l10n/ms_MY.php +++ b/apps/files/l10n/ms_MY.php @@ -36,7 +36,6 @@ $TRANSLATIONS = array( "Delete" => "Padam", "Upload too large" => "Muatnaik terlalu besar", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Fail yang cuba dimuat naik melebihi saiz maksimum fail upload server", -"Files are being scanned, please wait." => "Fail sedang diimbas, harap bersabar.", -"Current scanning" => "Imbasan semasa" +"Files are being scanned, please wait." => "Fail sedang diimbas, harap bersabar." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/nb_NO.php b/apps/files/l10n/nb_NO.php index 80b706dd5368d28c9516428d1ceaefd165069b73..2a423ae17d360f369cc8a688682b26b86f9c26a1 100644 --- a/apps/files/l10n/nb_NO.php +++ b/apps/files/l10n/nb_NO.php @@ -65,13 +65,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ubegrenset", "Maximum input size for ZIP files" => "Maksimal størrelse på ZIP-filer", "Save" => "Lagre", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Bruk denne adressen for å aksessere filene dine via WebDAV", "New" => "Ny", "New text file" => "Ny tekstfil", "Text file" => "Tekstfil", "New folder" => "Ny mappe", "Folder" => "Mappe", "From link" => "Fra link", -"Deleted files" => "Slettede filer", "Cancel upload" => "Avbryt opplasting", "You don’t have permission to upload or create files here" => "Du har ikke tillatelse til å laste opp eller opprette filer her", "Nothing in here. Upload something!" => "Ingenting her. Last opp noe!", @@ -79,7 +80,6 @@ $TRANSLATIONS = array( "Delete" => "Slett", "Upload too large" => "Filen er for stor", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Filene du prøver å laste opp er for store for å laste opp til denne serveren.", -"Files are being scanned, please wait." => "Skanner filer, vennligst vent.", -"Current scanning" => "Pågående skanning" +"Files are being scanned, please wait." => "Skanner filer, vennligst vent." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/nl.php b/apps/files/l10n/nl.php index 6bde1e612d0a738450cc7e21063a9c0477599d07..32415076f12a09d06edf736323b616a0c63fb03e 100644 --- a/apps/files/l10n/nl.php +++ b/apps/files/l10n/nl.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Upload mislukt, Kon geen bestandsinfo krijgen.", "Invalid directory." => "Ongeldige directory.", "Files" => "Bestanden", +"All files" => "Alle bestanden", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Kan {filename} niet uploaden omdat het een map is of 0 bytes groot is", "Total file size {size1} exceeds upload limit {size2}" => "Totale bestandsgrootte {size1} groter dan uploadlimiet {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Niet genoeg vrije ruimte. U upload {size1}, maar is is slechts {size2} beschikbaar", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 is ongelimiteerd", "Maximum input size for ZIP files" => "Maximale grootte voor ZIP bestanden", "Save" => "Bewaren", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Gebruik deze link om uw bestanden via WebDAV te benaderen", "New" => "Nieuw", "New text file" => "Nieuw tekstbestand", "Text file" => "Tekstbestand", "New folder" => "Nieuwe map", "Folder" => "Map", "From link" => "Vanaf link", -"Deleted files" => "Verwijderde bestanden", "Cancel upload" => "Upload afbreken", "You don’t have permission to upload or create files here" => "U hebt geen toestemming om hier te uploaden of bestanden te maken", "Nothing in here. Upload something!" => "Er bevindt zich hier niets. Upload een bestand!", @@ -86,7 +88,6 @@ $TRANSLATIONS = array( "Delete" => "Verwijder", "Upload too large" => "Upload is te groot", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "De bestanden die u probeert te uploaden zijn groter dan de maximaal toegestane bestandsgrootte voor deze server.", -"Files are being scanned, please wait." => "Bestanden worden gescand, even wachten.", -"Current scanning" => "Er wordt gescand" +"Files are being scanned, please wait." => "Bestanden worden gescand, even wachten." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/nn_NO.php b/apps/files/l10n/nn_NO.php index 238d1459b1adfe00b40595caa94e9144004faba4..3b40cc58f0d41eb2dfa1a1910e4dda6c4c831c41 100644 --- a/apps/files/l10n/nn_NO.php +++ b/apps/files/l10n/nn_NO.php @@ -50,19 +50,18 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 er ubegrensa", "Maximum input size for ZIP files" => "Maksimal storleik for ZIP-filer", "Save" => "Lagre", +"WebDAV" => "WebDAV", "New" => "Ny", "Text file" => "Tekst fil", "New folder" => "Ny mappe", "Folder" => "Mappe", "From link" => "Frå lenkje", -"Deleted files" => "Sletta filer", "Cancel upload" => "Avbryt opplasting", "Nothing in here. Upload something!" => "Ingenting her. Last noko opp!", "Download" => "Last ned", "Delete" => "Slett", "Upload too large" => "For stor opplasting", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Filene du prøver å lasta opp er større enn maksgrensa til denne tenaren.", -"Files are being scanned, please wait." => "Skannar filer, ver venleg og vent.", -"Current scanning" => "Køyrande skanning" +"Files are being scanned, please wait." => "Skannar filer, ver venleg og vent." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/oc.php b/apps/files/l10n/oc.php index 3683ae433a67515633b8faa225188ed59046d575..d72d496f29a065478970fcc4b83fcce9647ea2d9 100644 --- a/apps/files/l10n/oc.php +++ b/apps/files/l10n/oc.php @@ -36,7 +36,6 @@ $TRANSLATIONS = array( "Delete" => "Escafa", "Upload too large" => "Amontcargament tròp gròs", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los fichièrs que sias a amontcargar son tròp pesucs per la talha maxi pel servidor.", -"Files are being scanned, please wait." => "Los fiichièrs son a èsser explorats, ", -"Current scanning" => "Exploracion en cors" +"Files are being scanned, please wait." => "Los fiichièrs son a èsser explorats, " ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php index fa9c7911443bfad08cb8bd341dbea25624845b22..aaa1b18737cc4ceb4ff2de5effdd5a80f55e4f4b 100644 --- a/apps/files/l10n/pl.php +++ b/apps/files/l10n/pl.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Nieudane przesłanie. Nie można pobrać informacji o pliku.", "Invalid directory." => "Zła ścieżka.", "Files" => "Pliki", +"All files" => "Wszystkie pliki", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Nie można przesłać {filename} być może jest katalogiem lub posiada 0 bajtów", "Total file size {size1} exceeds upload limit {size2}" => "Całkowity rozmiar {size1} przekracza limit uploadu {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Brak wolnej przestrzeni, przesyłasz {size1} a pozostało tylko {size2}", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 - bez limitów", "Maximum input size for ZIP files" => "Maksymalna wielkość pliku wejściowego ZIP ", "Save" => "Zapisz", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Użyj tego adresu do dostępu do twoich plików przez WebDAV", "New" => "Nowy", "New text file" => "Nowy plik tekstowy", "Text file" => "Plik tekstowy", "New folder" => "Nowy folder", "Folder" => "Folder", "From link" => "Z odnośnika", -"Deleted files" => "Pliki usunięte", "Cancel upload" => "Anuluj wysyłanie", "You don’t have permission to upload or create files here" => "Nie masz uprawnień do wczytywania lub tworzenia plików w tym miejscu", "Nothing in here. Upload something!" => "Pusto. Wyślij coś!", @@ -87,6 +89,6 @@ $TRANSLATIONS = array( "Upload too large" => "Ładowany plik jest za duży", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Pliki, które próbujesz przesłać, przekraczają maksymalną dopuszczalną wielkość.", "Files are being scanned, please wait." => "Skanowanie plików, proszę czekać.", -"Current scanning" => "Aktualnie skanowane" +"Currently scanning" => "Aktualnie skanowane" ); $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/pt_BR.php b/apps/files/l10n/pt_BR.php index 5e0399bc4e2c3c35977570549aaf919f065816b4..3b3fedaeb12719deeb6adcf4d3ab7097bcdf36e4 100644 --- a/apps/files/l10n/pt_BR.php +++ b/apps/files/l10n/pt_BR.php @@ -1,6 +1,6 @@ "Impossível mover %s - Um arquivo com este nome já existe", +"Could not move %s - File with this name already exists" => "Impossível mover %s - Já existe um arquivo com esse nome", "Could not move %s" => "Impossível mover %s", "File name cannot be empty." => "O nome do arquivo não pode estar vazio.", "\"%s\" is an invalid file name." => "\"%s\" é um nome de arquivo inválido.", @@ -8,7 +8,7 @@ $TRANSLATIONS = array( "The target folder has been moved or deleted." => "A pasta de destino foi movida ou excluída.", "The name %s is already used in the folder %s. Please choose a different name." => "O nome %s já é usado na pasta %s. Por favor, escolha um nome diferente.", "Not a valid source" => "Não é uma fonte válida", -"Server is not allowed to open URLs, please check the server configuration" => "Não é permitido ao servidor abrir URLs, por favor verificar a configuração do servidor.", +"Server is not allowed to open URLs, please check the server configuration" => "O servidor não tem permissão para abrir URLs. Por favor, verifique a configuração do servidor.", "Error while downloading %s to %s" => "Erro ao baixar %s para %s", "Error when creating the file" => "Erro ao criar o arquivo", "Folder name cannot be empty." => "O nome da pasta não pode estar vazio.", @@ -28,8 +28,9 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Falha no envio. Não foi possível obter informações do arquivo.", "Invalid directory." => "Diretório inválido.", "Files" => "Arquivos", +"All files" => "Todos os arquivos", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Incapaz de fazer o envio de {filename}, pois é um diretório ou tem 0 bytes", -"Total file size {size1} exceeds upload limit {size2}" => "Tamanho total do arquivo {size1} excede limite de envio {size2}", +"Total file size {size1} exceeds upload limit {size2}" => "O tamanho total do arquivo {size1} excede o limite de envio {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Não há espaço suficiente, você está enviando {size1} mas resta apenas {size2}", "Upload cancelled." => "Envio cancelado.", "Could not get result from server." => "Não foi possível obter o resultado do servidor.", @@ -72,21 +73,22 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 para ilimitado", "Maximum input size for ZIP files" => "Tamanho máximo para arquivo ZIP", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Use este endereço para ter acesso aos seus Arquivos via WebDAV", "New" => "Novo", "New text file" => "Novo arquivo texto", "Text file" => "Arquivo texto", "New folder" => "Nova pasta", "Folder" => "Pasta", "From link" => "Do link", -"Deleted files" => "Arquivos apagados", "Cancel upload" => "Cancelar upload", "You don’t have permission to upload or create files here" => "Você não tem permissão para carregar ou criar arquivos aqui", -"Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!", +"Nothing in here. Upload something!" => "Nada aqui. Carrege alguma coisa!", "Download" => "Baixar", "Delete" => "Excluir", "Upload too large" => "Upload muito grande", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Os arquivos que você está tentando carregar excedeu o tamanho máximo para arquivos no servidor.", "Files are being scanned, please wait." => "Arquivos sendo escaneados, por favor aguarde.", -"Current scanning" => "Scanning atual" +"Currently scanning" => "Atualmente escaneando" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php index 2abe7c68536c8df5e99d79f814c78070617717e9..77fbbdd32249dff475d497964ddc5b7abc19375a 100644 --- a/apps/files/l10n/pt_PT.php +++ b/apps/files/l10n/pt_PT.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "O carregamento falhou. Não foi possível obter a informação do ficheiro.", "Invalid directory." => "Directório Inválido", "Files" => "Ficheiros", +"All files" => "Todos os ficheiros", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Incapaz de enviar {filename}, dado que é uma pasta, ou tem 0 bytes", "Total file size {size1} exceeds upload limit {size2}" => "O tamanho total do ficheiro {size1} excede o limite de carregamento {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Não existe espaço suficiente. Está a enviar {size1} mas apenas existe {size2} disponível", @@ -72,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 é ilimitado", "Maximum input size for ZIP files" => "Tamanho máximo para ficheiros ZIP", "Save" => "Guardar", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Utilize esta ligação para aceder aos seus ficheiros via WebDAV", "New" => "Novo", "New text file" => "Novo ficheiro de texto", "Text file" => "Ficheiro de texto", "New folder" => "Nova Pasta", "Folder" => "Pasta", "From link" => "Da ligação", -"Deleted files" => "Ficheiros eliminados", "Cancel upload" => "Cancelar envio", "You don’t have permission to upload or create files here" => "Você não tem permissão para enviar ou criar ficheiros aqui", "Nothing in here. Upload something!" => "Vazio. Envie alguma coisa!", @@ -86,7 +88,6 @@ $TRANSLATIONS = array( "Delete" => "Eliminar", "Upload too large" => "Upload muito grande", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Os ficheiro que está a tentar enviar excedem o tamanho máximo de envio neste servidor.", -"Files are being scanned, please wait." => "Os ficheiros estão a ser analisados, por favor aguarde.", -"Current scanning" => "Análise actual" +"Files are being scanned, please wait." => "Os ficheiros estão a ser analisados, por favor aguarde." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ro.php b/apps/files/l10n/ro.php index c36ba11fc0c5f6a01294c8de934b9baa085649a4..8bfde7b1f332c0b4c59bba4720d8a77166a4927d 100644 --- a/apps/files/l10n/ro.php +++ b/apps/files/l10n/ro.php @@ -72,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 este nelimitat", "Maximum input size for ZIP files" => "Dimensiunea maximă de intrare pentru fișierele ZIP", "Save" => "Salvează", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Folosește această adresă pentru acces la fișierele tale folosind WebDAV", "New" => "Nou", "New text file" => "Un nou fișier text", "Text file" => "Fișier text", "New folder" => "Un nou dosar", "Folder" => "Dosar", "From link" => "De la adresa", -"Deleted files" => "Fișiere șterse", "Cancel upload" => "Anulează încărcarea", "You don’t have permission to upload or create files here" => "Nu aveti permisiunea de a incarca sau crea fisiere aici", "Nothing in here. Upload something!" => "Nimic aici. Încarcă ceva!", @@ -86,7 +87,6 @@ $TRANSLATIONS = array( "Delete" => "Șterge", "Upload too large" => "Fișierul încărcat este prea mare", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Fișierele pe care încerci să le încarci depășesc limita de încărcare maximă admisă pe acest server.", -"Files are being scanned, please wait." => "Fișierele sunt scanate, te rog așteaptă.", -"Current scanning" => "În curs de scanare" +"Files are being scanned, please wait." => "Fișierele sunt scanate, te rog așteaptă." ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/apps/files/l10n/ru.php b/apps/files/l10n/ru.php index 181e063e6067d110efef1cb0f840a01100e6f31b..ccffdfdc0d71474a2ef52ca6974335201be59657 100644 --- a/apps/files/l10n/ru.php +++ b/apps/files/l10n/ru.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Загрузка не удалась. Невозможно получить информацию о файле", "Invalid directory." => "Неверный каталог.", "Files" => "Файлы", +"All files" => "Все файлы", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Невозможно загрузить {filename}, так как это либо каталог, либо файл нулевого размера", "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}", @@ -44,6 +45,7 @@ $TRANSLATIONS = array( "Rename" => "Переименовать", "Your download is being prepared. This might take some time if the files are big." => "Идёт подготовка к скачиванию. Это может занять некоторое время, если файлы большого размера.", "Pending" => "Ожидание", +"Error moving file." => "Ошибка перемещения файла.", "Error moving file" => "Ошибка при перемещении файла", "Error" => "Ошибка", "Could not rename file" => "Не удалось переименовать файл", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 - без ограничений", "Maximum input size for ZIP files" => "Максимальный исходный размер для ZIP файлов", "Save" => "Сохранить", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Используйте этот адресс для доступа к вашим файлам через WebDAV", "New" => "Новый", "New text file" => "Новый текстовый файл", "Text file" => "Текстовый файл", "New folder" => "Новый каталог", "Folder" => "Каталог", "From link" => "Объект по ссылке", -"Deleted files" => "Удалённые файлы", "Cancel upload" => "Отменить загрузку", "You don’t have permission to upload or create files here" => "У вас нет прав для загрузки или создания файлов здесь.", "Nothing in here. Upload something!" => "Здесь ничего нет. Загрузите что-нибудь!", @@ -85,7 +88,6 @@ $TRANSLATIONS = array( "Delete" => "Удалить", "Upload too large" => "Файл слишком велик", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файлы, которые вы пытаетесь загрузить, превышают лимит максимального размера на этом сервере.", -"Files are being scanned, please wait." => "Подождите, файлы сканируются.", -"Current scanning" => "Текущее сканирование" +"Files are being scanned, please wait." => "Подождите, файлы сканируются." ); $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/l10n/si_LK.php b/apps/files/l10n/si_LK.php index e8d2a8a53c8e8932cbc3adad2ee94c7ecab2abb4..59b720e710076274befb3b2c928cf437e80a11c9 100644 --- a/apps/files/l10n/si_LK.php +++ b/apps/files/l10n/si_LK.php @@ -37,7 +37,6 @@ $TRANSLATIONS = array( "Delete" => "මකා දමන්න", "Upload too large" => "උඩුගත කිරීම විශාල වැඩිය", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "ඔබ උඩුගත කිරීමට තැත් කරන ගොනු මෙම සේවාදායකයා උඩුගත කිරීමට ඉඩදී ඇති උපරිම ගොනු විශාලත්වයට වඩා වැඩිය", -"Files are being scanned, please wait." => "ගොනු පරික්ෂා කෙරේ. මඳක් රැඳී සිටින්න", -"Current scanning" => "වර්තමාන පරික්ෂාව" +"Files are being scanned, please wait." => "ගොනු පරික්ෂා කෙරේ. මඳක් රැඳී සිටින්න" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php index 66f1c616e4f2a5329b835c75ef8fc9750567335c..343e53e5acdfe15ef48dc97bbd811c2dbafb3ffc 100644 --- a/apps/files/l10n/sk_SK.php +++ b/apps/files/l10n/sk_SK.php @@ -71,13 +71,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 znamená neobmedzené", "Maximum input size for ZIP files" => "Najväčšia veľkosť ZIP súborov", "Save" => "Uložiť", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Použite túto linku pre prístup k vašim súborom cez WebDAV", "New" => "Nový", "New text file" => "Nový textový súbor", "Text file" => "Textový súbor", "New folder" => "Nový priečinok", "Folder" => "Priečinok", "From link" => "Z odkazu", -"Deleted files" => "Zmazané súbory", "Cancel upload" => "Zrušiť odosielanie", "You don’t have permission to upload or create files here" => "Nemáte oprávnenie sem nahrávať alebo vytvoriť súbory", "Nothing in here. Upload something!" => "Žiadny súbor. Nahrajte niečo!", @@ -85,7 +86,6 @@ $TRANSLATIONS = array( "Delete" => "Zmazať", "Upload too large" => "Nahrávanie je príliš veľké", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Súbory, ktoré sa snažíte nahrať, presahujú maximálnu veľkosť pre nahratie súborov na tento server.", -"Files are being scanned, please wait." => "Čakajte, súbory sú prehľadávané.", -"Current scanning" => "Práve prezerané" +"Files are being scanned, please wait." => "Čakajte, súbory sú prehľadávané." ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/apps/files/l10n/sl.php b/apps/files/l10n/sl.php index 90b18f632c3f5bac89dabaf952a9812cafe234ec..ca7590263e970178bdad11d0e6b0e4006f9a44d6 100644 --- a/apps/files/l10n/sl.php +++ b/apps/files/l10n/sl.php @@ -72,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 predstavlja neomejeno vrednost", "Maximum input size for ZIP files" => "Največja vhodna velikost za datoteke ZIP", "Save" => "Shrani", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Uporabite naslov za dostop do datotek rpeko sistema WebDAV.", "New" => "Novo", "New text file" => "Nova besedilna datoteka", "Text file" => "Besedilna datoteka", "New folder" => "Nova mapa", "Folder" => "Mapa", "From link" => "Iz povezave", -"Deleted files" => "Izbrisane datoteke", "Cancel upload" => "Prekliči pošiljanje", "You don’t have permission to upload or create files here" => "Ni ustreznih dovoljenj za pošiljanje ali ustvarjanje datotek na tem mestu.", "Nothing in here. Upload something!" => "Tukaj še ni ničesar. Najprej je treba kakšno datoteko poslati v oblak!", @@ -86,7 +87,6 @@ $TRANSLATIONS = array( "Delete" => "Izbriši", "Upload too large" => "Prekoračenje omejitve velikosti", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Datoteke, ki jih želite poslati, presegajo največjo dovoljeno velikost na strežniku.", -"Files are being scanned, please wait." => "Poteka preučevanje datotek, počakajte ...", -"Current scanning" => "Trenutno poteka preučevanje" +"Files are being scanned, please wait." => "Poteka preučevanje datotek, počakajte ..." ); $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/l10n/sq.php b/apps/files/l10n/sq.php index d246fdd6d64b997db3f368f26a09b81ef466d85e..d872dfc284b656386d9811639dbdda4ce5578be3 100644 --- a/apps/files/l10n/sq.php +++ b/apps/files/l10n/sq.php @@ -48,19 +48,18 @@ $TRANSLATIONS = array( "0 is unlimited" => "o është pa limit", "Maximum input size for ZIP files" => "Maksimumi hyrës i skedarëve ZIP", "Save" => "Ruaj", +"WebDAV" => "WebDAV", "New" => "E re", "Text file" => "Skedar tekst", "New folder" => "Dosje e're", "Folder" => "Dosje", "From link" => "Nga lidhja", -"Deleted files" => "Skedarë të fshirë ", "Cancel upload" => "Anullo ngarkimin", "Nothing in here. Upload something!" => "Këtu nuk ka asgje. Ngarko dicka", "Download" => "Shkarko", "Delete" => "Fshi", "Upload too large" => "Ngarkimi shumë i madh", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Skedarët që po mundoheni të ngarkoni e tejkalojnë madhësinë maksimale të lejuar nga serveri.", -"Files are being scanned, please wait." => "Skanerizimi i skedarit në proces. Ju lutem prisni.", -"Current scanning" => "Skanimi aktual" +"Files are being scanned, please wait." => "Skanerizimi i skedarit në proces. Ju lutem prisni." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/sr.php b/apps/files/l10n/sr.php index 4cb50b318c2e5b8d8318a1f9a32968045376e171..b58bc90c35b59843b039835d59f404d0c48f153a 100644 --- a/apps/files/l10n/sr.php +++ b/apps/files/l10n/sr.php @@ -40,18 +40,17 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 је неограничено", "Maximum input size for ZIP files" => "Највећа величина ZIP датотека", "Save" => "Сачувај", +"WebDAV" => "WebDAV", "New" => "Нова", "Text file" => "текстуална датотека", "Folder" => "фасцикла", "From link" => "Са везе", -"Deleted files" => "Обрисане датотеке", "Cancel upload" => "Прекини отпремање", "Nothing in here. Upload something!" => "Овде нема ничег. Отпремите нешто!", "Download" => "Преузми", "Delete" => "Обриши", "Upload too large" => "Датотека је превелика", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Датотеке које желите да отпремите прелазе ограничење у величини.", -"Files are being scanned, please wait." => "Скенирам датотеке…", -"Current scanning" => "Тренутно скенирање" +"Files are being scanned, please wait." => "Скенирам датотеке…" ); $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/l10n/sv.php b/apps/files/l10n/sv.php index 8908be66d3e45dd9baaf013c2bc8601096132944..57b207f9f3c4703d79abda92a33844312af12b44 100644 --- a/apps/files/l10n/sv.php +++ b/apps/files/l10n/sv.php @@ -28,6 +28,7 @@ $TRANSLATIONS = array( "Upload failed. Could not get file info." => "Uppladdning misslyckades. Gick inte att hämta filinformation.", "Invalid directory." => "Felaktig mapp.", "Files" => "Filer", +"All files" => "Alla filer", "Unable to upload {filename} as it is a directory or has 0 bytes" => "Kan inte ladda upp {filename} eftersom den antingen är en mapp eller har 0 bytes.", "Total file size {size1} exceeds upload limit {size2}" => "Totala filstorleken {size1} överskrider uppladdningsgränsen {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" => "Inte tillräckligt med ledigt utrymme, du laddar upp {size1} men endast {size2} finns kvar.", @@ -44,6 +45,7 @@ $TRANSLATIONS = array( "Rename" => "Byt namn", "Your download is being prepared. This might take some time if the files are big." => "Din nedladdning förbereds. Det kan ta tid om det är stora filer.", "Pending" => "Väntar", +"Error moving file." => "Fel vid flytt av fil.", "Error moving file" => "Fel uppstod vid flyttning av fil", "Error" => "Fel", "Could not rename file" => "Kan ej byta filnamn", @@ -71,13 +73,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 är oändligt", "Maximum input size for ZIP files" => "Största tillåtna storlek för ZIP-filer", "Save" => "Spara", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Använd denna adress till nå dina Filer via WebDAV", "New" => "Ny", "New text file" => "Ny textfil", "Text file" => "Textfil", "New folder" => "Ny mapp", "Folder" => "Mapp", "From link" => "Från länk", -"Deleted files" => "Raderade filer", "Cancel upload" => "Avbryt uppladdning", "You don’t have permission to upload or create files here" => "Du har ej tillåtelse att ladda upp eller skapa filer här", "Nothing in here. Upload something!" => "Ingenting här. Ladda upp något!", @@ -85,7 +88,6 @@ $TRANSLATIONS = array( "Delete" => "Radera", "Upload too large" => "För stor uppladdning", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Filerna du försöker ladda upp överstiger den maximala storleken för filöverföringar på servern.", -"Files are being scanned, please wait." => "Filer skannas, var god vänta", -"Current scanning" => "Aktuell skanning" +"Files are being scanned, please wait." => "Filer skannas, var god vänta" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/ta_LK.php b/apps/files/l10n/ta_LK.php index bba3ce994220ebd10661663e81da94f9c2dfddc4..dd7b55b58c6be1977c80a9438c61daf52f600a58 100644 --- a/apps/files/l10n/ta_LK.php +++ b/apps/files/l10n/ta_LK.php @@ -40,7 +40,6 @@ $TRANSLATIONS = array( "Delete" => "நீக்குக", "Upload too large" => "பதிவேற்றல் மிகப்பெரியது", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "நீங்கள் பதிவேற்ற முயற்சிக்கும் கோப்புகளானது இந்த சேவையகத்தில் கோப்பு பதிவேற்றக்கூடிய ஆகக்கூடிய அளவிலும் கூடியது.", -"Files are being scanned, please wait." => "கோப்புகள் வருடப்படுகின்றன, தயவுசெய்து காத்திருங்கள்.", -"Current scanning" => "தற்போது வருடப்படுபவை" +"Files are being scanned, please wait." => "கோப்புகள் வருடப்படுகின்றன, தயவுசெய்து காத்திருங்கள்." ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/th_TH.php b/apps/files/l10n/th_TH.php index 63714471104bbc39a64c49dbf8de360b2664a23a..15cf39b96cc94ca09380b72fe42f531690adb129 100644 --- a/apps/files/l10n/th_TH.php +++ b/apps/files/l10n/th_TH.php @@ -39,6 +39,7 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 หมายถึงไม่จำกัด", "Maximum input size for ZIP files" => "ขนาดไฟล์ ZIP สูงสุด", "Save" => "บันทึก", +"WebDAV" => "WebDAV", "New" => "อัพโหลดไฟล์ใหม่", "Text file" => "ไฟล์ข้อความ", "New folder" => "โฟลเดอร์ใหม่", @@ -50,7 +51,6 @@ $TRANSLATIONS = array( "Delete" => "ลบ", "Upload too large" => "ไฟล์ที่อัพโหลดมีขนาดใหญ่เกินไป", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "ไฟล์ที่คุณพยายามที่จะอัพโหลดมีขนาดเกินกว่าขนาดสูงสุดที่กำหนดไว้ให้อัพโหลดได้สำหรับเซิร์ฟเวอร์นี้", -"Files are being scanned, please wait." => "ไฟล์กำลังอยู่ระหว่างการสแกน, กรุณารอสักครู่.", -"Current scanning" => "ไฟล์ที่กำลังสแกนอยู่ขณะนี้" +"Files are being scanned, please wait." => "ไฟล์กำลังอยู่ระหว่างการสแกน, กรุณารอสักครู่." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php index a62e0f3eb66ed1dc5a5bbe863b8064624dfce779..775dc4b163718039942760e658fcf27ee4e0ca15 100644 --- a/apps/files/l10n/tr.php +++ b/apps/files/l10n/tr.php @@ -3,37 +3,38 @@ $TRANSLATIONS = array( "Could not move %s - File with this name already exists" => "%s taşınamadı. Bu isimde dosya zaten mevcut", "Could not move %s" => "%s taşınamadı", "File name cannot be empty." => "Dosya adı boş olamaz.", -"\"%s\" is an invalid file name." => "'%s' geçersiz bir dosya adı.", -"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Geçersiz isim, '\\', '/', '<', '>', ':', '\"', '|', '?' ve '*' karakterlerine izin verilmemektedir.", +"\"%s\" is an invalid file name." => "\"%s\" geçersiz bir dosya adı.", +"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Geçersiz isim. '\\', '/', '<', '>', ':', '\"', '|', '?' ve '*' karakterlerine izin verilmemektedir.", "The target folder has been moved or deleted." => "Hedef klasör taşındı veya silindi.", "The name %s is already used in the folder %s. Please choose a different name." => "%s ismi zaten %s klasöründe kullanılıyor. Lütfen farklı bir isim seçin.", "Not a valid source" => "Geçerli bir kaynak değil", -"Server is not allowed to open URLs, please check the server configuration" => "Sunucunun adresleri açma izi yok, lütfen sunucu yapılandırmasını denetleyin", +"Server is not allowed to open URLs, please check the server configuration" => "Sunucunun adresleri açma izni yok, lütfen sunucu yapılandırmasını denetleyin", "Error while downloading %s to %s" => "%s, %s içine indirilirken hata", "Error when creating the file" => "Dosya oluşturulurken hata", "Folder name cannot be empty." => "Klasör adı boş olamaz.", "Error when creating the folder" => "Klasör oluşturulurken hata", -"Unable to set upload directory." => "Yükleme dizini tanımlanamadı.", -"Invalid Token" => "Geçersiz Simge", +"Unable to set upload directory." => "Yükleme dizini ayarlanamadı.", +"Invalid Token" => "Geçersiz Belirteç", "No file was uploaded. Unknown error" => "Dosya yüklenmedi. Bilinmeyen hata", "There is no error, the file uploaded with success" => "Dosya başarıyla yüklendi, hata oluşmadı", -"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "php.ini dosyasında upload_max_filesize ile belirtilen dosya yükleme sınırı aşıldı.", +"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "php.ini dosyasında upload_max_filesize ile belirtilen dosya yükleme sınırı aşıldı:", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Yüklenecek dosyanın boyutu HTML formunda belirtilen MAX_FILE_SIZE limitini aşıyor", -"The uploaded file was only partially uploaded" => "Dosya kısmen karşıya yüklenebildi", +"The uploaded file was only partially uploaded" => "Dosya karşıya kısmen yüklenebildi", "No file was uploaded" => "Hiç dosya gönderilmedi", -"Missing a temporary folder" => "Geçici dizin eksik", +"Missing a temporary folder" => "Geçici bir dizin eksik", "Failed to write to disk" => "Diske yazılamadı", "Not enough storage available" => "Yeterli disk alanı yok", "Upload failed. Could not find uploaded file" => "Yükleme başarısız. Yüklenen dosya bulunamadı", "Upload failed. Could not get file info." => "Yükleme başarısız. Dosya bilgisi alınamadı.", "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", +"All files" => "Tüm dosyalar", +"Unable to upload {filename} as it is a directory or has 0 bytes" => "{filename} bir dizin veya 0 bayt olduğundan yüklenemedi", "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ı.", -"File upload is in progress. Leaving the page now will cancel the upload." => "Dosya yükleme işlemi sürüyor. Şimdi sayfadan ayrılırsanız işleminiz iptal olur.", +"File upload is in progress. Leaving the page now will cancel the upload." => "Dosya yükleme işlemi sürüyor. Şu anda sayfadan ayrılmak yükleme işlemini iptal edecek.", "URL cannot be empty" => "URL boş olamaz", "{new_name} already exists" => "{new_name} zaten mevcut", "Could not create file" => "Dosya oluşturulamadı", @@ -42,7 +43,7 @@ $TRANSLATIONS = array( "Share" => "Paylaş", "Delete permanently" => "Kalıcı olarak sil", "Rename" => "Yeniden adlandır", -"Your download is being prepared. This might take some time if the files are big." => "İndirmeniz hazırlanıyor. Dosya büyük ise biraz zaman alabilir.", +"Your download is being prepared. This might take some time if the files are big." => "İndirme hazırlanıyor. Dosyalar büyük ise bu biraz zaman alabilir.", "Pending" => "Bekliyor", "Error moving file." => "Dosya taşıma hatası.", "Error moving file" => "Dosya taşıma hatası", @@ -57,36 +58,37 @@ $TRANSLATIONS = array( "_Uploading %n file_::_Uploading %n files_" => array("%n dosya yükleniyor","%n dosya yükleniyor"), "\"{name}\" is an invalid file name." => "\"{name}\" geçersiz bir dosya adı.", "Your storage is full, files can not be updated or synced anymore!" => "Depolama alanınız dolu, artık dosyalar güncellenmeyecek veya eşitlenmeyecek.", -"Your storage is almost full ({usedSpacePercent}%)" => "Depolama alanınız neredeyse dolu ({usedSpacePercent}%)", +"Your storage is almost full ({usedSpacePercent}%)" => "Depolama alanınız neredeyse dolu (%{usedSpacePercent})", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Şifreleme Uygulaması etkin ancak anahtarlarınız başlatılmamış. Lütfen oturumu kapatıp yeniden açın", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Şifreleme Uygulaması için geçersiz özel anahtar. Lütfen şifreli dosyalarınıza erişimi tekrar kazanabilmek için kişisel ayarlarınızdan özel anahtar parolanızı güncelleyin.", -"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Şifreleme işlemi durduruldu ancak dosyalarınız şifreli. Dosyalarınızın şifresini kaldırmak için lütfen kişisel ayarlar kısmına geçin.", +"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Şifreleme işlemi durduruldu ancak dosyalarınız hala şifreli. Dosyalarınızın şifrelemesini kaldırmak için lütfen kişisel ayarlar kısmına geçin.", "{dirs} and {files}" => "{dirs} ve {files}", "%s could not be renamed" => "%s yeniden adlandırılamadı", "Upload (max. %s)" => "Yükle (azami: %s)", "File handling" => "Dosya işlemleri", -"Maximum upload size" => "Maksimum yükleme boyutu", +"Maximum upload size" => "Azami yükleme boyutu", "max. possible: " => "mümkün olan en fazla: ", "Needed for multi-file and folder downloads." => "Çoklu dosya ve dizin indirmesi için gerekli.", "Enable ZIP-download" => "ZIP indirmeyi etkinleştir", "0 is unlimited" => "0 limitsiz demektir", "Maximum input size for ZIP files" => "ZIP dosyaları için en fazla girdi boyutu", "Save" => "Kaydet", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "Dosyalarınıza WebDAV aracılığıyla erişmek için bu adresi kullanın", "New" => "Yeni", "New text file" => "Yeni metin dosyası", "Text file" => "Metin dosyası", "New folder" => "Yeni klasör", "Folder" => "Klasör", "From link" => "Bağlantıdan", -"Deleted files" => "Silinmiş dosyalar", "Cancel upload" => "Yüklemeyi iptal et", "You don’t have permission to upload or create files here" => "Buraya dosya yükleme veya oluşturma izniniz yok", "Nothing in here. Upload something!" => "Burada hiçbir şey yok. Bir şeyler yükleyin!", "Download" => "İndir", "Delete" => "Sil", "Upload too large" => "Yükleme çok büyük", -"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Yüklemeye çalıştığınız dosyalar bu sunucudaki maksimum yükleme boyutunu aşıyor.", +"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Yüklemeye çalıştığınız dosyalar bu sunucudaki azami yükleme boyutunu aşıyor.", "Files are being scanned, please wait." => "Dosyalar taranıyor, lütfen bekleyin.", -"Current scanning" => "Güncel tarama" +"Currently scanning" => "Şu anda taranan" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files/l10n/ug.php b/apps/files/l10n/ug.php index 446852368f30a76b3f015997151c4d9d903b262c..b104f60794763bede78f124e8aadd67ae0f131e4 100644 --- a/apps/files/l10n/ug.php +++ b/apps/files/l10n/ug.php @@ -22,11 +22,11 @@ $TRANSLATIONS = array( "_%n file_::_%n files_" => array(""), "_Uploading %n file_::_Uploading %n files_" => array(""), "Save" => "ساقلا", +"WebDAV" => "WebDAV", "New" => "يېڭى", "Text file" => "تېكىست ھۆججەت", "New folder" => "يېڭى قىسقۇچ", "Folder" => "قىسقۇچ", -"Deleted files" => "ئۆچۈرۈلگەن ھۆججەتلەر", "Cancel upload" => "يۈكلەشتىن ۋاز كەچ", "Nothing in here. Upload something!" => "بۇ جايدا ھېچنېمە يوق. Upload something!", "Download" => "چۈشۈر", diff --git a/apps/files/l10n/uk.php b/apps/files/l10n/uk.php index 8fb578016c75b8d02aba1206cf0307703b4dbaf1..a8657ea90056d8da9469735b9ad8ea2705f2dc38 100644 --- a/apps/files/l10n/uk.php +++ b/apps/files/l10n/uk.php @@ -48,19 +48,18 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 є безліміт", "Maximum input size for ZIP files" => "Максимальний розмір завантажуємого ZIP файлу", "Save" => "Зберегти", +"WebDAV" => "WebDAV", "New" => "Створити", "Text file" => "Текстовий файл", "New folder" => "Нова тека", "Folder" => "Тека", "From link" => "З посилання", -"Deleted files" => "Видалено файлів", "Cancel upload" => "Перервати завантаження", "Nothing in here. Upload something!" => "Тут нічого немає. Відвантажте що-небудь!", "Download" => "Завантажити", "Delete" => "Видалити", "Upload too large" => "Файл занадто великий", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файли,що ви намагаєтесь відвантажити перевищують максимальний дозволений розмір файлів на цьому сервері.", -"Files are being scanned, please wait." => "Файли скануються, зачекайте, будь-ласка.", -"Current scanning" => "Поточне сканування" +"Files are being scanned, please wait." => "Файли скануються, зачекайте, будь-ласка." ); $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/l10n/ur_PK.php b/apps/files/l10n/ur_PK.php index b9548acde92c17a83f69260c7f9bf7f50dc1cba1..7aa430d7ed594da136b9fe2c480160999842fded 100644 --- a/apps/files/l10n/ur_PK.php +++ b/apps/files/l10n/ur_PK.php @@ -1,8 +1,13 @@ "تقسیم", "Error" => "ایرر", +"Name" => "اسم", "_%n folder_::_%n folders_" => array("",""), "_%n file_::_%n files_" => array("",""), -"_Uploading %n file_::_Uploading %n files_" => array("","") +"_Uploading %n file_::_Uploading %n files_" => array("",""), +"Save" => "حفظ", +"Download" => "ڈاؤن لوڈ،", +"Delete" => "حذف کریں" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files/l10n/vi.php b/apps/files/l10n/vi.php index c14f1b7ea0984deff368e0441b50343299730d3a..f1b803a7e2673a1c8f87e9f777f71d517df6a4ae 100644 --- a/apps/files/l10n/vi.php +++ b/apps/files/l10n/vi.php @@ -63,13 +63,13 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 là không giới hạn", "Maximum input size for ZIP files" => "Kích thước tối đa cho các tập tin ZIP", "Save" => "Lưu", +"WebDAV" => "WebDAV", "New" => "Tạo mới", "New text file" => "File text mới", "Text file" => "Tập tin văn bản", "New folder" => "Tạo thư mục", "Folder" => "Thư mục", "From link" => "Từ liên kết", -"Deleted files" => "File đã bị xóa", "Cancel upload" => "Hủy upload", "You don’t have permission to upload or create files here" => "Bạn không có quyền upload hoặc tạo files ở đây", "Nothing in here. Upload something!" => "Không có gì ở đây .Hãy tải lên một cái gì đó !", @@ -77,7 +77,6 @@ $TRANSLATIONS = array( "Delete" => "Xóa", "Upload too large" => "Tập tin tải lên quá lớn", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Các tập tin bạn đang tải lên vượt quá kích thước tối đa cho phép trên máy chủ .", -"Files are being scanned, please wait." => "Tập tin đang được quét ,vui lòng chờ.", -"Current scanning" => "Hiện tại đang quét" +"Files are being scanned, please wait." => "Tập tin đang được quét ,vui lòng chờ." ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/zh_CN.php b/apps/files/l10n/zh_CN.php index 7f0183e9205a9f797c7f65bf9986ca81feae189c..ae444ee52bd7b98d13d5bd23a156367387d302f1 100644 --- a/apps/files/l10n/zh_CN.php +++ b/apps/files/l10n/zh_CN.php @@ -72,13 +72,14 @@ $TRANSLATIONS = array( "0 is unlimited" => "0 为无限制", "Maximum input size for ZIP files" => "ZIP 文件的最大输入大小", "Save" => "保存", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "使用这个地址 通过 WebDAV 访问您的文件", "New" => "新建", "New text file" => "创建文本文件", "Text file" => "文本文件", "New folder" => "添加文件夹", "Folder" => "文件夹", "From link" => "来自链接", -"Deleted files" => "已删除文件", "Cancel upload" => "取消上传", "You don’t have permission to upload or create files here" => "您没有权限来上传湖州哦和创建文件", "Nothing in here. Upload something!" => "这里还什么都没有。上传些东西吧!", @@ -86,7 +87,6 @@ $TRANSLATIONS = array( "Delete" => "删除", "Upload too large" => "上传文件过大", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "您正尝试上传的文件超过了此服务器可以上传的最大容量限制", -"Files are being scanned, please wait." => "文件正在被扫描,请稍候。", -"Current scanning" => "当前扫描" +"Files are being scanned, please wait." => "文件正在被扫描,请稍候。" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/l10n/zh_TW.php b/apps/files/l10n/zh_TW.php index 7b4caf592a088f90fe235767eec3284c9479953d..bfdeb6fe127812197aded491f8b808739ff35b24 100644 --- a/apps/files/l10n/zh_TW.php +++ b/apps/files/l10n/zh_TW.php @@ -62,12 +62,13 @@ $TRANSLATIONS = array( "0 is unlimited" => "0代表沒有限制", "Maximum input size for ZIP files" => "ZIP 壓縮前的原始大小限制", "Save" => "儲存", +"WebDAV" => "WebDAV", +"Use this address to access your Files via WebDAV" => "使用這個地址來透過 WebDAV 存取檔案", "New" => "新增", "Text file" => "文字檔", "New folder" => "新資料夾", "Folder" => "資料夾", "From link" => "從連結", -"Deleted files" => "回收桶", "Cancel upload" => "取消上傳", "You don’t have permission to upload or create files here" => "您沒有權限在這裡上傳或建立檔案", "Nothing in here. Upload something!" => "這裡還沒有東西,上傳一些吧!", @@ -75,7 +76,6 @@ $TRANSLATIONS = array( "Delete" => "刪除", "Upload too large" => "上傳過大", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "您試圖上傳的檔案大小超過伺服器的限制。", -"Files are being scanned, please wait." => "正在掃描檔案,請稍等。", -"Current scanning" => "正在掃描" +"Files are being scanned, please wait." => "正在掃描檔案,請稍等。" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php index ed4aa32c66246bb0058f1a76d94b6c7c392d6c4a..e32225d06805451ae98c85f8d2873182e5942a71 100644 --- a/apps/files/lib/app.php +++ b/apps/files/lib/app.php @@ -30,6 +30,11 @@ class App { */ private $l10n; + /** + * @var \OCP\INavigationManager + */ + private static $navigationManager; + /** * @var \OC\Files\View */ @@ -40,6 +45,18 @@ class App { $this->l10n = $l10n; } + /** + * Returns the app's navigation manager + * + * @return \OCP\INavigationManager + */ + public static function getNavigationManager() { + if (self::$navigationManager === null) { + self::$navigationManager = new \OC\NavigationManager(); + } + return self::$navigationManager; + } + /** * rename a file * diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 0ae87d12fbfb3974a90b47bd388dcc30ef096a5c..7d8906e22514b9f9383685519839a7a7682c2250 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -1,7 +1,16 @@ + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ namespace OCA\Files; +/** + * Helper class for manipulating file information + */ class Helper { public static function buildFileStorageStatistics($dir) { @@ -9,12 +18,12 @@ class Helper $storageInfo = \OC_Helper::getStorageInfo($dir); $l = new \OC_L10N('files'); - $maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']); - $maxHumanFilesize = \OCP\Util::humanFileSize($maxUploadFilesize); - $maxHumanFilesize = $l->t('Upload (max. %s)', array($maxHumanFilesize)); + $maxUploadFileSize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']); + $maxHumanFileSize = \OCP\Util::humanFileSize($maxUploadFileSize); + $maxHumanFileSize = $l->t('Upload (max. %s)', array($maxHumanFileSize)); - return array('uploadMaxFilesize' => $maxUploadFilesize, - 'maxHumanFilesize' => $maxHumanFilesize, + return array('uploadMaxFilesize' => $maxUploadFileSize, + 'maxHumanFilesize' => $maxHumanFileSize, 'freeSpace' => $storageInfo['free'], 'usedSpacePercent' => (int)$storageInfo['relative']); } @@ -27,20 +36,11 @@ class Helper */ public static function determineIcon($file) { if($file['type'] === 'dir') { - $dir = $file['directory']; $icon = \OC_Helper::mimetypeIcon('dir'); - $absPath = $file->getPath(); - $mount = \OC\Files\Filesystem::getMountManager()->find($absPath); - if (!is_null($mount)) { - $sid = $mount->getStorageId(); - if (!is_null($sid)) { - $sid = explode(':', $sid); - if ($sid[0] === 'shared') { - $icon = \OC_Helper::mimetypeIcon('dir-shared'); - } elseif ($sid[0] !== 'local' and $sid[0] !== 'home') { - $icon = \OC_Helper::mimetypeIcon('dir-external'); - } - } + if ($file->isShared()) { + $icon = \OC_Helper::mimetypeIcon('dir-shared'); + } elseif ($file->isMounted()) { + $icon = \OC_Helper::mimetypeIcon('dir-external'); } }else{ $icon = \OC_Helper::mimetypeIcon($file->getMimetype()); @@ -57,7 +57,7 @@ class Helper * @param \OCP\Files\FileInfo $b file * @return int -1 if $a must come before $b, 1 otherwise */ - public static function fileCmp($a, $b) { + public static function compareFileNames($a, $b) { $aType = $a->getType(); $bType = $b->getType(); if ($aType === 'dir' and $bType !== 'dir') { @@ -69,6 +69,32 @@ class Helper } } + /** + * Comparator function to sort files by date + * + * @param \OCP\Files\FileInfo $a file + * @param \OCP\Files\FileInfo $b file + * @return int -1 if $a must come before $b, 1 otherwise + */ + public static function compareTimestamp($a, $b) { + $aTime = $a->getMTime(); + $bTime = $b->getMTime(); + return $aTime - $bTime; + } + + /** + * Comparator function to sort files by size + * + * @param \OCP\Files\FileInfo $a file + * @param \OCP\Files\FileInfo $b file + * @return int -1 if $a must come before $b, 1 otherwise + */ + public static function compareSize($a, $b) { + $aSize = $a->getSize(); + $bSize = $b->getSize(); + return $aSize - $bSize; + } + /** * Formats the file info to be returned as JSON to the client. * @@ -120,12 +146,35 @@ class Helper * returns it as a sorted array of FileInfo. * * @param string $dir path to the directory + * @param string $sortAttribute attribute to sort on + * @param bool $sortDescending true for descending sort, false otherwise * @return \OCP\Files\FileInfo[] files */ - public static function getFiles($dir) { + public static function getFiles($dir, $sortAttribute = 'name', $sortDescending = false) { $content = \OC\Files\Filesystem::getDirectoryContent($dir); - usort($content, array('\OCA\Files\Helper', 'fileCmp')); - return $content; + return self::sortFiles($content, $sortAttribute, $sortDescending); + } + + /** + * Sort the given file info array + * + * @param \OCP\Files\FileInfo[] $files files to sort + * @param string $sortAttribute attribute to sort on + * @param bool $sortDescending true for descending sort, false otherwise + * @return \OCP\Files\FileInfo[] sorted files + */ + public static function sortFiles($files, $sortAttribute = 'name', $sortDescending = false) { + $sortFunc = 'compareFileNames'; + if ($sortAttribute === 'mtime') { + $sortFunc = 'compareTimestamp'; + } else if ($sortAttribute === 'size') { + $sortFunc = 'compareSize'; + } + usort($files, array('\OCA\Files\Helper', $sortFunc)); + if ($sortDescending) { + $files = array_reverse($files); + } + return $files; } } diff --git a/apps/files/list.php b/apps/files/list.php new file mode 100644 index 0000000000000000000000000000000000000000..e583839b2519449f3e1e366ec1b98fd18da8cec7 --- /dev/null +++ b/apps/files/list.php @@ -0,0 +1,38 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see . + * + */ + +// Check if we are a user +OCP\User::checkLoggedIn(); + +$config = \OC::$server->getConfig(); +// TODO: move this to the generated config.js +$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes'); +$uploadLimit=OCP\Util::uploadLimit(); + +// renders the controls and table headers template +$tmpl = new OCP\Template('files', 'list', ''); +$tmpl->assign('uploadLimit', $uploadLimit); // PHP upload limit +$tmpl->assign('publicUploadEnabled', $publicUploadEnabled); +$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); +$tmpl->printPage(); + diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php new file mode 100644 index 0000000000000000000000000000000000000000..86436bbe8c4733398c0bf809a610a04a941286fe --- /dev/null +++ b/apps/files/templates/appnavigation.php @@ -0,0 +1,17 @@ +
+
    + + + +
+
+
+ +
+
+

t('WebDAV'));?>

+
+ t('Use this address to access your Files via WebDAV', array(link_to_docs('user-webdav'))));?> +
+
+
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 42263c880a7b530ccfa78d12e8a5410dcd81c830..8cab4ce220b864523a5b898fb98383574aa7b306 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -1,117 +1,15 @@ -
- -
- - -
- - - - - - - - - - - - - - - - - -
-
-
-

- t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?> -

-
-
-

- t('Files are being scanned, please wait.'));?> -

-

- t('Current scanning'));?> -

-
+ +printPage(); ?> +
+ + + +
- diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php new file mode 100644 index 0000000000000000000000000000000000000000..17bf3b3de837e4d8df0727970dd558dd936b902a --- /dev/null +++ b/apps/files/templates/list.php @@ -0,0 +1,107 @@ +
+ +
+ + +
+ + + + + + + + + + + + + + + +
+ + +
+
+

+ t('The files you are trying to upload exceed the maximum size for file uploads on this server.'));?> +

+
+
+

+ t('Files are being scanned, please wait.'));?> +

+

+ t('Currently scanning'));?> +

+
diff --git a/apps/files/tests/ajax_rename.php b/apps/files/tests/ajax_rename.php index 74ca1e4495da1409742df4fb142ba2eacc54ad5b..9928053e5015ac0861f604e5a84cd76b1c771e97 100644 --- a/apps/files/tests/ajax_rename.php +++ b/apps/files/tests/ajax_rename.php @@ -24,6 +24,16 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { private static $user; + /** + * @var PHPUnit_Framework_MockObject_MockObject + */ + private $viewMock; + + /** + * @var \OCA\Files\App + */ + private $files; + function setUp() { // mock OC_L10n if (!self::$user) { @@ -56,7 +66,7 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { } /** - * @brief test rename of file/folder + * test rename of file/folder */ function testRenameFolder() { $dir = '/'; @@ -72,7 +82,7 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { ->method('getFileInfo') ->will($this->returnValue(new \OC\Files\FileInfo( '/', - null, + new \OC\Files\Storage\Local(array('datadir' => '/')), '/', array( 'fileid' => 123, diff --git a/apps/files/tests/helper.php b/apps/files/tests/helper.php new file mode 100644 index 0000000000000000000000000000000000000000..9b3603cd5633197d272898ac71d0744ddeb2ffcb --- /dev/null +++ b/apps/files/tests/helper.php @@ -0,0 +1,98 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +require_once __DIR__ . '/../lib/helper.php'; + +use OCA\Files; + +/** + * Class Test_Files_Helper + */ +class Test_Files_Helper extends \PHPUnit_Framework_TestCase { + + private function makeFileInfo($name, $size, $mtime, $isDir = false) { + return new \OC\Files\FileInfo( + '/', + null, + '/', + array( + 'name' => $name, + 'size' => $size, + 'mtime' => $mtime, + 'type' => $isDir ? 'dir' : 'file', + 'mimetype' => $isDir ? 'httpd/unix-directory' : 'application/octet-stream' + ) + ); + } + + /** + * Returns a file list for testing + */ + private function getTestFileList() { + return array( + self::makeFileInfo('a.txt', 4, 1000), + self::makeFileInfo('q.txt', 5, 150), + self::makeFileInfo('subdir2', 87, 128, true), + self::makeFileInfo('b.txt', 166, 800), + self::makeFileInfo('o.txt', 12, 100), + self::makeFileInfo('subdir', 88, 125, true), + ); + } + + function sortDataProvider() { + return array( + array( + 'name', + false, + array('subdir', 'subdir2', 'a.txt', 'b.txt', 'o.txt', 'q.txt'), + ), + array( + 'name', + true, + array('q.txt', 'o.txt', 'b.txt', 'a.txt', 'subdir2', 'subdir'), + ), + array( + 'size', + false, + array('a.txt', 'q.txt', 'o.txt', 'subdir2', 'subdir', 'b.txt'), + ), + array( + 'size', + true, + array('b.txt', 'subdir', 'subdir2', 'o.txt', 'q.txt', 'a.txt'), + ), + array( + 'mtime', + false, + array('o.txt', 'subdir', 'subdir2', 'q.txt', 'b.txt', 'a.txt'), + ), + array( + 'mtime', + true, + array('a.txt', 'b.txt', 'q.txt', 'subdir2', 'subdir', 'o.txt'), + ), + ); + } + + /** + * @dataProvider sortDataProvider + */ + public function testSortByName($sort, $sortDescending, $expectedOrder) { + $files = self::getTestFileList(); + $files = \OCA\Files\Helper::sortFiles($files, $sort, $sortDescending); + $fileNames = array(); + foreach ($files as $fileInfo) { + $fileNames[] = $fileInfo->getName(); + } + $this->assertEquals( + $expectedOrder, + $fileNames + ); + } + +} diff --git a/apps/files/tests/js/appSpec.js b/apps/files/tests/js/appSpec.js new file mode 100644 index 0000000000000000000000000000000000000000..0e9abad6989c9c84b04e82a532aaeee309bcd103 --- /dev/null +++ b/apps/files/tests/js/appSpec.js @@ -0,0 +1,220 @@ +/** +* ownCloud +* +* @author Vincent Petry +* @copyright 2014 Vincent Petry +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* +*/ + +describe('OCA.Files.App tests', function() { + var App = OCA.Files.App; + var pushStateStub; + var parseUrlQueryStub; + + beforeEach(function() { + $('#testArea').append( + '
' + + '
' + + '
' + + '
' + + '' + + '' + + '
' + + '
' + + '' + ); + + pushStateStub = sinon.stub(OC.Util.History, 'pushState'); + parseUrlQueryStub = sinon.stub(OC.Util.History, 'parseUrlQuery'); + parseUrlQueryStub.returns({}); + + App.initialize(); + }); + afterEach(function() { + App.navigation = null; + App.fileList = null; + App.files = null; + App.fileActions.clear(); + App.fileActions = null; + + pushStateStub.restore(); + parseUrlQueryStub.restore(); + }); + + describe('initialization', function() { + it('initializes the default file list with the default file actions', function() { + expect(App.fileList).toBeDefined(); + expect(App.fileList.fileActions.actions.all).toBeDefined(); + expect(App.fileList.$el.is('#app-content-files')).toEqual(true); + }); + }); + + describe('URL handling', function() { + it('pushes the state to the URL when current app changed directory', function() { + $('#app-content-files').trigger(new $.Event('changeDirectory', {dir: 'subdir'})); + expect(pushStateStub.calledOnce).toEqual(true); + expect(pushStateStub.getCall(0).args[0].dir).toEqual('subdir'); + expect(pushStateStub.getCall(0).args[0].view).not.toBeDefined(); + + $('li[data-id=other]>a').click(); + pushStateStub.reset(); + + $('#app-content-other').trigger(new $.Event('changeDirectory', {dir: 'subdir'})); + expect(pushStateStub.calledOnce).toEqual(true); + expect(pushStateStub.getCall(0).args[0].dir).toEqual('subdir'); + expect(pushStateStub.getCall(0).args[0].view).toEqual('other'); + }); + describe('onpopstate', function() { + it('sends "urlChanged" event to current app', function() { + var handler = sinon.stub(); + $('#app-content-files').on('urlChanged', handler); + App._onPopState({view: 'files', dir: '/somedir'}); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('files'); + expect(handler.getCall(0).args[0].dir).toEqual('/somedir'); + }); + it('sends "show" event to current app and sets navigation', function() { + var showHandlerFiles = sinon.stub(); + var showHandlerOther = sinon.stub(); + var hideHandlerFiles = sinon.stub(); + var hideHandlerOther = sinon.stub(); + $('#app-content-files').on('show', showHandlerFiles); + $('#app-content-files').on('hide', hideHandlerFiles); + $('#app-content-other').on('show', showHandlerOther); + $('#app-content-other').on('hide', hideHandlerOther); + App._onPopState({view: 'other', dir: '/somedir'}); + expect(showHandlerFiles.notCalled).toEqual(true); + expect(hideHandlerFiles.calledOnce).toEqual(true); + expect(showHandlerOther.calledOnce).toEqual(true); + expect(hideHandlerOther.notCalled).toEqual(true); + + showHandlerFiles.reset(); + showHandlerOther.reset(); + hideHandlerFiles.reset(); + hideHandlerOther.reset(); + + App._onPopState({view: 'files', dir: '/somedir'}); + expect(showHandlerFiles.calledOnce).toEqual(true); + expect(hideHandlerFiles.notCalled).toEqual(true); + expect(showHandlerOther.notCalled).toEqual(true); + expect(hideHandlerOther.calledOnce).toEqual(true); + + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + expect($('#app-content-other').hasClass('hidden')).toEqual(true); + }); + it('does not send "show" or "hide" event to current app when already visible', function() { + var showHandler = sinon.stub(); + var hideHandler = sinon.stub(); + $('#app-content-files').on('show', showHandler); + $('#app-content-files').on('hide', hideHandler); + App._onPopState({view: 'files', dir: '/somedir'}); + expect(showHandler.notCalled).toEqual(true); + expect(hideHandler.notCalled).toEqual(true); + }); + it('state defaults to files app with root dir', function() { + var handler = sinon.stub(); + parseUrlQueryStub.returns({}); + $('#app-content-files').on('urlChanged', handler); + App._onPopState(); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('files'); + expect(handler.getCall(0).args[0].dir).toEqual('/'); + }); + it('activates files app if invalid view is passed', function() { + App._onPopState({view: 'invalid', dir: '/somedir'}); + + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + }); + }); + describe('navigation', function() { + it('switches the navigation item and panel visibility when onpopstate', function() { + App._onPopState({view: 'other', dir: '/somedir'}); + expect(App.navigation.getActiveItem()).toEqual('other'); + expect($('#app-content-files').hasClass('hidden')).toEqual(true); + expect($('#app-content-other').hasClass('hidden')).toEqual(false); + expect($('li[data-id=files]').hasClass('selected')).toEqual(false); + expect($('li[data-id=other]').hasClass('selected')).toEqual(true); + + App._onPopState({view: 'files', dir: '/somedir'}); + + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + expect($('#app-content-other').hasClass('hidden')).toEqual(true); + expect($('li[data-id=files]').hasClass('selected')).toEqual(true); + expect($('li[data-id=other]').hasClass('selected')).toEqual(false); + }); + it('clicking on navigation switches the panel visibility', function() { + $('li[data-id=other]>a').click(); + expect(App.navigation.getActiveItem()).toEqual('other'); + expect($('#app-content-files').hasClass('hidden')).toEqual(true); + expect($('#app-content-other').hasClass('hidden')).toEqual(false); + expect($('li[data-id=files]').hasClass('selected')).toEqual(false); + expect($('li[data-id=other]').hasClass('selected')).toEqual(true); + + $('li[data-id=files]>a').click(); + expect(App.navigation.getActiveItem()).toEqual('files'); + expect($('#app-content-files').hasClass('hidden')).toEqual(false); + expect($('#app-content-other').hasClass('hidden')).toEqual(true); + expect($('li[data-id=files]').hasClass('selected')).toEqual(true); + expect($('li[data-id=other]').hasClass('selected')).toEqual(false); + }); + it('clicking on navigation sends "show" and "urlChanged" event', function() { + var handler = sinon.stub(); + var showHandler = sinon.stub(); + $('#app-content-other').on('urlChanged', handler); + $('#app-content-other').on('show', showHandler); + $('li[data-id=other]>a').click(); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('other'); + expect(handler.getCall(0).args[0].dir).toEqual('/'); + expect(showHandler.calledOnce).toEqual(true); + }); + it('clicking on activate navigation only sends "urlChanged" event', function() { + var handler = sinon.stub(); + var showHandler = sinon.stub(); + $('#app-content-files').on('urlChanged', handler); + $('#app-content-files').on('show', showHandler); + $('li[data-id=files]>a').click(); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].view).toEqual('files'); + expect(handler.getCall(0).args[0].dir).toEqual('/'); + expect(showHandler.notCalled).toEqual(true); + }); + }); + describe('viewer mode', function() { + it('toggles the sidebar when viewer mode is enabled', function() { + $('#app-content-files').trigger( + new $.Event('changeViewerMode', {viewerModeEnabled: true} + )); + expect($('#app-navigation').hasClass('hidden')).toEqual(true); + expect($('.app-files').hasClass('viewer-mode no-sidebar')).toEqual(true); + + $('#app-content-files').trigger( + new $.Event('changeViewerMode', {viewerModeEnabled: false} + )); + + expect($('#app-navigation').hasClass('hidden')).toEqual(false); + expect($('.app-files').hasClass('viewer-mode no-sidebar')).toEqual(false); + }); + }); + }); +}); diff --git a/apps/files/tests/js/breadcrumbSpec.js b/apps/files/tests/js/breadcrumbSpec.js index 1bfe5308a278c0dcabfcff3a9661ec14c01b47fc..e3d9c757a7c0a1e01031b2ed6b28f56aefd448b4 100644 --- a/apps/files/tests/js/breadcrumbSpec.js +++ b/apps/files/tests/js/breadcrumbSpec.js @@ -20,7 +20,9 @@ */ /* global BreadCrumb */ -describe('BreadCrumb tests', function() { +describe('OCA.Files.BreadCrumb tests', function() { + var BreadCrumb = OCA.Files.BreadCrumb; + describe('Rendering', function() { var bc; beforeEach(function() { diff --git a/apps/files/tests/js/fileactionsSpec.js b/apps/files/tests/js/fileactionsSpec.js index f5eafba509f6d5ed8925aa5831ddc1012367582a..9152dbb58c30a6961f3265698f95d7d70b53827e 100644 --- a/apps/files/tests/js/fileactionsSpec.js +++ b/apps/files/tests/js/fileactionsSpec.js @@ -19,35 +19,45 @@ * */ -/* global OC, FileActions, FileList */ -describe('FileActions tests', function() { - var $filesTable; +describe('OCA.Files.FileActions tests', function() { + var $filesTable, fileList; + var FileActions = OCA.Files.FileActions; beforeEach(function() { // init horrible parameters - var $body = $('body'); + var $body = $('#testArea'); $body.append(''); $body.append(''); // dummy files table $filesTable = $body.append('
'); - FileList.files = []; + fileList = new OCA.Files.FileList($('#testArea')); + FileActions.registerDefaultActions(fileList); }); afterEach(function() { + FileActions.clear(); + fileList = undefined; $('#dir, #permissions, #filestable').remove(); }); + it('calling clear() clears file actions', function() { + FileActions.clear(); + expect(FileActions.actions).toEqual({}); + expect(FileActions.defaults).toEqual({}); + expect(FileActions.icons).toEqual({}); + expect(FileActions.currentFile).toBe(null); + }); it('calling display() sets file actions', function() { var fileData = { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; // note: FileActions.display() is called implicitly - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); // actions defined after call expect($tr.find('.action.action-download').length).toEqual(1); @@ -61,12 +71,12 @@ describe('FileActions tests', function() { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); FileActions.display($tr.find('td.filename'), true); FileActions.display($tr.find('td.filename'), true); @@ -82,12 +92,12 @@ describe('FileActions tests', function() { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); FileActions.display($tr.find('td.filename'), true); $tr.find('.action-download').click(); @@ -97,17 +107,17 @@ describe('FileActions tests', function() { redirectStub.restore(); }); it('deletes file when clicking delete', function() { - var deleteStub = sinon.stub(FileList, 'do_delete'); + var deleteStub = sinon.stub(fileList, 'do_delete'); var fileData = { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); FileActions.display($tr.find('td.filename'), true); $tr.find('.action.delete').click(); diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 7a2b56d559a00edcf6b5fdf3e26cd5ce98875287..a3dc5b255a15d142abd62416b337108a3f796bf8 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -19,10 +19,9 @@ * */ -/* global OC, FileList */ -describe('FileList tests', function() { - var testFiles, alertStub, notificationStub, - pushStateStub; +describe('OCA.Files.FileList tests', function() { + var testFiles, alertStub, notificationStub, fileList; + var FileActions = OCA.Files.FileActions; /** * Generate test file data @@ -52,21 +51,13 @@ describe('FileList tests', function() { } beforeEach(function() { - // init horrible parameters - var $body = $('body'); - $body.append(''); - $body.append(''); - // dummy files table - $body.append('
'); - - // prevents URL changes during tests - pushStateStub = sinon.stub(window.history, 'pushState'); - alertStub = sinon.stub(OC.dialogs, 'alert'); notificationStub = sinon.stub(OC.Notification, 'show'); // init parameters and test table elements $('#testArea').append( + '
' + + // init horrible parameters '' + '' + // dummy controls @@ -75,19 +66,24 @@ describe('FileList tests', function() { '
' + '
' + // dummy table - // TODO: at some point this will be rendered by the FileList class itself! + // TODO: at some point this will be rendered by the fileList class itself! '' + - '' + + '' + - '' + + '' + + '' + + '' + + '' + + '' + '' + '
' + - '
Empty content message
' + '
Empty content message
' + + '' ); testFiles = [{ @@ -120,27 +116,27 @@ describe('FileList tests', function() { etag: '456' }]; - FileList.initialize(); + fileList = new OCA.Files.FileList($('#app-content-files')); + FileActions.clear(); + FileActions.registerDefaultActions(fileList); + fileList.setFileActions(FileActions); }); afterEach(function() { testFiles = undefined; - FileList.initialized = false; - FileList.isEmpty = true; - delete FileList._reloadCall; + fileList = undefined; - $('#dir, #permissions, #filestable').remove(); + FileActions.clear(); notificationStub.restore(); alertStub.restore(); - pushStateStub.restore(); }); describe('Getters', function() { it('Returns the current directory', function() { $('#dir').val('/one/two/three'); - expect(FileList.getCurrentDirectory()).toEqual('/one/two/three'); + expect(fileList.getCurrentDirectory()).toEqual('/one/two/three'); }); it('Returns the directory permissions as int', function() { $('#permissions').val('23'); - expect(FileList.getDirectoryPermissions()).toEqual(23); + expect(fileList.getDirectoryPermissions()).toEqual(23); }); }); describe('Adding files', function() { @@ -158,12 +154,12 @@ describe('FileList tests', function() { id: 18, type: 'file', name: 'testName.txt', - mimetype: 'plain/text', + mimetype: 'text/plain', size: '1234', etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -173,12 +169,14 @@ describe('FileList tests', function() { expect($tr.attr('data-size')).toEqual('1234'); expect($tr.attr('data-etag')).toEqual('a01234c'); expect($tr.attr('data-permissions')).toEqual('31'); - expect($tr.attr('data-mime')).toEqual('plain/text'); + expect($tr.attr('data-mime')).toEqual('text/plain'); expect($tr.attr('data-mtime')).toEqual('123456'); - expect($tr.find('a.name').attr('href')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=testName.txt'); + expect($tr.find('a.name').attr('href')) + .toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=testName.txt'); + expect($tr.find('.nametext').text().trim()).toEqual('testName.txt'); expect($tr.find('.filesize').text()).toEqual('1 kB'); - expect(FileList.findFileEl('testName.txt')[0]).toEqual($tr[0]); + expect(fileList.findFileEl('testName.txt')[0]).toEqual($tr[0]); }); it('generates dir element with correct attributes when calling add() with dir data', function() { var fileData = { @@ -190,7 +188,7 @@ describe('FileList tests', function() { etag: 'a01234c', mtime: '123456' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -205,7 +203,7 @@ describe('FileList tests', function() { expect($tr.find('.filesize').text()).toEqual('1 kB'); - expect(FileList.findFileEl('testFolder')[0]).toEqual($tr[0]); + expect(fileList.findFileEl('testFolder')[0]).toEqual($tr[0]); }); it('generates file element with default attributes when calling add() with minimal data', function() { var fileData = { @@ -213,8 +211,8 @@ describe('FileList tests', function() { name: 'testFile.txt' }; - clock.tick(123456); - var $tr = FileList.add(fileData); + clock.tick(123456); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -234,8 +232,8 @@ describe('FileList tests', function() { type: 'dir', name: 'testFolder' }; - clock.tick(123456); - var $tr = FileList.add(fileData); + clock.tick(123456); + var $tr = fileList.add(fileData); expect($tr).toBeDefined(); expect($tr[0].tagName.toLowerCase()).toEqual('tr'); @@ -256,7 +254,7 @@ describe('FileList tests', function() { name: 'testFolder', size: '0' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); expect($tr.find('.filesize').text()).toEqual('0 B'); }); it('adds new file to the end of the list', function() { @@ -265,19 +263,19 @@ describe('FileList tests', function() { type: 'file', name: 'ZZZ.txt' }; - FileList.setFiles(testFiles); - $tr = FileList.add(fileData); + fileList.setFiles(testFiles); + $tr = fileList.add(fileData); expect($tr.index()).toEqual(4); }); it('inserts files in a sorted manner when insert option is enabled', function() { var $tr; for (var i = 0; i < testFiles.length; i++) { - FileList.add(testFiles[i]); + fileList.add(testFiles[i]); } - expect(FileList.files[0].name).toEqual('somedir'); - expect(FileList.files[1].name).toEqual('One.txt'); - expect(FileList.files[2].name).toEqual('Three.pdf'); - expect(FileList.files[3].name).toEqual('Two.jpg'); + expect(fileList.files[0].name).toEqual('somedir'); + expect(fileList.files[1].name).toEqual('One.txt'); + expect(fileList.files[2].name).toEqual('Three.pdf'); + expect(fileList.files[3].name).toEqual('Two.jpg'); }); it('inserts new file at correct position', function() { var $tr; @@ -286,12 +284,12 @@ describe('FileList tests', function() { name: 'P comes after O.txt' }; for (var i = 0; i < testFiles.length; i++) { - FileList.add(testFiles[i]); + fileList.add(testFiles[i]); } - $tr = FileList.add(fileData); + $tr = fileList.add(fileData); // after "One.txt" expect($tr.index()).toEqual(2); - expect(FileList.files[2]).toEqual(fileData); + expect(fileList.files[2]).toEqual(fileData); }); it('inserts new folder at correct position in insert mode', function() { var $tr; @@ -300,11 +298,11 @@ describe('FileList tests', function() { name: 'somedir2 comes after somedir' }; for (var i = 0; i < testFiles.length; i++) { - FileList.add(testFiles[i]); + fileList.add(testFiles[i]); } - $tr = FileList.add(fileData); + $tr = fileList.add(fileData); expect($tr.index()).toEqual(1); - expect(FileList.files[1]).toEqual(fileData); + expect(fileList.files[1]).toEqual(fileData); }); it('inserts new file at the end correctly', function() { var $tr; @@ -313,21 +311,22 @@ describe('FileList tests', function() { name: 'zzz.txt' }; for (var i = 0; i < testFiles.length; i++) { - FileList.add(testFiles[i]); + fileList.add(testFiles[i]); } - $tr = FileList.add(fileData); + $tr = fileList.add(fileData); expect($tr.index()).toEqual(4); - expect(FileList.files[4]).toEqual(fileData); + expect(fileList.files[4]).toEqual(fileData); }); it('removes empty content message and shows summary when adding first file', function() { + var $summary; var fileData = { type: 'file', name: 'first file.txt', size: 12 }; - FileList.setFiles([]); - expect(FileList.isEmpty).toEqual(true); - FileList.add(fileData); + fileList.setFiles([]); + expect(fileList.isEmpty).toEqual(true); + fileList.add(fileData); $summary = $('#filestable .summary'); expect($summary.hasClass('hidden')).toEqual(false); // yes, ugly... @@ -337,19 +336,20 @@ describe('FileList tests', function() { expect($summary.find('.filesize').text()).toEqual('12 B'); expect($('#filestable thead th').hasClass('hidden')).toEqual(false); expect($('#emptycontent').hasClass('hidden')).toEqual(true); - expect(FileList.isEmpty).toEqual(false); + expect(fileList.isEmpty).toEqual(false); }); }); describe('Removing files from the list', function() { it('Removes file from list when calling remove() and updates summary', function() { + var $summary; var $removedEl; - FileList.setFiles(testFiles); - $removedEl = FileList.remove('One.txt'); + fileList.setFiles(testFiles); + $removedEl = fileList.remove('One.txt'); expect($removedEl).toBeDefined(); expect($removedEl.attr('data-file')).toEqual('One.txt'); expect($('#fileList tr').length).toEqual(3); - expect(FileList.files.length).toEqual(3); - expect(FileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.files.length).toEqual(3); + expect(fileList.findFileEl('One.txt').length).toEqual(0); $summary = $('#filestable .summary'); expect($summary.hasClass('hidden')).toEqual(false); @@ -357,27 +357,28 @@ describe('FileList tests', function() { expect($summary.find('.dirinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.fileinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.filesize').text()).toEqual('69 kB'); - expect(FileList.isEmpty).toEqual(false); + expect(fileList.isEmpty).toEqual(false); }); it('Shows empty content when removing last file', function() { - FileList.setFiles([testFiles[0]]); - FileList.remove('One.txt'); + var $summary; + fileList.setFiles([testFiles[0]]); + fileList.remove('One.txt'); expect($('#fileList tr').length).toEqual(0); - expect(FileList.files.length).toEqual(0); - expect(FileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.files.length).toEqual(0); + expect(fileList.findFileEl('One.txt').length).toEqual(0); $summary = $('#filestable .summary'); expect($summary.hasClass('hidden')).toEqual(true); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(false); - expect(FileList.isEmpty).toEqual(true); + expect(fileList.isEmpty).toEqual(true); }); }); describe('Deleting files', function() { function doDelete() { var request, query; // note: normally called from FileActions - FileList.do_delete(['One.txt', 'Two.jpg']); + fileList.do_delete(['One.txt', 'Two.jpg']); expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; @@ -387,7 +388,8 @@ describe('FileList tests', function() { expect(OC.parseQueryString(query)).toEqual({'dir': '/subdir', files: '["One.txt","Two.jpg"]'}); } it('calls delete.php, removes the deleted entries and updates summary', function() { - FileList.setFiles(testFiles); + var $summary; + fileList.setFiles(testFiles); doDelete(); fakeServer.requests[0].respond( @@ -396,10 +398,10 @@ describe('FileList tests', function() { JSON.stringify({status: 'success'}) ); - expect(FileList.findFileEl('One.txt').length).toEqual(0); - expect(FileList.findFileEl('Two.jpg').length).toEqual(0); - expect(FileList.findFileEl('Three.pdf').length).toEqual(1); - expect(FileList.$fileList.find('tr').length).toEqual(2); + expect(fileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('Two.jpg').length).toEqual(0); + expect(fileList.findFileEl('Three.pdf').length).toEqual(1); + expect(fileList.$fileList.find('tr').length).toEqual(2); $summary = $('#filestable .summary'); expect($summary.hasClass('hidden')).toEqual(false); @@ -407,28 +409,29 @@ describe('FileList tests', function() { expect($summary.find('.dirinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.fileinfo').hasClass('hidden')).toEqual(false); expect($summary.find('.filesize').text()).toEqual('57 kB'); - expect(FileList.isEmpty).toEqual(false); + expect(fileList.isEmpty).toEqual(false); expect($('#filestable thead th').hasClass('hidden')).toEqual(false); expect($('#emptycontent').hasClass('hidden')).toEqual(true); expect(notificationStub.notCalled).toEqual(true); }); it('shows spinner on files to be deleted', function() { - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); doDelete(); - expect(FileList.findFileEl('One.txt').find('.progress-icon:not(.delete-icon)').length).toEqual(1); - expect(FileList.findFileEl('Three.pdf').find('.delete-icon:not(.progress-icon)').length).toEqual(1); + expect(fileList.findFileEl('One.txt').find('.progress-icon:not(.delete-icon)').length).toEqual(1); + expect(fileList.findFileEl('Three.pdf').find('.delete-icon:not(.progress-icon)').length).toEqual(1); }); it('shows spinner on all files when deleting all', function() { - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); - FileList.do_delete(); + fileList.do_delete(); - expect(FileList.$fileList.find('tr .progress-icon:not(.delete-icon)').length).toEqual(4); + expect(fileList.$fileList.find('tr .progress-icon:not(.delete-icon)').length).toEqual(4); }); it('updates summary when deleting last file', function() { - FileList.setFiles([testFiles[0], testFiles[1]]); + var $summary; + fileList.setFiles([testFiles[0], testFiles[1]]); doDelete(); fakeServer.requests[0].respond( @@ -437,17 +440,17 @@ describe('FileList tests', function() { JSON.stringify({status: 'success'}) ); - expect(FileList.$fileList.find('tr').length).toEqual(0); + expect(fileList.$fileList.find('tr').length).toEqual(0); $summary = $('#filestable .summary'); expect($summary.hasClass('hidden')).toEqual(true); - expect(FileList.isEmpty).toEqual(true); - expect(FileList.files.length).toEqual(0); + expect(fileList.isEmpty).toEqual(true); + expect(fileList.files.length).toEqual(0); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(false); }); it('bring back deleted item when delete call failed', function() { - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); doDelete(); fakeServer.requests[0].respond( @@ -457,36 +460,48 @@ describe('FileList tests', function() { ); // files are still in the list - expect(FileList.findFileEl('One.txt').length).toEqual(1); - expect(FileList.findFileEl('Two.jpg').length).toEqual(1); - expect(FileList.$fileList.find('tr').length).toEqual(4); + expect(fileList.findFileEl('One.txt').length).toEqual(1); + expect(fileList.findFileEl('Two.jpg').length).toEqual(1); + expect(fileList.$fileList.find('tr').length).toEqual(4); expect(notificationStub.calledOnce).toEqual(true); }); }); describe('Renaming files', function() { + function doCancelRename() { + var $input; + for (var i = 0; i < testFiles.length; i++) { + fileList.add(testFiles[i]); + } + + // trigger rename prompt + fileList.rename('One.txt'); + $input = fileList.$fileList.find('input.filename'); + // keep same name + $input.val('One.txt'); + // trigger submit because triggering blur doesn't work in all browsers + $input.closest('form').trigger('submit'); + + expect(fakeServer.requests.length).toEqual(0); + } function doRename() { var $input, request; for (var i = 0; i < testFiles.length; i++) { - FileList.add(testFiles[i]); + fileList.add(testFiles[i]); } // trigger rename prompt - FileList.rename('One.txt'); - $input = FileList.$fileList.find('input.filename'); - $input.val('Tu_after_three.txt').blur(); + fileList.rename('One.txt'); + $input = fileList.$fileList.find('input.filename'); + $input.val('Tu_after_three.txt'); + // trigger submit because triggering blur doesn't work in all browsers + $input.closest('form').trigger('submit'); expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; expect(request.url.substr(0, request.url.indexOf('?'))).toEqual(OC.webroot + '/index.php/apps/files/ajax/rename.php'); expect(OC.parseQueryString(request.url)).toEqual({'dir': '/subdir', newname: 'Tu_after_three.txt', file: 'One.txt'}); - - // element is renamed before the request finishes - expect(FileList.findFileEl('One.txt').length).toEqual(0); - expect(FileList.findFileEl('Tu_after_three.txt').length).toEqual(1); - // input is gone - expect(FileList.$fileList.find('input.filename').length).toEqual(0); } it('Inserts renamed file entry at correct position if rename ajax call suceeded', function() { doRename(); @@ -500,9 +515,9 @@ describe('FileList tests', function() { })); // element stays renamed - expect(FileList.findFileEl('One.txt').length).toEqual(0); - expect(FileList.findFileEl('Tu_after_three.txt').length).toEqual(1); - expect(FileList.findFileEl('Tu_after_three.txt').index()).toEqual(2); // after Two.txt + expect(fileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('Tu_after_three.txt').length).toEqual(1); + expect(fileList.findFileEl('Tu_after_three.txt').index()).toEqual(2); // after Two.txt expect(alertStub.notCalled).toEqual(true); }); @@ -517,9 +532,9 @@ describe('FileList tests', function() { })); // element was reverted - expect(FileList.findFileEl('One.txt').length).toEqual(1); - expect(FileList.findFileEl('One.txt').index()).toEqual(1); // after somedir - expect(FileList.findFileEl('Tu_after_three.txt').length).toEqual(0); + expect(fileList.findFileEl('One.txt').length).toEqual(1); + expect(fileList.findFileEl('One.txt').index()).toEqual(1); // after somedir + expect(fileList.findFileEl('Tu_after_three.txt').length).toEqual(0); expect(alertStub.calledOnce).toEqual(true); }); @@ -534,34 +549,63 @@ describe('FileList tests', function() { } })); - $tr = FileList.findFileEl('Tu_after_three.txt'); + $tr = fileList.findFileEl('Tu_after_three.txt'); expect($tr.find('a.name').attr('href')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=Tu_after_three.txt'); }); - // FIXME: fix this in the source code! - xit('Correctly updates file link after rename when path has same name', function() { - var $tr; - // evil case: because of buggy code - $('#dir').val('/One.txt/subdir'); + it('Triggers "fileActionsReady" event after rename', function() { + var handler = sinon.stub(); + fileList.$fileList.on('fileActionsReady', handler); doRename(); - + expect(handler.notCalled).toEqual(true); fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ status: 'success', data: { name: 'Tu_after_three.txt' } })); + expect(handler.calledOnce).toEqual(true); + expect(fileList.$fileList.find('.test').length).toEqual(0); + }); + it('Leaves the summary alone when reinserting renamed element', function() { + var $summary = $('#filestable .summary'); + doRename(); + fakeServer.requests[0].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ + status: 'success', + data: { + name: 'Tu_after_three.txt' + } + })); + expect($summary.find('.info').text()).toEqual('1 folder and 3 files'); + }); + it('Leaves the summary alone when cancel renaming', function() { + var $summary = $('#filestable .summary'); + doCancelRename(); + expect($summary.find('.info').text()).toEqual('1 folder and 3 files'); + }); + it('Hides actions while rename in progress', function() { + var $tr; + doRename(); + + // element is renamed before the request finishes + $tr = fileList.findFileEl('Tu_after_three.txt'); + expect($tr.length).toEqual(1); + expect(fileList.findFileEl('One.txt').length).toEqual(0); + // file actions are hidden + expect($tr.find('.action').hasClass('hidden')).toEqual(true); + expect($tr.find('.fileactions').hasClass('hidden')).toEqual(true); - $tr = FileList.findFileEl('Tu_after_three.txt'); - expect($tr.find('a.name').attr('href')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=One.txt'); + // input and form are gone + expect(fileList.$fileList.find('input.filename').length).toEqual(0); + expect(fileList.$fileList.find('form').length).toEqual(0); }); }); describe('Moving files', function() { beforeEach(function() { - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); }); it('Moves single file to target folder', function() { var request; - FileList.move('One.txt', '/somedir'); + fileList.move('One.txt', '/somedir'); expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; @@ -576,17 +620,17 @@ describe('FileList tests', function() { } })); - expect(FileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('One.txt').length).toEqual(0); // folder size has increased - expect(FileList.findFileEl('somedir').data('size')).toEqual(262); - expect(FileList.findFileEl('somedir').find('.filesize').text()).toEqual('262 B'); + expect(fileList.findFileEl('somedir').data('size')).toEqual(262); + expect(fileList.findFileEl('somedir').find('.filesize').text()).toEqual('262 B'); expect(notificationStub.notCalled).toEqual(true); }); it('Moves list of files to target folder', function() { var request; - FileList.move(['One.txt', 'Two.jpg'], '/somedir'); + fileList.move(['One.txt', 'Two.jpg'], '/somedir'); expect(fakeServer.requests.length).toEqual(2); request = fakeServer.requests[0]; @@ -605,11 +649,11 @@ describe('FileList tests', function() { } })); - expect(FileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('One.txt').length).toEqual(0); // folder size has increased - expect(FileList.findFileEl('somedir').data('size')).toEqual(262); - expect(FileList.findFileEl('somedir').find('.filesize').text()).toEqual('262 B'); + expect(fileList.findFileEl('somedir').data('size')).toEqual(262); + expect(fileList.findFileEl('somedir').find('.filesize').text()).toEqual('262 B'); fakeServer.requests[1].respond(200, {'Content-Type': 'application/json'}, JSON.stringify({ status: 'success', @@ -619,17 +663,17 @@ describe('FileList tests', function() { } })); - expect(FileList.findFileEl('Two.jpg').length).toEqual(0); + expect(fileList.findFileEl('Two.jpg').length).toEqual(0); // folder size has increased - expect(FileList.findFileEl('somedir').data('size')).toEqual(12311); - expect(FileList.findFileEl('somedir').find('.filesize').text()).toEqual('12 kB'); + expect(fileList.findFileEl('somedir').data('size')).toEqual(12311); + expect(fileList.findFileEl('somedir').find('.filesize').text()).toEqual('12 kB'); expect(notificationStub.notCalled).toEqual(true); }); it('Shows notification if a file could not be moved', function() { var request; - FileList.move('One.txt', '/somedir'); + fileList.move('One.txt', '/somedir'); expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; @@ -643,7 +687,7 @@ describe('FileList tests', function() { } })); - expect(FileList.findFileEl('One.txt').length).toEqual(1); + expect(fileList.findFileEl('One.txt').length).toEqual(1); expect(notificationStub.calledOnce).toEqual(true); expect(notificationStub.getCall(0).args[0]).toEqual('Error while moving file'); @@ -651,47 +695,47 @@ describe('FileList tests', function() { }); describe('List rendering', function() { it('renders a list of files using add()', function() { - expect(FileList.files.length).toEqual(0); - expect(FileList.files).toEqual([]); - FileList.setFiles(testFiles); + expect(fileList.files.length).toEqual(0); + expect(fileList.files).toEqual([]); + fileList.setFiles(testFiles); expect($('#fileList tr').length).toEqual(4); - expect(FileList.files.length).toEqual(4); - expect(FileList.files).toEqual(testFiles); + expect(fileList.files.length).toEqual(4); + expect(fileList.files).toEqual(testFiles); }); it('updates summary using the file sizes', function() { var $summary; - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); $summary = $('#filestable .summary'); expect($summary.hasClass('hidden')).toEqual(false); expect($summary.find('.info').text()).toEqual('1 folder and 3 files'); expect($summary.find('.filesize').text()).toEqual('69 kB'); }); it('shows headers, summary and hide empty content message after setting files', function(){ - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); expect($('#filestable thead th').hasClass('hidden')).toEqual(false); expect($('#emptycontent').hasClass('hidden')).toEqual(true); - expect(FileList.$el.find('.summary').hasClass('hidden')).toEqual(false); + expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(false); }); it('hides headers, summary and show empty content message after setting empty file list', function(){ - FileList.setFiles([]); + fileList.setFiles([]); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(false); - expect(FileList.$el.find('.summary').hasClass('hidden')).toEqual(true); + expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true); }); it('hides headers, empty content message, and summary when list is empty and user has no creation permission', function(){ $('#permissions').val(0); - FileList.setFiles([]); + fileList.setFiles([]); expect($('#filestable thead th').hasClass('hidden')).toEqual(true); expect($('#emptycontent').hasClass('hidden')).toEqual(true); - expect(FileList.$el.find('.summary').hasClass('hidden')).toEqual(true); + expect(fileList.$el.find('.summary').hasClass('hidden')).toEqual(true); }); it('calling findFileEl() can find existing file element', function() { - FileList.setFiles(testFiles); - expect(FileList.findFileEl('Two.jpg').length).toEqual(1); + fileList.setFiles(testFiles); + expect(fileList.findFileEl('Two.jpg').length).toEqual(1); }); it('calling findFileEl() returns empty when file not found in file', function() { - FileList.setFiles(testFiles); - expect(FileList.findFileEl('unexist.dat').length).toEqual(0); + fileList.setFiles(testFiles); + expect(fileList.findFileEl('unexist.dat').length).toEqual(0); }); it('only add file if in same current directory', function() { $('#dir').val('/current dir'); @@ -700,121 +744,122 @@ describe('FileList tests', function() { name: 'testFile.txt', directory: '/current dir' }; - var $tr = FileList.add(fileData); - expect(FileList.findFileEl('testFile.txt').length).toEqual(1); + var $tr = fileList.add(fileData); + expect(fileList.findFileEl('testFile.txt').length).toEqual(1); }); it('triggers "fileActionsReady" event after update', function() { var handler = sinon.stub(); - FileList.$fileList.on('fileActionsReady', handler); - FileList.setFiles(testFiles); + fileList.$fileList.on('fileActionsReady', handler); + fileList.setFiles(testFiles); expect(handler.calledOnce).toEqual(true); }); it('triggers "updated" event after update', function() { var handler = sinon.stub(); - FileList.$fileList.on('updated', handler); - FileList.setFiles(testFiles); + fileList.$fileList.on('updated', handler); + fileList.setFiles(testFiles); expect(handler.calledOnce).toEqual(true); }); it('does not update summary when removing non-existing files', function() { + var $summary; // single file - FileList.setFiles([testFiles[0]]); + fileList.setFiles([testFiles[0]]); $summary = $('#filestable .summary'); expect($summary.hasClass('hidden')).toEqual(false); expect($summary.find('.info').text()).toEqual('0 folders and 1 file'); - FileList.remove('unexist.txt'); + fileList.remove('unexist.txt'); expect($summary.hasClass('hidden')).toEqual(false); expect($summary.find('.info').text()).toEqual('0 folders and 1 file'); }); }); describe('Rendering next page on scroll', function() { beforeEach(function() { - FileList.setFiles(generateFiles(0, 64)); + fileList.setFiles(generateFiles(0, 64)); }); it('renders only the first page', function() { - expect(FileList.files.length).toEqual(65); + expect(fileList.files.length).toEqual(65); expect($('#fileList tr').length).toEqual(20); }); it('renders the second page when scrolling down (trigger nextPage)', function() { // TODO: can't simulate scrolling here, so calling nextPage directly - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(40); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(60); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(65); - FileList._nextPage(true); + fileList._nextPage(true); // stays at 65 expect($('#fileList tr').length).toEqual(65); }); it('inserts into the DOM if insertion point is in the visible page ', function() { - FileList.add({ + fileList.add({ id: 2000, type: 'file', name: 'File with index 15b.txt' }); expect($('#fileList tr').length).toEqual(21); - expect(FileList.findFileEl('File with index 15b.txt').index()).toEqual(16); + expect(fileList.findFileEl('File with index 15b.txt').index()).toEqual(16); }); it('does not inserts into the DOM if insertion point is not the visible page ', function() { - FileList.add({ + fileList.add({ id: 2000, type: 'file', name: 'File with index 28b.txt' }); expect($('#fileList tr').length).toEqual(20); - expect(FileList.findFileEl('File with index 28b.txt').length).toEqual(0); - FileList._nextPage(true); + expect(fileList.findFileEl('File with index 28b.txt').length).toEqual(0); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(40); - expect(FileList.findFileEl('File with index 28b.txt').index()).toEqual(29); + expect(fileList.findFileEl('File with index 28b.txt').index()).toEqual(29); }); it('appends into the DOM when inserting a file after the last visible element', function() { - FileList.add({ + fileList.add({ id: 2000, type: 'file', name: 'File with index 19b.txt' }); expect($('#fileList tr').length).toEqual(21); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(41); }); it('appends into the DOM when inserting a file on the last page when visible', function() { - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(40); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(60); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(65); - FileList._nextPage(true); - FileList.add({ + fileList._nextPage(true); + fileList.add({ id: 2000, type: 'file', name: 'File with index 88.txt' }); expect($('#fileList tr').length).toEqual(66); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(66); }); it('shows additional page when appending a page of files and scrolling down', function() { var newFiles = generateFiles(66, 81); for (var i = 0; i < newFiles.length; i++) { - FileList.add(newFiles[i]); + fileList.add(newFiles[i]); } expect($('#fileList tr').length).toEqual(20); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(40); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(60); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(80); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(81); - FileList._nextPage(true); + fileList._nextPage(true); expect($('#fileList tr').length).toEqual(81); }); it('automatically renders next page when there are not enough elements visible', function() { // delete the 15 first elements for (var i = 0; i < 15; i++) { - FileList.remove(FileList.files[0].name); + fileList.remove(fileList.files[0].name); } // still makes sure that there are 20 elements visible, if any expect($('#fileList tr').length).toEqual(25); @@ -834,7 +879,7 @@ describe('FileList tests', function() { } beforeEach(function() { - previewLoadStub = sinon.stub(Files, 'lazyLoadPreview'); + previewLoadStub = sinon.stub(OCA.Files.FileList.prototype, 'lazyLoadPreview'); }); afterEach(function() { previewLoadStub.restore(); @@ -844,7 +889,7 @@ describe('FileList tests', function() { type: 'file', name: 'testFile.txt' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/file.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -854,7 +899,7 @@ describe('FileList tests', function() { type: 'dir', name: 'test dir' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/folder.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -865,7 +910,7 @@ describe('FileList tests', function() { name: 'test dir', icon: OC.webroot + '/core/img/filetypes/application-pdf.svg' }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/application-pdf.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -876,12 +921,12 @@ describe('FileList tests', function() { name: 'test dir', isPreviewAvailable: true }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/file.svg'); expect(previewLoadStub.calledOnce).toEqual(true); // third argument is callback - previewLoadStub.getCall(0).args[2](OC.webroot + '/somepath.png'); + previewLoadStub.getCall(0).args[0].callback(OC.webroot + '/somepath.png'); expect(getImageUrl($td)).toEqual(OC.webroot + '/somepath.png'); }); it('renders default file type icon when no icon was provided and no preview is available', function() { @@ -890,7 +935,7 @@ describe('FileList tests', function() { name: 'test dir', isPreviewAvailable: false }; - var $tr = FileList.add(fileData); + var $tr = fileList.add(fileData); var $td = $tr.find('td.filename'); expect(getImageUrl($td)).toEqual(OC.webroot + '/core/img/filetypes/file.svg'); expect(previewLoadStub.notCalled).toEqual(true); @@ -898,26 +943,38 @@ describe('FileList tests', function() { }); describe('viewer mode', function() { it('enabling viewer mode hides files table and action buttons', function() { - FileList.setViewerMode(true); + fileList.setViewerMode(true); expect($('#filestable').hasClass('hidden')).toEqual(true); expect($('.actions').hasClass('hidden')).toEqual(true); expect($('.notCreatable').hasClass('hidden')).toEqual(true); }); it('disabling viewer mode restores files table and action buttons', function() { - FileList.setViewerMode(true); - FileList.setViewerMode(false); + fileList.setViewerMode(true); + fileList.setViewerMode(false); expect($('#filestable').hasClass('hidden')).toEqual(false); expect($('.actions').hasClass('hidden')).toEqual(false); expect($('.notCreatable').hasClass('hidden')).toEqual(true); }); it('disabling viewer mode restores files table and action buttons with correct permissions', function() { $('#permissions').val(0); - FileList.setViewerMode(true); - FileList.setViewerMode(false); + fileList.setViewerMode(true); + fileList.setViewerMode(false); expect($('#filestable').hasClass('hidden')).toEqual(false); expect($('.actions').hasClass('hidden')).toEqual(true); expect($('.notCreatable').hasClass('hidden')).toEqual(false); }); + it('toggling viewer mode triggers event', function() { + var handler = sinon.stub(); + fileList.$el.on('changeViewerMode', handler); + fileList.setViewerMode(true); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].viewerModeEnabled).toEqual(true); + + handler.reset(); + fileList.setViewerMode(false); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].viewerModeEnabled).toEqual(false); + }); }); describe('loading file list', function() { beforeEach(function() { @@ -936,22 +993,22 @@ describe('FileList tests', function() { ]); }); it('fetches file list from server and renders it when reload() is called', function() { - FileList.reload(); + fileList.reload(); expect(fakeServer.requests.length).toEqual(1); var url = fakeServer.requests[0].url; var query = url.substr(url.indexOf('?') + 1); - expect(OC.parseQueryString(query)).toEqual({'dir': '/subdir'}); + expect(OC.parseQueryString(query)).toEqual({'dir': '/subdir', sort: 'name', sortdirection: 'asc'}); fakeServer.respond(); expect($('#fileList tr').length).toEqual(4); - expect(FileList.findFileEl('One.txt').length).toEqual(1); + expect(fileList.findFileEl('One.txt').length).toEqual(1); }); it('switches dir and fetches file list when calling changeDirectory()', function() { - FileList.changeDirectory('/anothersubdir'); - expect(FileList.getCurrentDirectory()).toEqual('/anothersubdir'); + fileList.changeDirectory('/anothersubdir'); + expect(fileList.getCurrentDirectory()).toEqual('/anothersubdir'); expect(fakeServer.requests.length).toEqual(1); var url = fakeServer.requests[0].url; var query = url.substr(url.indexOf('?') + 1); - expect(OC.parseQueryString(query)).toEqual({'dir': '/anothersubdir'}); + expect(OC.parseQueryString(query)).toEqual({'dir': '/anothersubdir', sort: 'name', sortdirection: 'asc'}); fakeServer.respond(); }); it('switches to root dir when current directory does not exist', function() { @@ -961,14 +1018,14 @@ describe('FileList tests', function() { }, '' ]); - FileList.changeDirectory('/unexist'); + fileList.changeDirectory('/unexist'); fakeServer.respond(); - expect(FileList.getCurrentDirectory()).toEqual('/'); + expect(fileList.getCurrentDirectory()).toEqual('/'); }); it('shows mask before loading file list then hides it at the end', function() { - var showMaskStub = sinon.stub(FileList, 'showMask'); - var hideMaskStub = sinon.stub(FileList, 'hideMask'); - FileList.changeDirectory('/anothersubdir'); + var showMaskStub = sinon.stub(fileList, 'showMask'); + var hideMaskStub = sinon.stub(fileList, 'hideMask'); + fileList.changeDirectory('/anothersubdir'); expect(showMaskStub.calledOnce).toEqual(true); expect(hideMaskStub.calledOnce).toEqual(false); fakeServer.respond(); @@ -977,18 +1034,23 @@ describe('FileList tests', function() { showMaskStub.restore(); hideMaskStub.restore(); }); - it('changes URL to target dir', function() { - FileList.changeDirectory('/somedir'); - expect(pushStateStub.calledOnce).toEqual(true); - expect(pushStateStub.getCall(0).args[0]).toEqual({dir: '/somedir'}); - expect(pushStateStub.getCall(0).args[2]).toEqual(OC.webroot + '/index.php/apps/files?dir=/somedir'); + it('triggers "changeDirectory" event when changing directory', function() { + var handler = sinon.stub(); + $('#app-content-files').on('changeDirectory', handler); + fileList.changeDirectory('/somedir'); + expect(handler.calledOnce).toEqual(true); + expect(handler.getCall(0).args[0].dir).toEqual('/somedir'); + }); + it('changes the directory when receiving "urlChanged" event', function() { + $('#app-content-files').trigger(new $.Event('urlChanged', {view: 'files', dir: '/somedir'})); + expect(fileList.getCurrentDirectory()).toEqual('/somedir'); }); it('refreshes breadcrumb after update', function() { - var setDirSpy = sinon.spy(FileList.breadcrumb, 'setDirectory'); - FileList.changeDirectory('/anothersubdir'); + var setDirSpy = sinon.spy(fileList.breadcrumb, 'setDirectory'); + fileList.changeDirectory('/anothersubdir'); fakeServer.respond(); - expect(FileList.breadcrumb.setDirectory.calledOnce).toEqual(true); - expect(FileList.breadcrumb.setDirectory.calledWith('/anothersubdir')).toEqual(true); + expect(fileList.breadcrumb.setDirectory.calledOnce).toEqual(true); + expect(fileList.breadcrumb.setDirectory.calledWith('/anothersubdir')).toEqual(true); setDirSpy.restore(); }); }); @@ -1009,20 +1071,20 @@ describe('FileList tests', function() { ]); }); it('clicking on root breadcrumb changes directory to root', function() { - FileList.changeDirectory('/subdir/two/three with space/four/five'); + fileList.changeDirectory('/subdir/two/three with space/four/five'); fakeServer.respond(); - var changeDirStub = sinon.stub(FileList, 'changeDirectory'); - FileList.breadcrumb.$el.find('.crumb:eq(0)').click(); + var changeDirStub = sinon.stub(fileList, 'changeDirectory'); + fileList.breadcrumb.$el.find('.crumb:eq(0)').click(); expect(changeDirStub.calledOnce).toEqual(true); expect(changeDirStub.getCall(0).args[0]).toEqual('/'); changeDirStub.restore(); }); it('clicking on breadcrumb changes directory', function() { - FileList.changeDirectory('/subdir/two/three with space/four/five'); + fileList.changeDirectory('/subdir/two/three with space/four/five'); fakeServer.respond(); - var changeDirStub = sinon.stub(FileList, 'changeDirectory'); - FileList.breadcrumb.$el.find('.crumb:eq(3)').click(); + var changeDirStub = sinon.stub(fileList, 'changeDirectory'); + fileList.breadcrumb.$el.find('.crumb:eq(3)').click(); expect(changeDirStub.calledOnce).toEqual(true); expect(changeDirStub.getCall(0).args[0]).toEqual('/subdir/two/three with space'); @@ -1030,9 +1092,9 @@ describe('FileList tests', function() { }); it('dropping files on breadcrumb calls move operation', function() { var request, query, testDir = '/subdir/two/three with space/four/five'; - FileList.changeDirectory(testDir); + fileList.changeDirectory(testDir); fakeServer.respond(); - var $crumb = FileList.breadcrumb.$el.find('.crumb:eq(3)'); + var $crumb = fileList.breadcrumb.$el.find('.crumb:eq(3)'); // no idea what this is but is required by the handler var ui = { helper: { @@ -1045,7 +1107,7 @@ describe('FileList tests', function() { $('') ]); // simulate drop event - FileList._onDropOnBreadCrumb(new $.Event('drop', {target: $crumb}), ui); + fileList._onDropOnBreadCrumb(new $.Event('drop', {target: $crumb}), ui); // will trigger two calls to move.php (first one was previous list.php) expect(fakeServer.requests.length).toEqual(3); @@ -1071,10 +1133,10 @@ describe('FileList tests', function() { }); }); it('dropping files on same dir breadcrumb does nothing', function() { - var request, query, testDir = '/subdir/two/three with space/four/five'; - FileList.changeDirectory(testDir); + var testDir = '/subdir/two/three with space/four/five'; + fileList.changeDirectory(testDir); fakeServer.respond(); - var $crumb = FileList.breadcrumb.$el.find('.crumb:last'); + var $crumb = fileList.breadcrumb.$el.find('.crumb:last'); // no idea what this is but is required by the handler var ui = { helper: { @@ -1087,7 +1149,7 @@ describe('FileList tests', function() { $('') ]); // simulate drop event - FileList._onDropOnBreadCrumb(new $.Event('drop', {target: $crumb}), ui); + fileList._onDropOnBreadCrumb(new $.Event('drop', {target: $crumb}), ui); // no extra server request expect(fakeServer.requests.length).toEqual(1); @@ -1095,32 +1157,32 @@ describe('FileList tests', function() { }); describe('Download Url', function() { it('returns correct download URL for single files', function() { - expect(Files.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=some%20file.txt'); - expect(Files.getDownloadUrl('some file.txt', '/anotherpath/abc')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fanotherpath%2Fabc&files=some%20file.txt'); + expect(fileList.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=some%20file.txt'); + expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fanotherpath%2Fabc&files=some%20file.txt'); $('#dir').val('/'); - expect(Files.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=some%20file.txt'); + expect(fileList.getDownloadUrl('some file.txt')).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2F&files=some%20file.txt'); }); it('returns correct download URL for multiple files', function() { - expect(Files.getDownloadUrl(['a b c.txt', 'd e f.txt'])).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D'); + expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt'])).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=%5B%22a%20b%20c.txt%22%2C%22d%20e%20f.txt%22%5D'); }); it('returns the correct ajax URL', function() { - expect(Files.getAjaxUrl('test', {a:1, b:'x y'})).toEqual(OC.webroot + '/index.php/apps/files/ajax/test.php?a=1&b=x%20y'); + expect(fileList.getAjaxUrl('test', {a:1, b:'x y'})).toEqual(OC.webroot + '/index.php/apps/files/ajax/test.php?a=1&b=x%20y'); }); }); describe('File selection', function() { beforeEach(function() { - FileList.setFiles(testFiles); + fileList.setFiles(testFiles); }); it('Selects a file when clicking its checkbox', function() { - var $tr = FileList.findFileEl('One.txt'); + var $tr = fileList.findFileEl('One.txt'); expect($tr.find('input:checkbox').prop('checked')).toEqual(false); $tr.find('td.filename input:checkbox').click(); expect($tr.find('input:checkbox').prop('checked')).toEqual(true); }); it('Selects/deselect a file when clicking on the name while holding Ctrl', function() { - var $tr = FileList.findFileEl('One.txt'); - var $tr2 = FileList.findFileEl('Three.pdf'); + var $tr = fileList.findFileEl('One.txt'); + var $tr2 = fileList.findFileEl('Three.pdf'); var e; expect($tr.find('input:checkbox').prop('checked')).toEqual(false); expect($tr2.find('input:checkbox').prop('checked')).toEqual(false); @@ -1138,7 +1200,7 @@ describe('FileList tests', function() { expect($tr.find('input:checkbox').prop('checked')).toEqual(true); expect($tr2.find('input:checkbox').prop('checked')).toEqual(true); - expect(_.pluck(FileList.getSelectedFiles(), 'name')).toEqual(['One.txt', 'Three.pdf']); + expect(_.pluck(fileList.getSelectedFiles(), 'name')).toEqual(['One.txt', 'Three.pdf']); // deselect now e = new $.Event('click'); @@ -1146,11 +1208,11 @@ describe('FileList tests', function() { $tr2.find('td.filename .name').trigger(e); expect($tr.find('input:checkbox').prop('checked')).toEqual(true); expect($tr2.find('input:checkbox').prop('checked')).toEqual(false); - expect(_.pluck(FileList.getSelectedFiles(), 'name')).toEqual(['One.txt']); + expect(_.pluck(fileList.getSelectedFiles(), 'name')).toEqual(['One.txt']); }); it('Selects a range when clicking on one file then Shift clicking on another one', function() { - var $tr = FileList.findFileEl('One.txt'); - var $tr2 = FileList.findFileEl('Three.pdf'); + var $tr = fileList.findFileEl('One.txt'); + var $tr2 = fileList.findFileEl('Three.pdf'); var e; $tr.find('td.filename input:checkbox').click(); e = new $.Event('click'); @@ -1159,16 +1221,16 @@ describe('FileList tests', function() { expect($tr.find('input:checkbox').prop('checked')).toEqual(true); expect($tr2.find('input:checkbox').prop('checked')).toEqual(true); - expect(FileList.findFileEl('Two.jpg').find('input:checkbox').prop('checked')).toEqual(true); - var selection = _.pluck(FileList.getSelectedFiles(), 'name'); + expect(fileList.findFileEl('Two.jpg').find('input:checkbox').prop('checked')).toEqual(true); + var selection = _.pluck(fileList.getSelectedFiles(), 'name'); expect(selection.length).toEqual(3); expect(selection).toContain('One.txt'); expect(selection).toContain('Two.jpg'); expect(selection).toContain('Three.pdf'); }); it('Selects a range when clicking on one file then Shift clicking on another one that is above the first one', function() { - var $tr = FileList.findFileEl('One.txt'); - var $tr2 = FileList.findFileEl('Three.pdf'); + var $tr = fileList.findFileEl('One.txt'); + var $tr2 = fileList.findFileEl('Three.pdf'); var e; $tr2.find('td.filename input:checkbox').click(); e = new $.Event('click'); @@ -1177,104 +1239,104 @@ describe('FileList tests', function() { expect($tr.find('input:checkbox').prop('checked')).toEqual(true); expect($tr2.find('input:checkbox').prop('checked')).toEqual(true); - expect(FileList.findFileEl('Two.jpg').find('input:checkbox').prop('checked')).toEqual(true); - var selection = _.pluck(FileList.getSelectedFiles(), 'name'); + expect(fileList.findFileEl('Two.jpg').find('input:checkbox').prop('checked')).toEqual(true); + var selection = _.pluck(fileList.getSelectedFiles(), 'name'); expect(selection.length).toEqual(3); expect(selection).toContain('One.txt'); expect(selection).toContain('Two.jpg'); expect(selection).toContain('Three.pdf'); }); it('Selecting all files will automatically check "select all" checkbox', function() { - expect($('#select_all').prop('checked')).toEqual(false); + expect($('.select-all').prop('checked')).toEqual(false); $('#fileList tr td.filename input:checkbox').click(); - expect($('#select_all').prop('checked')).toEqual(true); + expect($('.select-all').prop('checked')).toEqual(true); }); it('Selecting all files on the first visible page will not automatically check "select all" checkbox', function() { - FileList.setFiles(generateFiles(0, 41)); - expect($('#select_all').prop('checked')).toEqual(false); + fileList.setFiles(generateFiles(0, 41)); + expect($('.select-all').prop('checked')).toEqual(false); $('#fileList tr td.filename input:checkbox').click(); - expect($('#select_all').prop('checked')).toEqual(false); + expect($('.select-all').prop('checked')).toEqual(false); }); it('Clicking "select all" will select/deselect all files', function() { - FileList.setFiles(generateFiles(0, 41)); - $('#select_all').click(); - expect($('#select_all').prop('checked')).toEqual(true); + fileList.setFiles(generateFiles(0, 41)); + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); $('#fileList tr input:checkbox').each(function() { expect($(this).prop('checked')).toEqual(true); }); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(42); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(42); - $('#select_all').click(); - expect($('#select_all').prop('checked')).toEqual(false); + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(false); $('#fileList tr input:checkbox').each(function() { expect($(this).prop('checked')).toEqual(false); }); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(0); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(0); }); it('Clicking "select all" then deselecting a file will uncheck "select all"', function() { - $('#select_all').click(); - expect($('#select_all').prop('checked')).toEqual(true); + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); - var $tr = FileList.findFileEl('One.txt'); + var $tr = fileList.findFileEl('One.txt'); $tr.find('input:checkbox').click(); - expect($('#select_all').prop('checked')).toEqual(false); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(3); + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(3); }); it('Updates the selection summary when doing a few manipulations with "Select all"', function() { - $('#select_all').click(); - expect($('#select_all').prop('checked')).toEqual(true); + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); - var $tr = FileList.findFileEl('One.txt'); + var $tr = fileList.findFileEl('One.txt'); // unselect one $tr.find('input:checkbox').click(); - expect($('#select_all').prop('checked')).toEqual(false); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(3); + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(3); // select all - $('#select_all').click(); - expect($('#select_all').prop('checked')).toEqual(true); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(4); + $('.select-all').click(); + expect($('.select-all').prop('checked')).toEqual(true); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(4); // unselect one $tr.find('input:checkbox').click(); - expect($('#select_all').prop('checked')).toEqual(false); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(3); + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(3); // re-select it $tr.find('input:checkbox').click(); - expect($('#select_all').prop('checked')).toEqual(true); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(4); + expect($('.select-all').prop('checked')).toEqual(true); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(4); }); it('Auto-selects files on next page when "select all" is checked', function() { - FileList.setFiles(generateFiles(0, 41)); - $('#select_all').click(); + fileList.setFiles(generateFiles(0, 41)); + $('.select-all').click(); - expect(FileList.$fileList.find('tr input:checkbox:checked').length).toEqual(20); - FileList._nextPage(true); - expect(FileList.$fileList.find('tr input:checkbox:checked').length).toEqual(40); - FileList._nextPage(true); - expect(FileList.$fileList.find('tr input:checkbox:checked').length).toEqual(42); - expect(_.pluck(FileList.getSelectedFiles(), 'name').length).toEqual(42); + expect(fileList.$fileList.find('tr input:checkbox:checked').length).toEqual(20); + fileList._nextPage(true); + expect(fileList.$fileList.find('tr input:checkbox:checked').length).toEqual(40); + fileList._nextPage(true); + expect(fileList.$fileList.find('tr input:checkbox:checked').length).toEqual(42); + expect(_.pluck(fileList.getSelectedFiles(), 'name').length).toEqual(42); }); it('Selecting files updates selection summary', function() { - var $summary = $('#headerName span.name'); + var $summary = $('#headerName a.name>span:first'); expect($summary.text()).toEqual('Name'); - FileList.findFileEl('One.txt').find('input:checkbox').click(); - FileList.findFileEl('Three.pdf').find('input:checkbox').click(); - FileList.findFileEl('somedir').find('input:checkbox').click(); + fileList.findFileEl('One.txt').find('input:checkbox').click(); + fileList.findFileEl('Three.pdf').find('input:checkbox').click(); + fileList.findFileEl('somedir').find('input:checkbox').click(); expect($summary.text()).toEqual('1 folder & 2 files'); }); it('Unselecting files hides selection summary', function() { - var $summary = $('#headerName span.name'); - FileList.findFileEl('One.txt').find('input:checkbox').click().click(); + var $summary = $('#headerName a.name>span:first'); + fileList.findFileEl('One.txt').find('input:checkbox').click().click(); expect($summary.text()).toEqual('Name'); }); it('Select/deselect files shows/hides file actions', function() { var $actions = $('#headerName .selectedActions'); - var $checkbox = FileList.findFileEl('One.txt').find('input:checkbox'); + var $checkbox = fileList.findFileEl('One.txt').find('input:checkbox'); expect($actions.hasClass('hidden')).toEqual(true); $checkbox.click(); expect($actions.hasClass('hidden')).toEqual(false); @@ -1282,7 +1344,7 @@ describe('FileList tests', function() { expect($actions.hasClass('hidden')).toEqual(true); }); it('Selection is cleared when switching dirs', function() { - $('#select_all').click(); + $('.select-all').click(); var data = { status: 'success', data: { @@ -1296,31 +1358,43 @@ describe('FileList tests', function() { }, JSON.stringify(data) ]); - FileList.changeDirectory('/'); + fileList.changeDirectory('/'); fakeServer.respond(); - expect($('#select_all').prop('checked')).toEqual(false); - expect(_.pluck(FileList.getSelectedFiles(), 'name')).toEqual([]); + expect($('.select-all').prop('checked')).toEqual(false); + expect(_.pluck(fileList.getSelectedFiles(), 'name')).toEqual([]); }); it('getSelectedFiles returns the selected files even when they are on the next page', function() { var selectedFiles; - FileList.setFiles(generateFiles(0, 41)); - $('#select_all').click(); + fileList.setFiles(generateFiles(0, 41)); + $('.select-all').click(); // unselect one to not have the "allFiles" case - FileList.$fileList.find('tr input:checkbox:first').click(); + fileList.$fileList.find('tr input:checkbox:first').click(); // only 20 files visible, must still return all the selected ones - selectedFiles = _.pluck(FileList.getSelectedFiles(), 'name'); + selectedFiles = _.pluck(fileList.getSelectedFiles(), 'name'); expect(selectedFiles.length).toEqual(41); }); + describe('Selection overlay', function() { + it('show delete action according to directory permissions', function() { + fileList.setFiles(testFiles); + $('#permissions').val(OC.PERMISSION_READ | OC.PERMISSION_DELETE); + $('.select-all').click(); + expect(fileList.$el.find('.delete-selected').hasClass('hidden')).toEqual(false); + $('.select-all').click(); + $('#permissions').val(OC.PERMISSION_READ); + $('.select-all').click(); + expect(fileList.$el.find('.delete-selected').hasClass('hidden')).toEqual(true); + }); + }); describe('Actions', function() { beforeEach(function() { - FileList.findFileEl('One.txt').find('input:checkbox').click(); - FileList.findFileEl('Three.pdf').find('input:checkbox').click(); - FileList.findFileEl('somedir').find('input:checkbox').click(); + fileList.findFileEl('One.txt').find('input:checkbox').click(); + fileList.findFileEl('Three.pdf').find('input:checkbox').click(); + fileList.findFileEl('somedir').find('input:checkbox').click(); }); it('getSelectedFiles returns the selected file data', function() { - var files = FileList.getSelectedFiles(); + var files = fileList.getSelectedFiles(); expect(files.length).toEqual(3); expect(files[0]).toEqual({ id: 1, @@ -1348,8 +1422,8 @@ describe('FileList tests', function() { }); }); it('Removing a file removes it from the selection', function() { - FileList.remove('Three.pdf'); - var files = FileList.getSelectedFiles(); + fileList.remove('Three.pdf'); + var files = fileList.getSelectedFiles(); expect(files.length).toEqual(2); expect(files[0]).toEqual({ id: 1, @@ -1378,7 +1452,7 @@ describe('FileList tests', function() { }); it('Downloads root folder when all selected in root folder', function() { $('#dir').val('/'); - $('#select_all').click(); + $('.select-all').click(); var redirectStub = sinon.stub(OC, 'redirect'); $('.selectedActions .download').click(); expect(redirectStub.calledOnce).toEqual(true); @@ -1386,7 +1460,7 @@ describe('FileList tests', function() { redirectStub.restore(); }); it('Downloads parent folder when all selected in subfolder', function() { - $('#select_all').click(); + $('.select-all').click(); var redirectStub = sinon.stub(OC, 'redirect'); $('.selectedActions .download').click(); expect(redirectStub.calledOnce).toEqual(true); @@ -1408,14 +1482,14 @@ describe('FileList tests', function() { { 'Content-Type': 'application/json' }, JSON.stringify({status: 'success'}) ); - expect(FileList.findFileEl('One.txt').length).toEqual(0); - expect(FileList.findFileEl('Three.pdf').length).toEqual(0); - expect(FileList.findFileEl('somedir').length).toEqual(0); - expect(FileList.findFileEl('Two.jpg').length).toEqual(1); + expect(fileList.findFileEl('One.txt').length).toEqual(0); + expect(fileList.findFileEl('Three.pdf').length).toEqual(0); + expect(fileList.findFileEl('somedir').length).toEqual(0); + expect(fileList.findFileEl('Two.jpg').length).toEqual(1); }); it('Deletes all files when all selected when "Delete" clicked', function() { var request; - $('#select_all').click(); + $('.select-all').click(); $('.selectedActions .delete-selected').click(); expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; @@ -1427,9 +1501,154 @@ describe('FileList tests', function() { { 'Content-Type': 'application/json' }, JSON.stringify({status: 'success'}) ); - expect(FileList.isEmpty).toEqual(true); + expect(fileList.isEmpty).toEqual(true); }); }); }); + it('resets the file selection on reload', function() { + fileList.$el.find('.select-all').click(); + fileList.reload(); + expect(fileList.$el.find('.select-all').prop('checked')).toEqual(false); + expect(fileList.getSelectedFiles()).toEqual([]); + }); + }); + describe('Sorting files', function() { + it('Sorts by name by default', function() { + fileList.reload(); + expect(fakeServer.requests.length).toEqual(1); + var url = fakeServer.requests[0].url; + var query = OC.parseQueryString(url.substr(url.indexOf('?') + 1)); + expect(query.sort).toEqual('name'); + expect(query.sortdirection).toEqual('asc'); + }); + it('Reloads file list with a different sort when clicking on column header of unsorted column', function() { + fileList.$el.find('.column-size .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + var url = fakeServer.requests[0].url; + var query = OC.parseQueryString(url.substr(url.indexOf('?') + 1)); + expect(query.sort).toEqual('size'); + expect(query.sortdirection).toEqual('asc'); + }); + it('Toggles sort direction when clicking on already sorted column', function() { + fileList.$el.find('.column-name .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + var url = fakeServer.requests[0].url; + var query = OC.parseQueryString(url.substr(url.indexOf('?') + 1)); + expect(query.sort).toEqual('name'); + expect(query.sortdirection).toEqual('desc'); + }); + it('Toggles the sort indicator when clicking on a column header', function() { + var ASC_CLASS = fileList.SORT_INDICATOR_ASC_CLASS; + var DESC_CLASS = fileList.SORT_INDICATOR_DESC_CLASS; + fileList.$el.find('.column-size .columntitle').click(); + // moves triangle to size column + expect( + fileList.$el.find('.column-name .sort-indicator').hasClass(ASC_CLASS + ' ' + DESC_CLASS) + ).toEqual(false); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(ASC_CLASS) + ).toEqual(true); + + // click again on size column, reverses direction + fileList.$el.find('.column-size .columntitle').click(); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(DESC_CLASS) + ).toEqual(true); + + // click again on size column, reverses direction + fileList.$el.find('.column-size .columntitle').click(); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(ASC_CLASS) + ).toEqual(true); + + // click on mtime column, moves indicator there + fileList.$el.find('.column-mtime .columntitle').click(); + expect( + fileList.$el.find('.column-size .sort-indicator').hasClass(ASC_CLASS + ' ' + DESC_CLASS) + ).toEqual(false); + expect( + fileList.$el.find('.column-mtime .sort-indicator').hasClass(ASC_CLASS) + ).toEqual(true); + }); + it('Uses correct sort comparator when inserting files', function() { + testFiles.sort(OCA.Files.FileList.Comparators.size); + // this will make it reload the testFiles with the correct sorting + fileList.$el.find('.column-size .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + files: testFiles, + permissions: 31 + } + }) + ); + var newFileData = { + id: 999, + type: 'file', + name: 'new file.txt', + mimetype: 'text/plain', + size: 40001, + etag: '999' + }; + fileList.add(newFileData); + expect(fileList.files.length).toEqual(5); + expect(fileList.$fileList.find('tr').length).toEqual(5); + expect(fileList.findFileEl('One.txt').index()).toEqual(0); + expect(fileList.findFileEl('somedir').index()).toEqual(1); + expect(fileList.findFileEl('Two.jpg').index()).toEqual(2); + expect(fileList.findFileEl('new file.txt').index()).toEqual(3); + expect(fileList.findFileEl('Three.pdf').index()).toEqual(4); + }); + it('Uses correct reversed sort comparator when inserting files', function() { + testFiles.sort(OCA.Files.FileList.Comparators.size); + testFiles.reverse(); + // this will make it reload the testFiles with the correct sorting + fileList.$el.find('.column-size .columntitle').click(); + expect(fakeServer.requests.length).toEqual(1); + fakeServer.requests[0].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + files: testFiles, + permissions: 31 + } + }) + ); + // reverse sort + fileList.$el.find('.column-size .columntitle').click(); + fakeServer.requests[1].respond( + 200, + { 'Content-Type': 'application/json' }, + JSON.stringify({ + status: 'success', + data: { + files: testFiles, + permissions: 31 + } + }) + ); + var newFileData = { + id: 999, + type: 'file', + name: 'new file.txt', + mimetype: 'text/plain', + size: 40001, + etag: '999' + }; + fileList.add(newFileData); + expect(fileList.files.length).toEqual(5); + expect(fileList.$fileList.find('tr').length).toEqual(5); + expect(fileList.findFileEl('One.txt').index()).toEqual(4); + expect(fileList.findFileEl('somedir').index()).toEqual(3); + expect(fileList.findFileEl('Two.jpg').index()).toEqual(2); + expect(fileList.findFileEl('new file.txt').index()).toEqual(1); + expect(fileList.findFileEl('Three.pdf').index()).toEqual(0); + }); }); }); diff --git a/apps/files/tests/js/filesSpec.js b/apps/files/tests/js/filesSpec.js index 7f8848619f500c57b795439783d3d29237a3a689..4f8d5a29318ee97776c7ef880d9053a0d08e472c 100644 --- a/apps/files/tests/js/filesSpec.js +++ b/apps/files/tests/js/filesSpec.js @@ -19,8 +19,9 @@ * */ -/* global OC, Files */ -describe('Files tests', function() { +describe('OCA.Files.Files tests', function() { + var Files = OCA.Files.Files; + describe('File name validation', function() { it('Validates correct file names', function() { var fileNames = [ @@ -83,18 +84,6 @@ describe('Files tests', function() { }); }); describe('getDownloadUrl', function() { - var curDirStub; - beforeEach(function() { - curDirStub = sinon.stub(FileList, 'getCurrentDirectory'); - }); - afterEach(function() { - curDirStub.restore(); - }); - it('returns the ajax download URL when only filename specified', function() { - curDirStub.returns('/subdir'); - var url = Files.getDownloadUrl('test file.txt'); - expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20file.txt'); - }); it('returns the ajax download URL when filename and dir specified', function() { var url = Files.getDownloadUrl('test file.txt', '/subdir'); expect(url).toEqual(OC.webroot + '/index.php/apps/files/ajax/download.php?dir=%2Fsubdir&files=test%20file.txt'); diff --git a/apps/files/tests/js/filesummarySpec.js b/apps/files/tests/js/filesummarySpec.js index c493700de3801d2d361092bdec90d8519c6c413e..5e39dd1d23282374a7cb396f4cf1655b3ee842f3 100644 --- a/apps/files/tests/js/filesummarySpec.js +++ b/apps/files/tests/js/filesummarySpec.js @@ -20,7 +20,8 @@ */ /* global FileSummary */ -describe('FileSummary tests', function() { +describe('OCA.Files.FileSummary tests', function() { + var FileSummary = OCA.Files.FileSummary; var $container; beforeEach(function() { diff --git a/apps/files_encryption/ajax/adminrecovery.php b/apps/files_encryption/ajax/adminrecovery.php index 61e43acc2c33141401c53df32649988705242727..303ba0e16e12dd9b71aa49ee163e8aaa99f0ddad 100644 --- a/apps/files_encryption/ajax/adminrecovery.php +++ b/apps/files_encryption/ajax/adminrecovery.php @@ -5,7 +5,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to handle admin settings for encrypted key recovery + * Script to handle admin settings for encrypted key recovery */ use OCA\Encryption; diff --git a/apps/files_encryption/ajax/changeRecoveryPassword.php b/apps/files_encryption/ajax/changeRecoveryPassword.php index 945f054ea844832c41de2ef90c9fe6e9b1535f91..0cb010d3b566be84dd1d9fae6a03b0786aef6587 100644 --- a/apps/files_encryption/ajax/changeRecoveryPassword.php +++ b/apps/files_encryption/ajax/changeRecoveryPassword.php @@ -5,7 +5,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to change recovery key password + * Script to change recovery key password * */ @@ -23,7 +23,7 @@ $oldPassword = $_POST['oldPassword']; $newPassword = $_POST['newPassword']; $view = new \OC\Files\View('/'); -$util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser()); +$util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser()); $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; diff --git a/apps/files_encryption/ajax/getMigrationStatus.php b/apps/files_encryption/ajax/getMigrationStatus.php index 7c9e0dcc51c51d7ecc54bfda8879b806da44be09..adceb949044efafab7fb346775924c841d9168f7 100644 --- a/apps/files_encryption/ajax/getMigrationStatus.php +++ b/apps/files_encryption/ajax/getMigrationStatus.php @@ -4,7 +4,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief check migration status + * check migration status */ use OCA\Encryption\Util; @@ -18,7 +18,7 @@ $migrationStatus = Util::MIGRATION_COMPLETED; if ($loginname !== '' && $password !== '') { $username = \OCP\User::checkPassword($loginname, $password); if ($username) { - $util = new Util(new \OC_FilesystemView('/'), $username); + $util = new Util(new \OC\Files\View('/'), $username); $migrationStatus = $util->getMigrationStatus(); } } diff --git a/apps/files_encryption/ajax/updatePrivateKeyPassword.php b/apps/files_encryption/ajax/updatePrivateKeyPassword.php index 29c72952ae9de4457cc5d63340c4caef9658615f..f7d20c486cf41f200652b1e4fbfe5abae81ce0a9 100644 --- a/apps/files_encryption/ajax/updatePrivateKeyPassword.php +++ b/apps/files_encryption/ajax/updatePrivateKeyPassword.php @@ -5,7 +5,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to change recovery key password + * Script to change recovery key password * */ diff --git a/apps/files_encryption/ajax/userrecovery.php b/apps/files_encryption/ajax/userrecovery.php index d6c94bde81e5501981f13a084982d00b7932c515..0f3b973d69ab8be1938a0fcff07833f957b22b35 100644 --- a/apps/files_encryption/ajax/userrecovery.php +++ b/apps/files_encryption/ajax/userrecovery.php @@ -4,7 +4,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. * - * @brief Script to handle admin settings for encrypted key recovery + * Script to handle admin settings for encrypted key recovery */ use OCA\Encryption; @@ -19,7 +19,7 @@ if ( ) { $userId = \OCP\USER::getUser(); - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $util = new \OCA\Encryption\Util($view, $userId); // Save recovery preference to DB diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index 21de421c1956efebd98a391bbf3db4dd6cc36aba..104e8568caa62f022f865f36b3e6bca25d749904 100644 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -40,7 +40,7 @@ if (!OC_Config::getValue('maintenance', false)) { \OC_Util::setupFS(); } - $view = new OC_FilesystemView('/'); + $view = new OC\Files\View('/'); $sessionReady = OCA\Encryption\Helper::checkRequirements(); if($sessionReady) { diff --git a/apps/files_encryption/appinfo/info.xml b/apps/files_encryption/appinfo/info.xml index 15a09a29f51da5b99edfb72bae10fa2b53fc3644..b11272f63e7a2bde47baafecb3bb086882d74fb6 100644 --- a/apps/files_encryption/appinfo/info.xml +++ b/apps/files_encryption/appinfo/info.xml @@ -5,7 +5,7 @@ The ownCloud files encryption system provides server side-encryption. After the app is enabled you need to re-login to initialize your encryption keys. Please note that server side encryption requires that the ownCloud server admin can be trusted. The main purpose of this app is the encryption of files that are stored on externally mounted storages. AGPL Sam Tuke, Bjoern Schiessle, Florin Peter - 4 + 4 true http://doc.owncloud.org/server/6.0/user_manual/files/encryption.html diff --git a/apps/files_encryption/files/error.php b/apps/files_encryption/files/error.php index 317cea05a128cc8a8cc930c3066c12a266486dc4..f925442612d632928a1c0b674f4eef16f06a8e42 100644 --- a/apps/files_encryption/files/error.php +++ b/apps/files_encryption/files/error.php @@ -19,12 +19,12 @@ if (!isset($_)) { //also provide standalone error page $errorMsg = $l->t('Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.'); break; default: - $errorMsg = $l->t("Unknown error please check your system settings or contact your administrator"); + $errorMsg = $l->t("Unknown error. Please check your system settings or contact your administrator"); break; } } else { $errorCode = \OCA\Encryption\Crypt::ENCRYPTION_UNKNOWN_ERROR; - $errorMsg = $l->t("Unknown error please check your system settings or contact your administrator"); + $errorMsg = $l->t("Unknown error. Please check your system settings or contact your administrator"); } if (isset($_GET['p']) && $_GET['p'] === '1') { diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 5f0494e62ca38361e2b0b39c42b2218fef5b5536..6e375f99a8e4f31348b55ee52328be6550eeb13a 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -36,7 +36,7 @@ class Hooks { private static $deleteFiles = array(); /** - * @brief Startup encryption backend upon user login + * Startup encryption backend upon user login * @note This method should never be called for users using client side encryption */ public static function login($params) { @@ -48,7 +48,7 @@ class Hooks { $l = new \OC_L10N('files_encryption'); - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // ensure filesystem is loaded if(!\OC\Files\Filesystem::$loaded) { @@ -81,7 +81,7 @@ class Hooks { // Check if first-run file migration has already been performed $ready = false; $migrationStatus = $util->getMigrationStatus(); - if ($migrationStatus === Util::MIGRATION_OPEN) { + if ($migrationStatus === Util::MIGRATION_OPEN && $session !== false) { $ready = $util->beginMigration(); } elseif ($migrationStatus === Util::MIGRATION_IN_PROGRESS) { // refuse login as long as the initial encryption is running @@ -93,7 +93,7 @@ class Hooks { // If migration not yet done if ($ready) { - $userView = new \OC_FilesystemView('/' . $params['uid']); + $userView = new \OC\Files\View('/' . $params['uid']); // Set legacy encryption key if it exists, to support // depreciated encryption system @@ -136,26 +136,26 @@ class Hooks { } /** - * @brief setup encryption backend upon user created + * setup encryption backend upon user created * @note This method should never be called for users using client side encryption */ public static function postCreateUser($params) { if (\OCP\App::isEnabled('files_encryption')) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $util = new Util($view, $params['uid']); Helper::setupUser($util, $params['password']); } } /** - * @brief cleanup encryption backend upon user deleted + * cleanup encryption backend upon user deleted * @note This method should never be called for users using client side encryption */ public static function postDeleteUser($params) { if (\OCP\App::isEnabled('files_encryption')) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // cleanup public key $publicKey = '/public-keys/' . $params['uid'] . '.public.key'; @@ -171,7 +171,7 @@ class Hooks { } /** - * @brief If the password can't be changed within ownCloud, than update the key password in advance. + * If the password can't be changed within ownCloud, than update the key password in advance. */ public static function preSetPassphrase($params) { if (\OCP\App::isEnabled('files_encryption')) { @@ -182,7 +182,7 @@ class Hooks { } /** - * @brief Change a user's encryption passphrase + * Change a user's encryption passphrase * @param array $params keys: uid, password */ public static function setPassphrase($params) { @@ -196,7 +196,7 @@ class Hooks { // the necessary keys) if (Crypt::mode() === 'server') { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); if ($params['uid'] === \OCP\User::getUser()) { @@ -222,10 +222,14 @@ class Hooks { $util = new Util($view, $user); $recoveryPassword = isset($params['recoveryPassword']) ? $params['recoveryPassword'] : null; + // we generate new keys if... + // ...we have a recovery password and the user enabled the recovery key + // ...encryption was activated for the first time (no keys exists) + // ...the user doesn't have any files if (($util->recoveryEnabledForUser() && $recoveryPassword) - || !$util->userKeysExists()) { + || !$util->userKeysExists() + || !$view->file_exists($user . '/files')) { - $recoveryPassword = $params['recoveryPassword']; $newUserPassword = $params['password']; // make sure that the users home is mounted @@ -259,10 +263,10 @@ class Hooks { } /* - * @brief check if files can be encrypted to every user. + * check if files can be encrypted to every user. */ /** - * @param $params + * @param array $params */ public static function preShared($params) { @@ -308,7 +312,7 @@ class Hooks { if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $session = new \OCA\Encryption\Session($view); $userId = \OCP\User::getUser(); $util = new Util($view, $userId); @@ -350,7 +354,7 @@ class Hooks { if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $userId = \OCP\User::getUser(); $util = new Util($view, $userId); $path = \OC\Files\Filesystem::getPath($params['fileSource']); @@ -398,12 +402,12 @@ class Hooks { } /** - * @brief mark file as renamed so that we know the original source after the file was renamed + * mark file as renamed so that we know the original source after the file was renamed * @param array $params with the old path and the new path */ public static function preRename($params) { $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $util = new Util($view, $user); list($ownerOld, $pathOld) = $util->getUidAndFilename($params['oldpath']); @@ -421,8 +425,8 @@ class Hooks { } /** - * @brief after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing - * @param array with oldpath and newpath + * after a file is renamed, rename its keyfile and share-keys also fix the file size and fix also the sharing + * @param array $params array with oldpath and newpath * * This function is connected to the rename signal of OC_Filesystem and adjust the name and location * of the stored versions along the actual file @@ -437,7 +441,7 @@ class Hooks { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $session = new \OCA\Encryption\Session($view); $userId = \OCP\User::getUser(); $util = new Util($view, $userId); @@ -557,7 +561,7 @@ class Hooks { } /** - * @brief if the file was really deleted we remove the encryption keys + * if the file was really deleted we remove the encryption keys * @param array $params * @return boolean|null */ @@ -597,7 +601,7 @@ class Hooks { } /** - * @brief remember the file which should be deleted and it's owner + * remember the file which should be deleted and it's owner * @param array $params * @return boolean|null */ @@ -610,7 +614,7 @@ class Hooks { return true; } - $util = new Util(new \OC_FilesystemView('/'), \OCP\USER::getUser()); + $util = new Util(new \OC\Files\View('/'), \OCP\USER::getUser()); list($owner, $ownerPath) = $util->getUidAndFilename($path); self::$deleteFiles[$params[\OC\Files\Filesystem::signal_param_path]] = array( diff --git a/apps/files_encryption/l10n/ar.php b/apps/files_encryption/l10n/ar.php index 345c01a0d4a67c14641aca49504e04e5ae7edb1e..fbe0ecfe9f606c6859701d40bd3dbfd223318305 100644 --- a/apps/files_encryption/l10n/ar.php +++ b/apps/files_encryption/l10n/ar.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "برنامج التشفير لم يتم تهيئتة ! من الممكن ان برنامج التشفير تم اعادة تفعيلة خلال الجلسة. يرجى تسجيل الخروج ومن ثم تسجيل الدخول مجددا لتهيئة برنامج التشفير.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "مفتاحك الخاص غير صالح! ربما تم تغيير كلمة المرور خارج %s (مثل:مجلد شركتك). يمكنك تحديث كلمة المرور في الاعدادات الشخصية لإستعادة الوصول الى ملفاتك المشفرة.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "لا يمكن فك التشفير من هذا الملف, من الممكن ان يكون هذا الملف مُشارك. يرجى سؤال صاحب الملف لإعادة مشاركتة معك.", -"Unknown error please check your system settings or contact your administrator" => "خطا غير معروف يرجى التاكد من اعدادات نظامك او تواصل مع المدير.", "Missing requirements." => "متطلبات ناقصة.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "يرجى التاكد من ان اصدار PHP 5.3.3 او احدث , مثبت و التاكد من ان OpenSSL مفعل و مهيئ بشكل صحيح. حتى الان برنامج التتشفير تم تعطيلة.", "Following users are not set up for encryption:" => "المستخدمين التاليين لم يتم تعيين لهم التشفيير:", diff --git a/apps/files_encryption/l10n/ast.php b/apps/files_encryption/l10n/ast.php index 7e08e073095487247c93f3b6da960ee610c49b57..04a4a93fcc9d5587a9b00c2bb11b1b8d7a35ee54 100644 --- a/apps/files_encryption/l10n/ast.php +++ b/apps/files_encryption/l10n/ast.php @@ -1,13 +1,43 @@ "Contraseña camudada esitosamente.", -"Could not change the password. Maybe the old password was not correct." => "Nun pue camudase la contraseña. Quiciabes la contraseña vieya nun fore correuta.", -"personal settings" => "axustes personales", +"Recovery key successfully enabled" => "Habilitóse la recuperación de ficheros", +"Could not enable recovery key. Please check your recovery key password!" => "Nun pudo habilitase la clave de recuperación. Por favor comprueba la contraseña.", +"Recovery key successfully disabled" => "Clave de recuperación deshabilitada", +"Could not disable recovery key. Please check your recovery key password!" => "Nun pudo deshabilitase la clave de recuperación. Por favor comprueba la contraseña!", +"Password successfully changed." => "Camudóse la contraseña", +"Could not change the password. Maybe the old password was not correct." => "Nun pudo camudase la contraseña. Comprueba que la contraseña actual seya correuta.", +"Private key password successfully updated." => "Contraseña de clave privada anovada correchamente.", +"Could not update the private key password. Maybe the old password was not correct." => "Nun pudo camudase la contraseña. Pue que la contraseña antigua nun seya correuta.", +"Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "¡L'aplicación de cifráu nun s'anició! Seique se restableciera mentanto la sesión. Por favor intenta zarrar la sesión y volver a aniciala p'aniciar l'aplicación de cifráu.", +"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "¡La clave privada nun ye válida! Seique la contraseña se camudase dende fuera de %s (Ex:El to direutoriu corporativu). Pues anovar la contraseña de la clave privada nes tos opciones personales pa recuperar l'accesu a los ficheros.", +"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Nun pudo descifrase esti ficheru, dablemente seya un ficheru compartíu. Solicita al propietariu del mesmu que vuelva a compartilu contigo.", +"Missing requirements." => "Requisitos incompletos.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrate de que PHP 5.3.3 o postreru ta instaláu y que la estensión OpenSSL de PHP ta habilitada y configurada correutamente. Pel momentu, l'aplicación de cifráu deshabilitóse.", +"Following users are not set up for encryption:" => "Los siguientes usuarios nun se configuraron pal cifráu:", +"Initial encryption started... This can take some time. Please wait." => "Cifráu aniciáu..... Esto pue llevar un tiempu. Por favor espera.", +"Initial encryption running... Please try again later." => "Cifráu inicial en cursu... Inténtalo dempués.", +"Go directly to your " => "Dir direutamente a", +"personal settings" => "opciones personales", "Encryption" => "Cifráu", -"Enabled" => "Habilitáu", +"Enable recovery key (allow to recover users files in case of password loss):" => "Habilitar la clave de recuperación (permite recuperar los ficheros del usuariu en casu de perda de la contraseña);", +"Recovery key password" => "Contraseña de clave de recuperación", +"Repeat Recovery key password" => "Repeti la contraseña de clave de recuperación", +"Enabled" => "Habilitar", "Disabled" => "Deshabilitáu", -"Change Password" => "Camudar conseña", -" If you don't remember your old password you can ask your administrator to recover your files." => "Si nun recuerdes la to contraseña vieya pues entrugar al to alministrador pa recuperar los tos ficheros.", -"Could not update file recovery" => "Nun pue anovase'l ficheru de recuperación" +"Change recovery key password:" => "Camudar la contraseña de la clave de recuperación", +"Old Recovery key password" => "Clave de recuperación vieya", +"New Recovery key password" => "Clave de recuperación nueva", +"Repeat New Recovery key password" => "Repetir la clave de recuperación nueva", +"Change Password" => "Camudar contraseña", +"Your private key password no longer match your log-in password:" => "La to contraseña de clave privada yá nun concasa cola contraseña d'accesu:", +"Set your old private key password to your current log-in password." => "Afitar la contraseña de la to clave privada vieya a la to contraseña actual d'accesu.", +" If you don't remember your old password you can ask your administrator to recover your files." => "Si nun recuerdes la contraseña vieya, pues pidir a alministrador que te recupere los ficheros.", +"Old log-in password" => "Contraseña d'accesu vieya", +"Current log-in password" => "Contraseña d'accesu actual", +"Update Private Key Password" => "Anovar Contraseña de Clave Privada", +"Enable password recovery:" => "Habilitar la recuperación de contraseña:", +"Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" => "Habilitar esta opción va permitite volver a tener accesu a los ficheros cifraos en casu de perda de contraseña", +"File recovery settings updated" => "Opciones de recuperación de ficheros anovada", +"Could not update file recovery" => "Nun pudo anovase la recuperación de ficheros" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_encryption/l10n/ca.php b/apps/files_encryption/l10n/ca.php index 3414796f62bcf91315efc34b9d0adba1a5a069b7..766a8205f7cfe67291081c5ec3efd18d6f07b720 100644 --- a/apps/files_encryption/l10n/ca.php +++ b/apps/files_encryption/l10n/ca.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "L'aplicació d'encriptació no està inicialitzada! Potser l'aplicació d'encriptació ha estat reiniciada durant la sessió. Intenteu sortir i acreditar-vos de nou per reinicialitzar l'aplicació d'encriptació.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "La clau privada no és vàlida! Probablement la contrasenya va ser canviada des de fora de %s (per exemple, en el directori de l'empresa). Vostè pot actualitzar la contrasenya de clau privada en la seva configuració personal per poder recuperar l'accés en els arxius xifrats.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "No es pot desencriptar aquest fitxer, probablement és un fitxer compartit. Demaneu al propietari del fitxer que el comparteixi de nou amb vós.", -"Unknown error please check your system settings or contact your administrator" => "Error desconegut. Comproveu l'arranjament del sistema o contacteu amb l'administrador", "Missing requirements." => "Manca de requisits.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Assegureu-vos que teniu instal·lat PHP 5.3.3 o una versió superior i que està activat Open SSL i habilitada i configurada correctament l'extensió de PHP. De moment, l'aplicació d'encriptació s'ha desactivat.", "Following users are not set up for encryption:" => "Els usuaris següents no estan configurats per a l'encriptació:", diff --git a/apps/files_encryption/l10n/cs_CZ.php b/apps/files_encryption/l10n/cs_CZ.php index cdeaf5b192bf7c7598cdeb638a0b9fadb92c2c44..629353b2c4a76d4ba354c17e645f43b41581a9ff 100644 --- a/apps/files_encryption/l10n/cs_CZ.php +++ b/apps/files_encryption/l10n/cs_CZ.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Aplikace pro šifrování není inicializována! Je možné, že aplikace byla znovu aktivována během vašeho přihlášení. Zkuste se prosím odhlásit a znovu přihlásit pro provedení inicializace šifrovací aplikace.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Váš soukromý klíč není platný! Pravděpodobně bylo vaše heslo změněno vně systému %s (např. ve vašem firemním adresáři). Heslo vašeho soukromého klíče můžete změnit ve svém osobním nastavení pro obnovení přístupu k vašim zašifrovaným souborům.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Tento soubor se nepodařilo dešifrovat, pravděpodobně je sdílený. Požádejte prosím majitele souboru, aby jej s vámi znovu sdílel.", -"Unknown error please check your system settings or contact your administrator" => "Neznámá chyba, zkontrolujte vaše systémová nastavení nebo kontaktujte vašeho správce", "Missing requirements." => "Nesplněné závislosti.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Ujistěte se prosím, že máte nainstalované PHP 5.3.3 nebo novější a že máte povolené a správně nakonfigurované OpenSSL včetně jeho rozšíření pro PHP. Prozatím byla aplikace pro šifrování vypnuta.", "Following users are not set up for encryption:" => "Následující uživatelé nemají nastavené šifrování:", diff --git a/apps/files_encryption/l10n/da.php b/apps/files_encryption/l10n/da.php index f0f1580049831d1822027c0bc753790042b2cd32..982f5302af618912e799dc52f46ce69fc054bf44 100644 --- a/apps/files_encryption/l10n/da.php +++ b/apps/files_encryption/l10n/da.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Krypteringsprogrammet er ikke igangsat. Det kan skyldes at krypteringsprogrammet er blevet genaktiveret under din session. Prøv at logge ud og ind igen for at aktivere krypteringsprogrammet. ", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Din private nøgle er ikke gyldig. Sandsynligvis er dit kodeord blevet ændret uden for %s (f.eks dit firmas adressebog). Du kan opdatere din private nøglekode i dine personlige indstillinger for at genskabe adgang til dine krypterede filer.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan ikke kryptere denne fil, sandsynligvis fordi felen er delt. Bed venligst filens ejer om at dele den med dig på ny.", -"Unknown error please check your system settings or contact your administrator" => "Ukendt fejl. Kontroller venligst dit system eller kontakt din administrator", "Missing requirements." => "Manglende betingelser.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Sørg for at PHP 5.3.3 eller nyere er installeret og at OpenSSL sammen med PHP-udvidelsen er aktiveret og korrekt konfigureret. Indtil videre er krypteringsprogrammet deaktiveret.", "Following users are not set up for encryption:" => "Følgende brugere er ikke sat op til kryptering:", diff --git a/apps/files_encryption/l10n/de.php b/apps/files_encryption/l10n/de.php index 38bfa7f0249f050af0068db83de99480c456ca71..5c8506576c36d6c4dae2ae1aa1d95afb960c1cd8 100644 --- a/apps/files_encryption/l10n/de.php +++ b/apps/files_encryption/l10n/de.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Verschlüsselung-App ist nicht initialisiert! Vielleicht wurde die Verschlüsselung-App in der aktuellen Sitzung reaktiviert. Bitte versuche Dich ab- und wieder anzumelden, um die Verschlüsselung-App zu initialisieren.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Dein privater Schlüssel ist ungültig. Möglicher Weise wurde außerhalb von %s Dein Passwort geändert (z.B. in Deinem gemeinsamen Verzeichnis). Du kannst das Passwort Deines privaten Schlüssels in den persönlichen Einstellungen aktualisieren, um wieder an Deine Dateien zu gelangen.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Die Datei kann nicht entschlüsselt werden, da die Datei möglicherweise eine geteilte Datei ist. Bitte frage den Dateibesitzer, ob er die Datei nochmals mit Dir teilt.", -"Unknown error please check your system settings or contact your administrator" => "Unbekannter Fehler, bitte prüfe Deine Systemeinstellungen oder kontaktiere Deinen Administrator", "Missing requirements." => "Fehlende Vorraussetzungen", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Bitte stelle sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.", "Following users are not set up for encryption:" => "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:", diff --git a/apps/files_encryption/l10n/de_DE.php b/apps/files_encryption/l10n/de_DE.php index 13f7718b93c4bb24c974b2425dab788f773cfb62..bcfb60f942b6cbef9ba9dd906ffc521ed7e1f5ac 100644 --- a/apps/files_encryption/l10n/de_DE.php +++ b/apps/files_encryption/l10n/de_DE.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Verschlüsselung-App ist nicht initialisiert! Vielleicht wurde die Verschlüsselung-App in der aktuellen Sitzung reaktiviert. Bitte versuchen Sie sich ab- und wieder anzumelden, um die Verschlüsselung-App zu initialisieren.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Ihr privater Schlüssel ist ungültig. Möglicher Weise wurde außerhalb von %s Ihr Passwort geändert (z.B. in Ihrem gemeinsamen Verzeichnis). Sie können das Passwort Ihres privaten Schlüssels in den persönlichen Einstellungen aktualisieren, um wieder an Ihre Dateien zu gelangen.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Die Datei kann nicht entschlüsselt werden, da die Datei möglicherweise eine geteilte Datei ist. Bitte fragen Sie den Datei-Besitzer, dass er die Datei nochmals mit Ihnen teilt.", -"Unknown error please check your system settings or contact your administrator" => "Unbekannter Fehler, bitte prüfen Sie die Systemeinstellungen oder kontaktieren Sie Ihren Administrator", "Missing requirements." => "Fehlende Voraussetzungen", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Bitte stellen Sie sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.", "Following users are not set up for encryption:" => "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:", diff --git a/apps/files_encryption/l10n/el.php b/apps/files_encryption/l10n/el.php index 972d7d7138c82fda189fb30b05e03e6eb8115a12..8f917b022d5bb1bfe7a17b95970359c4c3e8fa48 100644 --- a/apps/files_encryption/l10n/el.php +++ b/apps/files_encryption/l10n/el.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Η εφαρμογή κρυπτογράφησης δεν έχει εκκινήσει! Ίσως η εφαρμογή κρυπτογράφησης επανενεργοποιήθηκε κατά τη διάρκεια της τρέχουσας σύνδεσής σας. Παρακαλώ προσπαθήστε να αποσυνδεθείτε και να ξανασυνδεθείτε για να εκκινήσετε την εφαρμογή κρυπτογράφησης.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Το προσωπικό σας κλειδί δεν είναι έγκυρο! Πιθανόν ο κωδικός σας να άλλαξε έξω από το %s (π.χ. τη λίστα διευθύνσεων της εταιρείας σας). Μπορείτε να ενημερώσετε το προσωπικό σας κλειδί επαναφοράς κωδικού στις προσωπικές σας ρυθμίσεις για να επανακτήσετε πρόσβαση στα κρυπτογραφημένα σας αρχεία.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Δεν ήταν δυνατό να αποκρυπτογραφηθεί αυτό το αρχείο, πιθανόν πρόκειται για κοινόχρηστο αρχείο. Παρακαλώ ζητήστε από τον ιδιοκτήτη του αρχείου να το ξαναμοιραστεί μαζί σας.", -"Unknown error please check your system settings or contact your administrator" => "Άγνωστο σφάλμα, παρακαλώ ελέγξτε τις ρυθμίσεις συστήματος ή επικοινωνήστε με τον διαχειριστή σας ", "Missing requirements." => "Προαπαιτούμενα που απουσιάζουν.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Παρακαλώ επιβεβαιώστε ότι η PHP 5.3.3 ή νεότερη είναι εγκατεστημένη και ότι το OpenSSL μαζί με το PHP extension είναι ενεργοποιήμένο και έχει ρυθμιστεί σωστά. Προς το παρόν, η εφαρμογή κρυπτογράφησης είναι απενεργοποιημένη.", "Following users are not set up for encryption:" => "Οι κάτωθι χρήστες δεν έχουν ρυθμιστεί για κρυπογράφηση:", diff --git a/apps/files_encryption/l10n/en_GB.php b/apps/files_encryption/l10n/en_GB.php index 2087ea4b8b103f63fe3fc96fca8fd4b2af8fc125..683319028b604ae40d2fe438ecc230e2b0df53ad 100644 --- a/apps/files_encryption/l10n/en_GB.php +++ b/apps/files_encryption/l10n/en_GB.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Encryption app not initialised! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialise the encryption app.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Cannot decrypt this file, which is probably a shared file. Please ask the file owner to reshare the file with you.", -"Unknown error please check your system settings or contact your administrator" => "Unknown error. Please check your system settings or contact your administrator", "Missing requirements." => "Missing requirements.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.", "Following users are not set up for encryption:" => "Following users are not set up for encryption:", diff --git a/apps/files_encryption/l10n/es.php b/apps/files_encryption/l10n/es.php index cf45437c0e23e47426e9d9d28c8f02722eeec638..e252217a9f164ecec3dd1da06c8fac7a586de18d 100644 --- a/apps/files_encryption/l10n/es.php +++ b/apps/files_encryption/l10n/es.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "¡La aplicación de cifrado no ha sido inicializada! Quizá fue restablecida durante tu sesión. Por favor intenta cerrar la sesión y volver a iniciarla para inicializar la aplicación de cifrado.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera. de %s (Ej:Su directorio corporativo). Puede actualizar la contraseña de su clave privada en sus opciones personales para recuperar el acceso a sus archivos.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "No fue posible descifrar este archivo, probablemente se trate de un archivo compartido. Solicite al propietario del mismo que vuelva a compartirlo con usted.", -"Unknown error please check your system settings or contact your administrator" => "Error desconocido. Verifique la configuración de su sistema o póngase en contacto con su administrador", "Missing requirements." => "Requisitos incompletos.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.", "Following users are not set up for encryption:" => "Los siguientes usuarios no han sido configurados para el cifrado:", diff --git a/apps/files_encryption/l10n/es_AR.php b/apps/files_encryption/l10n/es_AR.php index b885716f89b5b8aa67cd5f75d1b1b1cf315aa061..0209c5894938f41b1f2d01670c6025b075aab045 100644 --- a/apps/files_encryption/l10n/es_AR.php +++ b/apps/files_encryption/l10n/es_AR.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "¡La aplicación de encriptación no está inicializada! Es probable que la aplicación fue re-habilitada durante tu sesión. Intenta salir y iniciar sesión para volverla a iniciar.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "¡Tu llave privada no es válida! Aparenta que tu clave fue cambiada fuera de %s (de tus directorios). Puedes actualizar la contraseña de tu clave privadaen las configuraciones personales para recobrar el acceso a tus archivos encriptados.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "No se puede descibrar este archivo, probablemente sea un archivo compartido. Por favor pídele al dueño que recomparta el archivo contigo.", -"Unknown error please check your system settings or contact your administrator" => "Error desconocido, por favor chequea la configuración de tu sistema o contacte a su administrador", "Missing requirements." => "Requisitos incompletos.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrese de que PHP 5.3.3 o una versión más reciente esté instalado y que OpenSSL junto con la extensión PHP esté habilitado y configurado apropiadamente. Por ahora, la aplicación de encriptación ha sido deshabilitada.", "Following users are not set up for encryption:" => "Los siguientes usuarios no fueron configurados para encriptar:", diff --git a/apps/files_encryption/l10n/es_MX.php b/apps/files_encryption/l10n/es_MX.php index e2915f8e7158554f403a27f2310d8bc4693d06f9..b3ac75e082df092633b7707b3f630820b3affca2 100644 --- a/apps/files_encryption/l10n/es_MX.php +++ b/apps/files_encryption/l10n/es_MX.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "¡La aplicación de cifrado no ha sido inicializada! Quizá fue restablecida durante tu sesión. Por favor intenta cerrar la sesión y volver a iniciarla para inicializar la aplicación de cifrado.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera. de %s (Ej:Su directorio corporativo). Puede actualizar la contraseña de su clave privada en sus opciones personales para recuperar el acceso a sus archivos.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "No fue posible descifrar este archivo, probablemente se trate de un archivo compartido. Solicite al propietario del mismo que vuelva a compartirlo con usted.", -"Unknown error please check your system settings or contact your administrator" => "Error desconocido. Verifique la configuración de su sistema o póngase en contacto con su administrador", "Missing requirements." => "Requisitos incompletos.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.", "Following users are not set up for encryption:" => "Los siguientes usuarios no han sido configurados para el cifrado:", diff --git a/apps/files_encryption/l10n/et_EE.php b/apps/files_encryption/l10n/et_EE.php index f82f9df9279d0c76fbe2f25dccdd65e3c7ba8765..4d7a352611b48db49549b5ace84a34f8da21f698 100644 --- a/apps/files_encryption/l10n/et_EE.php +++ b/apps/files_encryption/l10n/et_EE.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Krüpteerimise rakend pole käivitatud. Võib-olla krüpteerimise rakend taaskäivitati sinu sessiooni kestel. Palun proovi logida välja ning uuesti sisse käivitamaks krüpteerimise rakendit.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Sinu provaatne võti pole kehtiv! Tõenäoliselt mudueti parooli väljaspool kausta %s (nt. sinu ettevõtte kaust). Sa saad uuendada oma privaatse võtme parooli oma isiklikes seadetes, et taastada ligipääs sinu krüpteeritud failidele.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Sa ei saa seda faili dekrüpteerida, see on tõenäoliselt jagatud fail. Palun lase omanikul seda faili sinuga uuesti jagada.", -"Unknown error please check your system settings or contact your administrator" => "Tundmatu tõrge. Palun kontrolli süsteemi seadeid või võta ühendust oma süsteemi administraatoriga", "Missing requirements." => "Nõutavad on puudu.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Palun veendu, et on paigaldatud PHP 5.3.3 või uuem ning PHP OpenSSL laiendus on lubatud ning seadistatud korrektselt. Hetkel krüpteerimise rakendus on peatatud.", "Following users are not set up for encryption:" => "Järgmised kasutajad pole seadistatud krüpteeringuks:", diff --git a/apps/files_encryption/l10n/eu.php b/apps/files_encryption/l10n/eu.php index 9d51ebba2bf29ce873af8c134afba884895525c6..472c8a71b1bcb1a8662e17cede5d9545047d3a07 100644 --- a/apps/files_encryption/l10n/eu.php +++ b/apps/files_encryption/l10n/eu.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Enkriptazio aplikazioa ez dago hasieratuta! Agian aplikazioa birgaitu egin da zure saioa bitartean. Mesdez atear eta sartu berriz enkriptazio aplikazioa hasierarazteko.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Zure gako pribatua ez da egokia! Seguruaski zure pasahitza %s-tik kanpo aldatu da (adb. zure direktorio korporatiboa). Zure gako pribatuaren pasahitza eguneratu dezakezu zure ezarpen pertsonaletan zure enkriptatutako fitxategiak berreskuratzeko.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Ezin izan da fitxategi hau deszifratu, ziurrenik elkarbanatutako fitxategi bat da. Mesdez, eskatu fitxategiaren jabeari fitxategia zurekin berriz elkarbana dezan.", -"Unknown error please check your system settings or contact your administrator" => "Errore ezezaguna mesedez egiaztatu zure sistemaren ezarpenak edo harremanetan jarri zure administradorearekin", "Missing requirements." => "Eskakizun batzuk ez dira betetzen.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Mesedez ziurtatu PHP 5.3.3 edo berriago bat instalatuta dagoela eta OpenSSL PHP hedapenarekin gaitua eta ongi konfiguratuta dagoela. Oraingoz, enkriptazio aplikazioa desgaituta dago.", "Following users are not set up for encryption:" => "Hurrengo erabiltzaileak ez daude enktriptatzeko konfiguratutak:", diff --git a/apps/files_encryption/l10n/fa.php b/apps/files_encryption/l10n/fa.php index 3f8d631e1067a885bceb3ab039c04eb5decae9b6..420fd7423f8448b09f356a505341b778963bb1be 100644 --- a/apps/files_encryption/l10n/fa.php +++ b/apps/files_encryption/l10n/fa.php @@ -9,6 +9,7 @@ $TRANSLATIONS = array( "Private key password successfully updated." => "رمزعبور کلید خصوصی با موفقیت به روز شد.", "Could not update the private key password. Maybe the old password was not correct." => "رمزعبور کلید خصوصی را نمی تواند به روز کند. شاید رمزعبور قدیمی صحیح نمی باشد.", "Missing requirements." => "نیازمندی های گمشده", +"Following users are not set up for encryption:" => "کاربران زیر برای رمزنگاری تنظیم نشده اند", "personal settings" => "تنظیمات شخصی", "Encryption" => "رمزگذاری", "Enable recovery key (allow to recover users files in case of password loss):" => "فعال کردن کلید بازیابی(اجازه بازیابی فایل های کاربران در صورت از دست دادن رمزعبور):", diff --git a/apps/files_encryption/l10n/fr.php b/apps/files_encryption/l10n/fr.php index a68b6a71326f48f69ebf6431dad1349b370ee6cb..699ac77618696482ed43dfc535c29082b266d480 100644 --- a/apps/files_encryption/l10n/fr.php +++ b/apps/files_encryption/l10n/fr.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "L'application de chiffrement n'est pas initialisée ! Peut-être que cette application a été réactivée pendant votre session. Veuillez essayer de vous déconnecter et ensuite de vous reconnecter pour initialiser l'application de chiffrement.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Votre clef privée est invalide ! Votre mot de passe a probablement été modifié hors de %s (ex. votre annuaire d'entreprise). Vous pouvez mettre à jour le mot de passe de votre clef privée dans les paramètres personnels pour pouvoir récupérer l'accès à vos fichiers chiffrés.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Impossible de déchiffrer ce fichier, il s'agit probablement d'un fichier partagé. Veuillez demander au propriétaire de ce fichier de le repartager avec vous.", -"Unknown error please check your system settings or contact your administrator" => "Erreur inconnue. Veuillez vérifier vos paramètres système ou contacter votre administrateur.", "Missing requirements." => "Système minimum requis non respecté.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Veuillez vous assurer qu'une version de PHP 5.3.3 ou supérieure est installée et qu'OpenSSL et son extension PHP sont activés et configurés correctement. En attendant, l'application de chiffrement été désactivée.", "Following users are not set up for encryption:" => "Les utilisateurs suivants ne sont pas configurés pour le chiffrement :", diff --git a/apps/files_encryption/l10n/gl.php b/apps/files_encryption/l10n/gl.php index 08567ef27635f3a891c11274721a8f9c920f542e..9b52f0d292d14c8792a0e0ca7cc91dd77df3a65f 100644 --- a/apps/files_encryption/l10n/gl.php +++ b/apps/files_encryption/l10n/gl.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Non se iniciou o aplicativo de cifrado! Quizais volva a activarse durante a sesión. Tente pechar a sesión e volver iniciala que tamén se inicie o aplicativo de cifrado.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "A chave privada non é correcta! É probábel que o seu contrasinal teña sido cambiado desde o exterior do %s (p.ex. o seu directorio corporativo). Vostede pode actualizar o contrasinal da súa chave privada nos seus axustes persoais para recuperar o acceso aos seus ficheiros", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Non foi posíbel descifrar o ficheiro, probabelmente tratase dun ficheiro compartido. Pidalle ao propietario do ficheiro que volva compartir o ficheiro con vostede.", -"Unknown error please check your system settings or contact your administrator" => "Produciuse un erro descoñecido. Comprobe os axustes do sistema ou póñase en contacto co administrador", "Missing requirements." => "Non se cumpren os requisitos.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Asegúrese de que está instalado o PHP 5.3.3 ou posterior e de o OpenSSL xunto coa extensión PHP estean activados e configurados correctamente. Polo de agora foi desactivado o aplicativo de cifrado.", "Following users are not set up for encryption:" => "Os seguintes usuarios non teñen configuración para o cifrado:", diff --git a/apps/files_encryption/l10n/hu_HU.php b/apps/files_encryption/l10n/hu_HU.php index 22c1fa989bd6b16e8981bccb4304ee2a276b1c2a..278aa3cc0bfa1d8c9021fe65afecde89f877442a 100644 --- a/apps/files_encryption/l10n/hu_HU.php +++ b/apps/files_encryption/l10n/hu_HU.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "A titkosítási modul nincs elindítva! Talán a munkafolyamat közben került engedélyezésre. Kérjük jelentkezzen ki majd ismét jelentkezzen be, hogy a titkosítási modul megfelelően elinduljon!", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Az állományok titkosításához használt titkos kulcsa érvénytelen. Valószínűleg a %s rendszeren kívül változtatta meg a jelszavát (pl. a munkahelyi címtárban). A személyes beállításoknál frissítheti a titkos kulcsát, hogy ismét elérhesse a titkosított állományait.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Az állományt nem sikerült dekódolni, valószínűleg ez egy megosztott fájl. Kérje meg az állomány tulajdonosát, hogy újra ossza meg Önnel ezt az állományt!", -"Unknown error please check your system settings or contact your administrator" => "Ismeretlen hiba. Ellenőrizze a rendszer beállításait vagy forduljon a rendszergazdához!", "Missing requirements." => "Hiányzó követelmények.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Kérem gondoskodjon arról, hogy PHP 5.3.3 vagy annál frissebb legyen telepítve, továbbá az OpenSSL a megfelelő PHP-bővítménnyel együtt rendelkezésre álljon és helyesen legyen konfigurálva! A titkosító modul egyelőre kikapcsolásra került.", "Following users are not set up for encryption:" => "A következő felhasználók nem állították be a titkosítást:", diff --git a/apps/files_encryption/l10n/id.php b/apps/files_encryption/l10n/id.php index a4c3ae547c28ab27a7e4c20f4a3d89c8ab80c811..1d2642b8f2e402e8220efae1a2bf5f2f56613bbe 100644 --- a/apps/files_encryption/l10n/id.php +++ b/apps/files_encryption/l10n/id.php @@ -9,7 +9,6 @@ $TRANSLATIONS = array( "Private key password successfully updated." => "Sandi kunci privat berhasil diperbarui.", "Could not update the private key password. Maybe the old password was not correct." => "Tidak dapat memperbarui sandi kunci privat. Kemungkinan sandi lama yang Anda masukkan salah.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Tidak dapat mendekripsi berkas ini, mungkin ini adalah berkas bersama. Silakan meminta pemilik berkas ini untuk membagikan kembali dengan Anda.", -"Unknown error please check your system settings or contact your administrator" => "Kesalahan tak dikenal, silakan periksa pengaturan sistem Anda atau hubungi admin.", "Missing requirements." => "Persyaratan yang hilang.", "Following users are not set up for encryption:" => "Pengguna berikut belum diatur untuk enkripsi:", "Initial encryption started... This can take some time. Please wait." => "Inisial enskripsi dijalankan... Ini dapat memakan waktu. Silakan tunggu.", diff --git a/apps/files_encryption/l10n/it.php b/apps/files_encryption/l10n/it.php index 42ee846a7686aa278a8a09425a260446dc1f1b30..f2d15e362106537e462b3280856fa31b725581fd 100644 --- a/apps/files_encryption/l10n/it.php +++ b/apps/files_encryption/l10n/it.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Applicazione di cifratura non inizializzata. Forse l'applicazione è stata riabilitata durante la tua sessione. Prova a disconnetterti e ad effettuare nuovamente l'accesso per inizializzarla.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "La tua chiave privata non è valida! Forse la password è stata cambiata al di fuori di %s (ad es. la directory aziendale). Puoi aggiornare la password della chiave privata nelle impostazioni personali per ottenere nuovamente l'accesso ai file cifrati.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Impossibile decifrare questo file, probabilmente è un file condiviso. Chiedi al proprietario del file di condividere nuovamente il file con te.", -"Unknown error please check your system settings or contact your administrator" => "Errore sconosciuto, controlla le impostazioni di sistema o contatta il tuo amministratore", "Missing requirements." => "Requisiti mancanti.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Assicurati che sia installato PHP 5.3.3 o versioni successive e che l'estensione OpenSSL di PHP sia abilitata e configurata correttamente. Per ora, l'applicazione di cifratura è disabilitata.", "Following users are not set up for encryption:" => "I seguenti utenti non sono configurati per la cifratura:", diff --git a/apps/files_encryption/l10n/ja.php b/apps/files_encryption/l10n/ja.php index 476566e00f49bd876e8342d5a299007edd827f79..fa1d4c3da4029ab3150934cd48dca0dae899751b 100644 --- a/apps/files_encryption/l10n/ja.php +++ b/apps/files_encryption/l10n/ja.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "セッション中に暗号化アプリを再度有効にされたため、暗号化アプリが初期化されていません。暗号化アプリを初期化するため、ログアウトしてログインしなおしてください。", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "プライベートキーが有効ではありません!パスワードが%sの外部で変更された(例: 共同ディレクトリ)と思われます。個人設定でプライベートキーのパスワードを更新して、暗号化ファイルへのアクセスを回復することができます。", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "このファイルを復号化できません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。", -"Unknown error please check your system settings or contact your administrator" => "不明なエラーです。システム設定を確認するか、管理者に問い合わせてください。", "Missing requirements." => "必要要件が満たされていません。", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "必ず、PHP 5.3.3もしくはそれ以上をインストールし、同時にOpenSSLのPHP拡張を有効にした上でOpenSSLも同様にインストール、適切に設定してください。現時点では暗号化アプリは無効になっています。", "Following users are not set up for encryption:" => "以下のユーザーは、暗号化設定がされていません:", diff --git a/apps/files_encryption/l10n/ko.php b/apps/files_encryption/l10n/ko.php index 41168a340c09cda44cf8b448268b1326d6ed0e95..3526635e8572ce120caf17b6cc34ec47d6aa66e2 100644 --- a/apps/files_encryption/l10n/ko.php +++ b/apps/files_encryption/l10n/ko.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "암호화 앱이 초기화되지 않았습니다! 암호화 앱이 다시 활성화된 것 같습니다. 암호화 앱을 초기화하려면 로그아웃했다 다시 로그인하십시오.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "개인 키가 올바르지 않습니다! 암호가 %s(예: 회사 디렉터리) 외부에서 변경된 것 같습니다. 암호화된 파일에 다시 접근하려면 개인 설정에서 개인 키 암호를 수정하십시오.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "이 파일을 복호화할 수 없습니다. 공유된 파일일 수도 있습니다. 파일 소유자에게 공유를 다시 요청하십시오.", -"Unknown error please check your system settings or contact your administrator" => "알 수 없는 오류. 시스템 설정을 확인하거나 관리자에게 문의하십시오.", "Missing requirements." => "요구 사항이 부족합니다.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "PHP 5.3.3 이상 설치 여부, PHP의 OpenSSL 확장 기능 활성화 및 설정 여부를 확인하십시오. 암호화 앱이 비활성화 되었습니다.", "Following users are not set up for encryption:" => "다음 사용자는 암호화를 사용할 수 없습니다:", diff --git a/apps/files_encryption/l10n/lt_LT.php b/apps/files_encryption/l10n/lt_LT.php index dd8a0d7633cb52766265f459a6d8a133ec1c69f1..29d9afbaa831cc3a706bb5454faf8b70f879533d 100644 --- a/apps/files_encryption/l10n/lt_LT.php +++ b/apps/files_encryption/l10n/lt_LT.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Šifravimo programa nepaleista! Galbūt šifravimo programa buvo įjungta dar kartą Jūsų sesijos metu. Prašome atsijungti ir vėl prisijungti, kad paleisti šifravimo programą.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Jūsų privatus raktas yra netinkamas! Panašu, kad Jūsų slaptažodis buvo pakeistas už %s (pvz. Jūsų organizacijos kataloge). Galite atnaujinti savo privataus rakto slaptažodį savo asmeniniuose nustatymuose, kad atkurti prieigą prie savo šifruotų failų.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Failo iššifruoti nepavyko, gali būti jog jis yra pasidalintas su jumis. Paprašykite failo savininko, kad jums iš naujo pateiktų šį failą.", -"Unknown error please check your system settings or contact your administrator" => "Neatpažinta klaida, patikrinkite sistemos nustatymus arba kreipkitės į savo sistemos aministratorių", "Missing requirements." => "Trūkstami laukai.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Prašome įsitikinti, kad PHP 5.3.3 ar naujesnė yra įdiegta ir kad OpenSSL kartu su PHP plėtiniu yra šjungti ir teisingai sukonfigūruoti. Kol kas šifravimo programa bus išjungta.", "Following users are not set up for encryption:" => "Sekantys naudotojai nenustatyti šifravimui:", diff --git a/apps/files_encryption/l10n/nb_NO.php b/apps/files_encryption/l10n/nb_NO.php index f7484c0e1543af6f957c42f3c9a3c697fbb01bb6..13ff8077bf66318fce21fb647535f9709021652c 100644 --- a/apps/files_encryption/l10n/nb_NO.php +++ b/apps/files_encryption/l10n/nb_NO.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Krypterings-app ikke initialisert! Kanskje krypterings-appen ble aktivert på nytt i løpet av økten din. Prøv å logge ut og logge inn igjen for å initialisere krypterings-appen.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Din private nøkkel er ikke gyldig! Sannsynligvis ble passordet ditt endret utenfor %s. (f.eks. din bedriftskatalog). Du kan oppdatere passordet for din private nøkkel i dine personlige innstillinger for å gjenvinne tilgang til de krypterte filene dine.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan ikke dekryptere denne filen. Dette er sannsynligvis en delt fil. Spør eieren av filen om å dele den med deg på nytt.", -"Unknown error please check your system settings or contact your administrator" => "Ukjent feil. Sjekk systeminnstillingene dine eller kontakt administratoren", "Missing requirements." => "Manglende krav.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Vennligst se til at PHP 5.3.3 eller nyere er installert og at OpenSSL sammen med PHP-utvidelsen er aktivert og riktig konfigurert. Enn så lenge er krypterings-appen deaktivert.", "Following users are not set up for encryption:" => "Følgende brukere er ikke satt opp for kryptering:", diff --git a/apps/files_encryption/l10n/nl.php b/apps/files_encryption/l10n/nl.php index e878fc6c12eba4208223d0b7b67c8ea7ea3bd4d0..a58bc242daf596bd67acd179244e16f6eb5486f7 100644 --- a/apps/files_encryption/l10n/nl.php +++ b/apps/files_encryption/l10n/nl.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Crypto app niet geïnitialiseerd. Misschien werd de crypto app geheractiveerd tijdens de sessie. Log uit en log daarna opnieuw in om de crypto app te initialiseren.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Uw privésleutel is niet geldig! Waarschijnlijk is uw wachtwoord gewijzigd buiten %s (bijv. uw corporate directory). U kunt uw privésleutel wachtwoord in uw persoonlijke instellingen bijwerken om toegang te krijgen tot uw versleutelde bestanden.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan dit bestand niet ontcijferen, waarschijnlijk is het een gedeeld bestand, Vraag de eigenaar om het bestand opnieuw met u te delen.", -"Unknown error please check your system settings or contact your administrator" => "Onbekende fout, Controleer uw systeeminstellingen of neem contact op met uw systeembeheerder", "Missing requirements." => "Missende benodigdheden.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Wees er zeker van dat PHP5.3.3 of nieuwer is geïstalleerd en dat de OpenSSL PHP extensie is ingeschakeld en correct geconfigureerd. De versleutel-app is voorlopig uitgeschakeld.", "Following users are not set up for encryption:" => "De volgende gebruikers hebben geen configuratie voor encryptie:", diff --git a/apps/files_encryption/l10n/pl.php b/apps/files_encryption/l10n/pl.php index db2a02cec9a78bea5fd84d92f9a126eb219d952f..e756ab4d03946348d901855ade3abf79969401ab 100644 --- a/apps/files_encryption/l10n/pl.php +++ b/apps/files_encryption/l10n/pl.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Szyfrowanie aplikacja nie została zainicjowane! Może szyfrowanie aplikacji zostało ponownie włączone podczas tej sesji. Spróbuj się wylogować i zalogować ponownie aby zainicjować szyfrowanie aplikacji.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Klucz prywatny nie jest poprawny! Prawdopodobnie Twoje hasło zostało zmienione poza %s (np. w katalogu firmy). Aby odzyskać dostęp do zaszyfrowanych plików można zaktualizować hasło klucza prywatnego w ustawieniach osobistych.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Nie można odszyfrować tego pliku, prawdopodobnie jest to plik udostępniony. Poproś właściciela pliku o ponowne udostępnianie pliku Tobie.", -"Unknown error please check your system settings or contact your administrator" => "Nieznany błąd proszę sprawdzić ustawienia systemu lub skontaktuj się z administratorem", "Missing requirements." => "Brak wymagań.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Proszę upewnić się, że PHP 5.3.3 lub nowszy jest zainstalowany i że OpenSSL oraz rozszerzenie PHP jest włączone i poprawnie skonfigurowane. Obecnie szyfrowanie aplikacji zostało wyłączone.", "Following users are not set up for encryption:" => "Następujący użytkownicy nie mają skonfigurowanego szyfrowania:", diff --git a/apps/files_encryption/l10n/pt_BR.php b/apps/files_encryption/l10n/pt_BR.php index 204311658ac5fc19a0e97d95ebfa6e2deae38f8d..d1833e1e59f989d1b92b4ad421f60e52bc9d3f6d 100644 --- a/apps/files_encryption/l10n/pt_BR.php +++ b/apps/files_encryption/l10n/pt_BR.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Aplicativo de criptografia não foi inicializado! Talvez o aplicativo de criptografia tenha sido reativado durante essa sessão. Por favor, tente fazer logoff e login novamente para inicializar o aplicativo de criptografia.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Sua chave privada não é válida! Provavelmente sua senha foi alterada fora de %s (por exemplo, seu diretório corporativo). Você pode atualizar sua senha de chave privada em suas configurações pessoais para recuperar o acesso a seus arquivos criptografados.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Este arquivo não pode ser decriptado, provavelmente este é um arquivo compartilhado. Poe favoe peça ao dono do arquivo para compartilha-lo com você.", -"Unknown error please check your system settings or contact your administrator" => "Erro desconhecido, por favor verifique suas configurações ou faça contato com o administrador", "Missing requirements." => "Requisitos não encontrados.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, certifique-se que o PHP 5.3.3 ou mais recente está instalado e que a extensão PHP OpenSSL está habilitado e configurado corretamente. Por enquanto, o aplicativo de criptografia foi desativado.", "Following users are not set up for encryption:" => "Seguintes usuários não estão configurados para criptografia:", diff --git a/apps/files_encryption/l10n/pt_PT.php b/apps/files_encryption/l10n/pt_PT.php index 9a1963953e3427e2b07dd7c6afb60b19c11c9bc0..0827fb51b0cdad1859870919ef80a0c55aed72ae 100644 --- a/apps/files_encryption/l10n/pt_PT.php +++ b/apps/files_encryption/l10n/pt_PT.php @@ -8,19 +8,22 @@ $TRANSLATIONS = array( "Could not change the password. Maybe the old password was not correct." => "Não foi possivel alterar a password. Possivelmente a password antiga não está correcta.", "Could not update the private key password. Maybe the old password was not correct." => "Não foi possível alterar a chave. Possivelmente a password antiga não está correcta.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Não foi possível desencriptar este ficheiro, possivelmente é um ficheiro partilhado. Peça ao proprietário do ficheiro para voltar a partilhar o ficheiro consigo.", -"Unknown error please check your system settings or contact your administrator" => "Erro desconhecido. Verifique por favor as definições do sistema ou contacte o seu administrador", "Missing requirements." => "Faltam alguns requisitos.", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, certifique-se que PHP 5.3.3 ou mais recente está instalado e que OpenSSL juntamente com a extensão PHP está ativada e corretamente configurada. Por agora, a aplicação de encriptação está desactivada.", "Following users are not set up for encryption:" => "Os utilizadores seguintes não estão marcados para cifragem:", +"Initial encryption started... This can take some time. Please wait." => "A encriptação inicial começou... Pode demorar algum tempo. Aguarde, por favor.", "Go directly to your " => "Ir directamente para o seu", "personal settings" => "configurações personalizadas ", "Encryption" => "Encriptação", "Enable recovery key (allow to recover users files in case of password loss):" => "Active a chave de recuperação (permite recuperar os ficheiros no caso de perda da password):", "Recovery key password" => "Chave de recuperação da conta", +"Repeat Recovery key password" => "Repetir a chave de recuperação da conta", "Enabled" => "Activado", "Disabled" => "Desactivado", "Change recovery key password:" => "Alterar a chave de recuperação:", "Old Recovery key password" => "Chave anterior de recuperação da conta", "New Recovery key password" => "Nova chave de recuperação da conta", +"Repeat New Recovery key password" => "Repetir a nova chave de recuperação da conta", "Change Password" => "Mudar a Password", "Old log-in password" => "Password anterior da conta", "Current log-in password" => "Password actual da conta", diff --git a/apps/files_encryption/l10n/ru.php b/apps/files_encryption/l10n/ru.php index ba98486893200cf01f125805184b6ecf976fa17a..31c109df7cdc60acfe894d8dba14afad7f308861 100644 --- a/apps/files_encryption/l10n/ru.php +++ b/apps/files_encryption/l10n/ru.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Приложение шифрации не инициализированно! Возможно приложение шифрации было реактивировано во время вашей сессии. Пожалуйста, попробуйте выйти и войти снова чтобы проинициализировать приложение шифрации.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Ваш секретный ключ не действителен! Вероятно, ваш пароль был изменен вне %s (например, корпоративный каталог). Вы можете обновить секретный ключ в личных настройках на странице восстановления доступа к зашифрованным файлам. ", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Не могу расшифровать файл, возможно это опубликованный файл. Пожалуйста, попросите владельца файла поделиться им с вами еще раз.", -"Unknown error please check your system settings or contact your administrator" => "Неизвестная ошибка, пожалуйста, проверьте системные настройки или свяжитесь с администратором", "Missing requirements." => "Требования отсутствуют.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Пожалуйста, убедитесь, что версия PHP 5.3.3 или новее, а также, что OpenSSL и соответствующее расширение PHP включены и правильно настроены. На данный момент приложение шифрования отключено.", "Following users are not set up for encryption:" => "Для следующих пользователей шифрование не настроено:", diff --git a/apps/files_encryption/l10n/sk_SK.php b/apps/files_encryption/l10n/sk_SK.php index 53ee2bc0303dc43c6674b8a843fb7ac595dae0f4..9b93cee6f802160181c2c700a405f75b213a9cbd 100644 --- a/apps/files_encryption/l10n/sk_SK.php +++ b/apps/files_encryption/l10n/sk_SK.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Šifrovacia aplikácia nie je inicializovaná. Je možné, že aplikácia bola znova aktivovaná počas vášho prihlasovania. Pokúste sa odhlásiť a znova prihlásiť pre inicializáciu šifrovania.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Váš súkromný kľúč nie je platný! Možno bolo vaše heslo zmenené mimo %s (napr. firemný priečinok). Môžete si aktualizovať heslo svojho ​​súkromného kľúča vo vašom osobnom nastavení, ak si chcete obnoviť prístup k šifrovaným súborom.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Tento súbor sa nepodarilo dešifrovať, pravdepodobne je zdieľaný. Požiadajte majiteľa súboru, aby ho s vami znovu vyzdieľal.", -"Unknown error please check your system settings or contact your administrator" => "Neznáma chyba, skontrolujte si vaše systémové nastavenia alebo kontaktujte administrátora", "Missing requirements." => "Chýbajúce požiadavky.", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Prosím uistite sa, že PHP verzie 5.3.3 alebo novšej je nainštalované a tiež, že OpenSSL knižnica spolu z PHP rozšírením je povolená a konfigurovaná správne. Nateraz bola aplikácia šifrovania zablokovaná.", "Following users are not set up for encryption:" => "Nasledujúci používatelia nie sú nastavení pre šifrovanie:", diff --git a/apps/files_encryption/l10n/sl.php b/apps/files_encryption/l10n/sl.php index e581f9323c2a701c0f01128e559b42b42dbd5818..5f72b54fee9a533c2f0f80fd1f12f1e0d27396d0 100644 --- a/apps/files_encryption/l10n/sl.php +++ b/apps/files_encryption/l10n/sl.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Program za šifriranje ni začet. Morda je bil program ponovno omogočen šele med zagonom trenutne seje. Odjavite se in se nato prijavite nazaj. S tem morda razrešite napako.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Zasebni ključ ni veljaven. Najverjetneje je bilo geslo spremenjeno izven %s (najverjetneje je to poslovna mapa). Geslo lahko posodobite med osebnimi nastavitvami in s tem obnovite dostop do šifriranih datotek.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Te datoteke ni mogoče šifrirati, ker je to najverjetneje datoteka v souporabi. Prosite lastnika datoteke, da jo da ponovno v souporabo.", -"Unknown error please check your system settings or contact your administrator" => "Prišlo je do neznane napake. Preverite nastavitve sistema ali pa stopite v stik s skrbnikom sistema.", "Missing requirements." => "Manjkajoče zahteve", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Preverite, ali je na strežniku nameščen paket PHP 5.3.3 ali novejši, da je omogočen in pravilno nastavljen PHP OpenSSL. Z obstoječimi možnostmi šifriranje ni mogoče.", "Following users are not set up for encryption:" => "Navedeni uporabniki še nimajo nastavljenega šifriranja:", diff --git a/apps/files_encryption/l10n/sv.php b/apps/files_encryption/l10n/sv.php index b17740f25410cb2449d2965b06b01ee7c510623d..3d6401c1d55bb6eca03e0f169ac26b0b82603eec 100644 --- a/apps/files_encryption/l10n/sv.php +++ b/apps/files_encryption/l10n/sv.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Krypteringsprogrammet kunde inte initieras! Möjligen blev krypteringsprogrammet återaktiverad under din session. Försök med att logga ut och in igen för att initiera krypteringsprogrammet.", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Din privata lösenordsnyckel är inte giltig! Troligen har ditt lösenord ändrats utanför %s (t.ex. i företagets katalogtjänst). Du kan uppdatera den privata lösenordsnyckeln under dina personliga inställningar för att återfå tillgång till dina filer.", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.", -"Unknown error please check your system settings or contact your administrator" => "Oväntat fel, kolla dina system inställningar eller kontakta din administratör", "Missing requirements." => "Krav som saknas", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Kontrollera att PHP 5.3.3 eller senare är installerad och att tillägget OpenSSL PHP är aktiverad och korrekt konfigurerad. Kryptering är tillsvidare inaktiverad.", "Following users are not set up for encryption:" => "Följande användare har inte aktiverat kryptering:", diff --git a/apps/files_encryption/l10n/tr.php b/apps/files_encryption/l10n/tr.php index 85e35f5dddf93ad177c59f3132ac8d0899913d42..2828b1b5915fd48a195eb8c233e191cdcc5c9e15 100644 --- a/apps/files_encryption/l10n/tr.php +++ b/apps/files_encryption/l10n/tr.php @@ -6,29 +6,28 @@ $TRANSLATIONS = array( "Could not disable recovery key. Please check your recovery key password!" => "Kurtarma anahtarı devre dışı bırakılamadı. Lütfen kurtarma anahtarı parolanızı kontrol edin!", "Password successfully changed." => "Parola başarıyla değiştirildi.", "Could not change the password. Maybe the old password was not correct." => "Parola değiştirilemedi. Eski parolanız doğru olmayabilir.", -"Private key password successfully updated." => "Gizli anahtar parolası başarıyla güncellendi", -"Could not update the private key password. Maybe the old password was not correct." => "Gizli anahtar parolası güncellenemedi. Eski parola hatalı olabilir.", +"Private key password successfully updated." => "Özel anahtar parolası başarıyla güncellendi.", +"Could not update the private key password. Maybe the old password was not correct." => "Özel anahtar parolası güncellenemedi. Eski parola hatalı olabilir.", "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "Şifreleme uygulaması başlatılamadı! Oturumunuz sırasında şifreleme uygulaması tekrar etkinleştirilmiş olabilir. Lütfen şifreleme uygulamasını başlatmak için oturumu kapatıp yeniden oturum açmayı deneyin.", -"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Gizli anahtarınız geçerli değil! Muhtemelen parolanız ownCloud sistemi %s dışarısında değiştirildi (örn. şirket dizininde). Gizli anahtar parolanızı kişisel ayarlarınızda güncelleyerek şifreli dosyalarınıza erişimi kurtarabilirsiniz.", -"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Bu dosya muhtemelen bir paylaşılan dosya olduğundan şifresi çözülemiyor. Lütfen dosyayı sizinle bir daha paylaşması için dosya sahibi ile iletişime geçin.", -"Unknown error please check your system settings or contact your administrator" => "Bilinmeyen hata. Lütfen sistem ayarlarınızı denetleyin veya yöneticiniz ile iletişime geçin", +"Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Özel anahtarınız geçerli değil! Muhtemelen parolanız %s dışarısında değiştirildi (örn. şirket dizininde). Gizli anahtar parolanızı kişisel ayarlarınızda güncelleyerek şifreli dosyalarınıza erişimi kurtarabilirsiniz.", +"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Bu dosya muhtemelen bir paylaşılan dosya olduğundan şifrelemesi kaldırılamıyor. Lütfen dosyayı sizinle bir daha paylaşması için dosya sahibi ile iletişime geçin.", "Missing requirements." => "Gereklilikler eksik.", -"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "PHP 5.3.3 veya daha sürümü ile birlikte OpenSSL ve OpenSSL PHP uzantısının birlikte etkin olduğunu ve doğru bir şekilde yapılandırıldığından emin olun. Şimdilik şifreleme uygulaması devre dışı bırakıldı", -"Following users are not set up for encryption:" => "Aşağıdaki kullanıcılar şifreleme için ayarlanmadılar:", +"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "PHP 5.3.3 veya daha sürümü ile birlikte OpenSSL ve OpenSSL PHP uzantısının birlikte etkin olduğundan ve doğru bir şekilde yapılandırıldığından emin olun. Şimdilik şifreleme uygulaması devre dışı bırakıldı.", +"Following users are not set up for encryption:" => "Aşağıdaki kullanıcılar şifreleme için ayarlanmamış:", "Initial encryption started... This can take some time. Please wait." => "İlk şifreleme başladı... Bu biraz zaman alabilir. Lütfen bekleyin.", "Initial encryption running... Please try again later." => "İlk şifreleme çalışıyor... Lütfen daha sonra tekrar deneyin.", -"Go directly to your " => "Doğrudan şuraya gidin:", -"personal settings" => "kişisel ayarlar", +"Go directly to your " => "Doğrudan ", +"personal settings" => "kişisel ayarlarınıza gidin", "Encryption" => "Şifreleme", "Enable recovery key (allow to recover users files in case of password loss):" => "Kurtarma anahtarını etkinleştir (parola kaybı durumunda kullanıcı dosyalarının kurtarılmasına izin verir):", "Recovery key password" => "Kurtarma anahtarı parolası", -"Repeat Recovery key password" => "Kurtarma anahtarı parolasını yenileyin", -"Enabled" => "Etkinleştirildi", -"Disabled" => "Devre dışı", +"Repeat Recovery key password" => "Kurtarma anahtarı parolasını yineleyin", +"Enabled" => "Etkin", +"Disabled" => "Devre Dışı", "Change recovery key password:" => "Kurtarma anahtarı parolasını değiştir:", -"Old Recovery key password" => "Eski Kurtarma anahtar parolası", -"New Recovery key password" => "Yeni Kurtarma anahtar parolası", -"Repeat New Recovery key password" => "Yeni Kurtarma anahtarı parolasını yenileyin", +"Old Recovery key password" => "Eski Kurtarma anahtarı parolası", +"New Recovery key password" => "Yeni Kurtarma anahtarı parolası", +"Repeat New Recovery key password" => "Yeni Kurtarma anahtarı parolasını yineleyin", "Change Password" => "Parola Değiştir", "Your private key password no longer match your log-in password:" => "Özel anahtar parolanız artık oturum açma parolanızla eşleşmiyor:", "Set your old private key password to your current log-in password." => "Eski özel anahtar parolanızı geçerli oturum açma parolanız olarak ayarlayın.", diff --git a/apps/files_encryption/l10n/zh_TW.php b/apps/files_encryption/l10n/zh_TW.php index 84146437ac0b590b794cc54a9e3cb4f329d79e9c..e4954443cc656900dec71f0bc2b7d6759e27c42e 100644 --- a/apps/files_encryption/l10n/zh_TW.php +++ b/apps/files_encryption/l10n/zh_TW.php @@ -11,7 +11,6 @@ $TRANSLATIONS = array( "Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app." => "加密功能未初始化!可能加密功能需要重新啟用在現在的連線上。請試著登出再登入來初始化加密功能。", "Your private key is not valid! Likely your password was changed outside of %s (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "您的私人金鑰不正確!可能您的密碼已經變更在外部的 %s (例如:您的企業目錄)。您可以在您的個人設定中更新私人金鑰密碼來還原存取您的加密檔案。", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "無法解密這個檔案,也許這是分享的檔案。請詢問檔案所有人重新分享檔案給您。", -"Unknown error please check your system settings or contact your administrator" => "未知錯誤請檢查您的系統設定或是聯絡您的管理員", "Missing requirements." => "遺失必要條件。", "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "請確認已安裝 PHP 5.3.3 或是更新的版本以及 OpenSSL 也一併安裝在 PHP extension 裡面並啟用及設置完成。現在,加密功能是停用的。", "Following users are not set up for encryption:" => "以下的使用者無法設定加密:", diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index a4f7bd35497543c000c43358b0118a6c482ef6e6..ec7b3bc92e47c20994769c97804cb4232a9914dc 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -40,7 +40,7 @@ class Crypt { /** - * @brief return encryption mode client or server side encryption + * return encryption mode client or server side encryption * @param string $user name (use system wide setting if name=null) * @return string 'client' or 'server' */ @@ -51,7 +51,7 @@ class Crypt { } /** - * @brief Create a new encryption keypair + * Create a new encryption keypair * @return array publicKey, privatekey */ public static function createKeypair() { @@ -85,7 +85,7 @@ class Crypt { } /** - * @brief Add arbitrary padding to encrypted data + * Add arbitrary padding to encrypted data * @param string $data data to be padded * @return string padded data * @note In order to end up with data exactly 8192 bytes long we must @@ -102,7 +102,7 @@ class Crypt { } /** - * @brief Remove arbitrary padding to encrypted data + * Remove arbitrary padding to encrypted data * @param string $padded padded data to remove padding from * @return string unpadded data on success, false on error */ @@ -124,8 +124,8 @@ class Crypt { } /** - * @brief Check if a file's contents contains an IV and is symmetrically encrypted - * @param $content + * Check if a file's contents contains an IV and is symmetrically encrypted + * @param string $content * @return boolean * @note see also OCA\Encryption\Util->isEncryptedPath() */ @@ -178,11 +178,10 @@ class Crypt { } /** - * @brief Check if a file is encrypted via legacy system - * @param $data + * Check if a file is encrypted via legacy system + * @param boolean $isCatFileContent * @param string $relPath The path of the file, relative to user/data; * e.g. filename or /Docs/filename, NOT admin/files/filename - * @param boolean $isCatFileContent * @return boolean */ public static function isLegacyEncryptedContent($isCatFileContent, $relPath) { @@ -209,7 +208,7 @@ class Crypt { } /** - * @brief Symmetrically encrypt a string + * Symmetrically encrypt a string * @param string $plainContent * @param string $iv * @param string $passphrase @@ -229,7 +228,7 @@ class Crypt { } /** - * @brief Symmetrically decrypt a string + * Symmetrically decrypt a string * @param string $encryptedContent * @param string $iv * @param string $passphrase @@ -251,10 +250,10 @@ class Crypt { } /** - * @brief Concatenate encrypted data with its IV and padding + * Concatenate encrypted data with its IV and padding * @param string $content content to be concatenated * @param string $iv IV to be concatenated - * @returns string concatenated content + * @return string concatenated content */ private static function concatIv($content, $iv) { @@ -265,9 +264,9 @@ class Crypt { } /** - * @brief Split concatenated data and IV into respective parts + * Split concatenated data and IV into respective parts * @param string $catFile concatenated data to be split - * @returns array keys: encrypted, iv + * @return array keys: encrypted, iv */ private static function splitIv($catFile) { @@ -290,7 +289,7 @@ class Crypt { } /** - * @brief Symmetrically encrypts a string and returns keyfile content + * Symmetrically encrypts a string and returns keyfile content * @param string $plainContent content to be encrypted in keyfile * @param string $passphrase * @return false|string encrypted content combined with IV @@ -322,15 +321,15 @@ class Crypt { /** - * @brief Symmetrically decrypts keyfile content - * @param $keyfileContent + * Symmetrically decrypts keyfile content + * @param string $keyfileContent * @param string $passphrase * @throws \Exception * @return string|false * @internal param string $source * @internal param string $target * @internal param string $key the decryption key - * @returns string decrypted content + * @return string decrypted content * * This function decrypts a file */ @@ -359,10 +358,10 @@ class Crypt { } /** - * @brief Decrypt private key and check if the result is a valid keyfile + * Decrypt private key and check if the result is a valid keyfile * @param string $encryptedKey encrypted keyfile * @param string $passphrase to decrypt keyfile - * @returns encrypted private key or false + * @return string|false encrypted private key or false * * This function decrypts a file */ @@ -386,10 +385,10 @@ class Crypt { } /** - * @brief Create asymmetrically encrypted keyfile content using a generated key + * Create asymmetrically encrypted keyfile content using a generated key * @param string $plainContent content to be encrypted * @param array $publicKeys array keys must be the userId of corresponding user - * @returns array keys: keys (array, key = userId), data + * @return array keys: keys (array, key = userId), data * @note symmetricDecryptFileContent() can decrypt files created using this method */ public static function multiKeyEncrypt($plainContent, array $publicKeys) { @@ -434,13 +433,13 @@ class Crypt { } /** - * @brief Asymmetrically encrypt a file using multiple public keys - * @param $encryptedContent - * @param $shareKey - * @param $privateKey + * Asymmetrically encrypt a file using multiple public keys + * @param string $encryptedContent + * @param string $shareKey + * @param mixed $privateKey * @return false|string * @internal param string $plainContent content to be encrypted - * @returns string $plainContent decrypted string + * @return string $plainContent decrypted string * @note symmetricDecryptFileContent() can be used to decrypt files created using this method * * This function decrypts a file @@ -468,7 +467,7 @@ class Crypt { } /** - * @brief Generates a pseudo random initialisation vector + * Generates a pseudo random initialisation vector * @return String $iv generated IV */ private static function generateIv() { @@ -497,8 +496,8 @@ class Crypt { } /** - * @brief Generate a pseudo random 256-bit ASCII key, used as file key - * @returns $key Generated key + * Generate a pseudo random 256-bit ASCII key, used as file key + * @return string|false Generated key */ public static function generateKey() { @@ -523,8 +522,8 @@ class Crypt { } /** - * @brief Get the blowfish encryption handler for a key - * @param $key string (optional) + * Get the blowfish encryption handler for a key + * @param string $key (optional) * @return \Crypt_Blowfish blowfish object * * if the key is left out, the default handler will be used @@ -544,7 +543,7 @@ class Crypt { } /** - * @brief decrypts content using legacy blowfish system + * decrypts content using legacy blowfish system * @param string $content the cleartext message you want to decrypt * @param string $passphrase * @return string cleartext content @@ -561,7 +560,7 @@ class Crypt { } /** - * @param $data + * @param string $data * @param string $key * @param int $maxLength * @return string diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 8cbbe8a45a6ef62f638a675414d392f486887ba4..564e97e0592765dcea1878b25dd45e6b66d65837 100755 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -24,7 +24,7 @@ namespace OCA\Encryption; /** - * @brief Class to manage registration of hooks an various helper methods + * Class to manage registration of hooks an various helper methods * @package OCA\Encryption */ class Helper { @@ -32,7 +32,7 @@ class Helper { private static $tmpFileMapping; // Map tmp files to files in data/user/files /** - * @brief register share related hooks + * register share related hooks * */ public static function registerShareHooks() { @@ -43,7 +43,7 @@ class Helper { } /** - * @brief register user related hooks + * register user related hooks * */ public static function registerUserHooks() { @@ -56,7 +56,7 @@ class Helper { } /** - * @brief register filesystem related hooks + * register filesystem related hooks * */ public static function registerFilesystemHooks() { @@ -68,7 +68,7 @@ class Helper { } /** - * @brief register app management related hooks + * register app management related hooks * */ public static function registerAppHooks() { @@ -78,7 +78,7 @@ class Helper { } /** - * @brief setup user for files_encryption + * setup user for files_encryption * * @param Util $util * @param string $password @@ -100,9 +100,9 @@ class Helper { } /** - * @brief enable recovery + * enable recovery * - * @param $recoveryKeyId + * @param string $recoveryKeyId * @param string $recoveryPassword * @internal param \OCA\Encryption\Util $util * @internal param string $password @@ -153,7 +153,7 @@ class Helper { $return = true; } else { // get recovery key and check the password - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser()); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \OCP\User::getUser()); $return = $util->checkRecoveryPassword($recoveryPassword); if ($return) { $appConfig->setValue('files_encryption', 'recoveryAdminEnabled', 1); @@ -164,7 +164,7 @@ class Helper { } /** - * @brief Check if a path is a .part file + * Check if a path is a .part file * @param string $path Path that may identify a .part file * @return bool */ @@ -181,7 +181,7 @@ class Helper { /** - * @brief Remove .path extension from a file path + * Remove .path extension from a file path * @param string $path Path that may identify a .part file * @return string File path without .part extension * @note this is needed for reusing keys @@ -208,13 +208,13 @@ class Helper { } /** - * @brief disable recovery + * disable recovery * * @param string $recoveryPassword * @return bool */ public static function adminDisableRecovery($recoveryPassword) { - $util = new Util(new \OC_FilesystemView('/'), \OCP\User::getUser()); + $util = new Util(new \OC\Files\View('/'), \OCP\User::getUser()); $return = $util->checkRecoveryPassword($recoveryPassword); if ($return) { @@ -227,7 +227,7 @@ class Helper { /** - * @brief checks if access is public/anonymous user + * checks if access is public/anonymous user * @return bool */ public static function isPublicAccess() { @@ -239,7 +239,7 @@ class Helper { } /** - * @brief Format a path to be relative to the /user/files/ directory + * Format a path to be relative to the /user/files/ directory * @param string $path the absolute path * @return string e.g. turns '/admin/files/test.txt' into 'test.txt' */ @@ -259,7 +259,7 @@ class Helper { } /** - * @brief try to get the user from the path if no user is logged in + * try to get the user from the path if no user is logged in * @param string $path * @return mixed user or false if we couldn't determine a user */ @@ -294,7 +294,7 @@ class Helper { } /** - * @brief get path to the corresponding file in data/user/files if path points + * get path to the corresponding file in data/user/files if path points * to a version or to a file in cache * @param string $path path to a version or a file in the trash * @return string path to corresponding file relative to data/user/files @@ -327,12 +327,12 @@ class Helper { } /** - * @brief create directory recursively + * create directory recursively * @param string $path * @param \OC\Files\View $view */ public static function mkdirr($path, $view) { - $dirname = \OC_Filesystem::normalizePath(dirname($path)); + $dirname = \OC\Files\Filesystem::normalizePath(dirname($path)); $dirParts = explode('/', $dirname); $dir = ""; foreach ($dirParts as $part) { @@ -344,7 +344,7 @@ class Helper { } /** - * @brief redirect to a error page + * redirect to a error page * @param Session $session */ public static function redirectToErrorPage($session, $errorCode = null) { @@ -428,7 +428,7 @@ class Helper { } /** - * @brief glob uses different pattern than regular expressions, escape glob pattern only + * glob uses different pattern than regular expressions, escape glob pattern only * @param string $path unescaped path * @return string path */ @@ -437,7 +437,7 @@ class Helper { } /** - * @brief remember from which file the tmp file (getLocalFile() call) was created + * remember from which file the tmp file (getLocalFile() call) was created * @param string $tmpFile path of tmp file * @param string $originalFile path of the original file relative to data/ */ @@ -446,7 +446,7 @@ class Helper { } /** - * @brief get the path of the original file + * get the path of the original file * @param string $tmpFile path of the tmp file * @return string|false path of the original file or false */ diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php index cb9f5e64af37aa3e54f64a0b18ddfa959a61fbc9..3c51c5efba20759d6ceab8fbb157528aedbc2d81 100755 --- a/apps/files_encryption/lib/keymanager.php +++ b/apps/files_encryption/lib/keymanager.php @@ -24,20 +24,20 @@ namespace OCA\Encryption; /** - * @brief Class to manage storage and retrieval of encryption keys + * Class to manage storage and retrieval of encryption keys * @note Where a method requires a view object, it's root must be '/' */ class Keymanager { /** - * @brief retrieve the ENCRYPTED private key from a user + * retrieve the ENCRYPTED private key from a user * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param string $user * @return string private key or false (hopefully) * @note the key returned by this method must be decrypted before use */ - public static function getPrivateKey(\OC_FilesystemView $view, $user) { + public static function getPrivateKey(\OC\Files\View $view, $user) { $path = '/' . $user . '/' . 'files_encryption' . '/' . $user . '.private.key'; $key = false; @@ -55,12 +55,12 @@ class Keymanager { } /** - * @brief retrieve public key for a specified user - * @param \OC_FilesystemView $view - * @param $userId + * retrieve public key for a specified user + * @param \OC\Files\View $view + * @param string $userId * @return string public key or false */ - public static function getPublicKey(\OC_FilesystemView $view, $userId) { + public static function getPublicKey(\OC\Files\View $view, $userId) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -74,12 +74,12 @@ class Keymanager { } /** - * @brief Retrieve a user's public and private key - * @param \OC_FilesystemView $view - * @param $userId + * Retrieve a user's public and private key + * @param \OC\Files\View $view + * @param string $userId * @return array keys: privateKey, publicKey */ - public static function getUserKeys(\OC_FilesystemView $view, $userId) { + public static function getUserKeys(\OC\Files\View $view, $userId) { return array( 'publicKey' => self::getPublicKey($view, $userId), @@ -89,12 +89,12 @@ class Keymanager { } /** - * @brief Retrieve public keys for given users - * @param \OC_FilesystemView $view + * Retrieve public keys for given users + * @param \OC\Files\View $view * @param array $userIds * @return array of public keys for the specified users */ - public static function getPublicKeys(\OC_FilesystemView $view, array $userIds) { + public static function getPublicKeys(\OC\Files\View $view, array $userIds) { $keys = array(); @@ -109,9 +109,9 @@ class Keymanager { } /** - * @brief store file encryption key + * store file encryption key * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param \OCA\Encryption\Util $util * @param string $path relative path of the file, including filename * @param string $catfile keyfile content @@ -119,7 +119,7 @@ class Keymanager { * @note The keyfile is not encrypted here. Client code must * asymmetrically encrypt the keyfile before passing it to this method */ - public static function setFileKey(\OC_FilesystemView $view, $util, $path, $catfile) { + public static function setFileKey(\OC\Files\View $view, $util, $path, $catfile) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -167,8 +167,8 @@ class Keymanager { } /** - * @brief retrieve keyfile for an encrypted file - * @param \OC_FilesystemView $view + * retrieve keyfile for an encrypted file + * @param \OC\Files\View $view * @param \OCA\Encryption\Util $util * @param string|false $filePath * @internal param \OCA\Encryption\file $string name @@ -210,9 +210,9 @@ class Keymanager { } /** - * @brief Delete a keyfile + * Delete a keyfile * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param string $path path of the file the key belongs to * @param string $userId the user to whom the file belongs * @return bool Outcome of unlink operation @@ -266,7 +266,7 @@ class Keymanager { } /** - * @brief store private key from the user + * store private key from the user * @param string $key * @return bool * @note Encryption of the private key must be performed by client code @@ -276,7 +276,7 @@ class Keymanager { $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/' . $user . '/files_encryption'); + $view = new \OC\Files\View('/' . $user . '/files_encryption'); $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -293,16 +293,16 @@ class Keymanager { } /** - * @brief store share key + * store share key * - * @param \OC_FilesystemView $view + * @param \OC\Files\View $view * @param string $path where the share key is stored - * @param $shareKey + * @param string $shareKey * @return bool true/false * @note The keyfile is not encrypted here. Client code must * asymmetrically encrypt the keyfile before passing it to this method */ - private static function setShareKey(\OC_FilesystemView $view, $path, $shareKey) { + private static function setShareKey(\OC\Files\View $view, $path, $shareKey) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -319,14 +319,14 @@ class Keymanager { } /** - * @brief store multiple share keys for a single file - * @param \OC_FilesystemView $view + * store multiple share keys for a single file + * @param \OC\Files\View $view * @param \OCA\Encryption\Util $util * @param string $path * @param array $shareKeys * @return bool */ - public static function setShareKeys(\OC_FilesystemView $view, $util, $path, array $shareKeys) { + public static function setShareKeys(\OC\Files\View $view, $util, $path, array $shareKeys) { // $shareKeys must be an array with the following format: // [userId] => [encrypted key] @@ -365,8 +365,8 @@ class Keymanager { } /** - * @brief retrieve shareKey for an encrypted file - * @param \OC_FilesystemView $view + * retrieve shareKey for an encrypted file + * @param \OC\Files\View $view * @param string $userId * @param \OCA\Encryption\Util $util * @param string $filePath @@ -374,7 +374,7 @@ class Keymanager { * @note The sharekey returned is encrypted. Decryption * of the keyfile must be performed by client code */ - public static function getShareKey(\OC_FilesystemView $view, $userId, $util, $filePath) { + public static function getShareKey(\OC\Files\View $view, $userId, $util, $filePath) { // try reusing key file if part file $proxyStatus = \OC_FileProxy::$enabled; @@ -406,8 +406,8 @@ class Keymanager { } /** - * @brief delete all share keys of a given file - * @param \OC_FilesystemView $view + * delete all share keys of a given file + * @param \OC\Files\View $view * @param string $userId owner of the file * @param string $filePath path to the file, relative to the owners file dir */ @@ -445,9 +445,9 @@ class Keymanager { } /** - * @brief Delete a single user's shareKey for a single file + * Delete a single user's shareKey for a single file */ - public static function delShareKey(\OC_FilesystemView $view, $userIds, $filePath) { + public static function delShareKey(\OC\Files\View $view, $userIds, $filePath) { $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; @@ -486,7 +486,7 @@ class Keymanager { } /** - * @brief recursively delete share keys from given users + * recursively delete share keys from given users * * @param string $dir directory * @param array $userIds user ids for which the share keys should be deleted @@ -512,11 +512,11 @@ class Keymanager { } /** - * @brief Make preparations to vars and filesystem for saving a keyfile + * Make preparations to vars and filesystem for saving a keyfile * @param string|boolean $path * @param string $basePath */ - public static function keySetPreparation(\OC_FilesystemView $view, $path, $basePath, $userId) { + public static function keySetPreparation(\OC\Files\View $view, $path, $basePath, $userId) { $targetPath = ltrim($path, '/'); @@ -542,7 +542,7 @@ class Keymanager { } /** - * @brief extract filename from share key name + * extract filename from share key name * @param string $shareKey (filename.userid.sharekey) * @return string|false filename or false */ diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 7be82c313e494805129809658341399777f74d13..ae3df834e9f417394a65f732b0338c4a736b5a57 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -24,7 +24,7 @@ */ /** - * @brief Encryption proxy which handles filesystem operations before and after + * Encryption proxy which handles filesystem operations before and after * execution and encrypts, and handles keyfiles accordingly. Used for * webui. */ @@ -65,7 +65,7 @@ class Proxy extends \OC_FileProxy { return false; } - $view = new \OC_FilesystemView(''); + $view = new \OC\Files\View(''); $util = new Util($view, $userId); // for write operation we always encrypt the files, for read operations @@ -79,8 +79,8 @@ class Proxy extends \OC_FileProxy { } /** - * @param $path - * @param $data + * @param string $path + * @param string $data * @return bool */ public function preFile_put_contents($path, &$data) { @@ -90,7 +90,7 @@ class Proxy extends \OC_FileProxy { if (!is_resource($data)) { // get root view - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // get relative path $relativePath = \OCA\Encryption\Helper::stripUserFilesPath($path); @@ -101,7 +101,7 @@ class Proxy extends \OC_FileProxy { // create random cache folder $cacheFolder = rand(); - $path_slices = explode('/', \OC_Filesystem::normalizePath($path)); + $path_slices = explode('/', \OC\Files\Filesystem::normalizePath($path)); $path_slices[2] = "cache/".$cacheFolder; $tmpPath = implode('/', $path_slices); @@ -125,7 +125,7 @@ class Proxy extends \OC_FileProxy { // in the post proxy $tmpFileInfo = $view->getFileInfo($tmpPath); if ( isset($tmpFileInfo['size']) ) { - self::$unencryptedSizes[\OC_Filesystem::normalizePath($path)] = $tmpFileInfo['size']; + self::$unencryptedSizes[\OC\Files\Filesystem::normalizePath($path)] = $tmpFileInfo['size']; } // remove our temp file @@ -144,15 +144,15 @@ class Proxy extends \OC_FileProxy { } /** - * @brief update file cache with the new unencrypted size after file was written + * update file cache with the new unencrypted size after file was written * @param string $path * @param mixed $result * @return mixed */ public function postFile_put_contents($path, $result) { - $normalizedPath = \OC_Filesystem::normalizePath($path); + $normalizedPath = \OC\Files\Filesystem::normalizePath($path); if ( isset(self::$unencryptedSizes[$normalizedPath]) ) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $view->putFileInfo($normalizedPath, array('encrypted' => true, 'unencrypted_size' => self::$unencryptedSizes[$normalizedPath])); unset(self::$unencryptedSizes[$normalizedPath]); @@ -168,7 +168,7 @@ class Proxy extends \OC_FileProxy { public function postFile_get_contents($path, $data) { $plainData = null; - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); // init session $session = new \OCA\Encryption\Session($view); @@ -212,7 +212,7 @@ class Proxy extends \OC_FileProxy { } /** - * @brief remember initial fopen mode because sometimes it gets changed during the request + * remember initial fopen mode because sometimes it gets changed during the request * @param string $path path * @param string $mode type of access */ @@ -225,8 +225,8 @@ class Proxy extends \OC_FileProxy { /** - * @param $path - * @param $result + * @param string $path + * @param resource $result * @return resource */ public function postFopen($path, &$result) { @@ -261,8 +261,8 @@ class Proxy extends \OC_FileProxy { } /** - * @param $path - * @param $data + * @param string $path + * @param array $data * @return array */ public function postGetFileInfo($path, $data) { @@ -285,13 +285,13 @@ class Proxy extends \OC_FileProxy { } /** - * @param $path - * @param $size - * @return bool + * @param string $path + * @param int $size + * @return int|bool */ public function postFileSize($path, $size) { - $view = new \OC_FilesystemView('/'); + $view = new \OC\Files\View('/'); $userId = Helper::getUser($path); $util = new Util($view, $userId); diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php index 3daaa06425faf30dcbb5b65c7a6334780bb75f06..93be6691f96bbc0d0e6db2db632f7b8a1357782a 100644 --- a/apps/files_encryption/lib/session.php +++ b/apps/files_encryption/lib/session.php @@ -36,8 +36,8 @@ class Session { /** - * @brief if session is started, check if ownCloud key pair is set up, if not create it - * @param \OC_FilesystemView $view + * if session is started, check if ownCloud key pair is set up, if not create it + * @param \OC\Files\View $view * * @note The ownCloud key pair is used to allow public link sharing even if encryption is enabled */ @@ -105,7 +105,7 @@ class Session { } /** - * @brief Sets user private key to session + * Sets user private key to session * @param string $privateKey * @return bool * @@ -120,8 +120,8 @@ class Session { } /** - * @brief Sets status of encryption app - * @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED + * Sets status of encryption app + * @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED * @return bool * * @note this doesn not indicate of the init was successful, we just remeber the try! @@ -135,7 +135,7 @@ class Session { } /** - * @brief remove encryption keys and init status from session + * remove encryption keys and init status from session */ public function closeSession() { \OC::$session->remove('encryptionInitialized'); @@ -144,8 +144,8 @@ class Session { /** - * @brief Gets status if we already tried to initialize the encryption app - * @returns init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED + * Gets status if we already tried to initialize the encryption app + * @return string init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INITIALIZED * * @note this doesn not indicate of the init was successful, we just remeber the try! */ @@ -158,8 +158,8 @@ class Session { } /** - * @brief Gets user or public share private key from session - * @returns string $privateKey The user's plaintext private key + * Gets user or public share private key from session + * @return string $privateKey The user's plaintext private key * */ public function getPrivateKey() { @@ -176,7 +176,7 @@ class Session { } /** - * @brief Sets public user private key to session + * Sets public user private key to session * @param string $privateKey * @return bool */ @@ -189,8 +189,8 @@ class Session { } /** - * @brief Gets public share private key from session - * @returns string $privateKey + * Gets public share private key from session + * @return string $privateKey * */ public function getPublicSharePrivateKey() { @@ -204,7 +204,7 @@ class Session { /** - * @brief Sets user legacy key to session + * Sets user legacy key to session * @param string $legacyKey * @return bool */ @@ -216,8 +216,8 @@ class Session { } /** - * @brief Gets user legacy key from session - * @returns string $legacyKey The user's plaintext legacy key + * Gets user legacy key from session + * @return string $legacyKey The user's plaintext legacy key * */ public function getLegacyKey() { diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index df5de558867867f41c38d1c9b2548ada7264d1b6..341114214d50227ff7c39dea15b5e53056e335f8 100644 --- a/apps/files_encryption/lib/stream.php +++ b/apps/files_encryption/lib/stream.php @@ -31,7 +31,7 @@ namespace OCA\Encryption; /** - * @brief Provides 'crypt://' stream wrapper protocol. + * Provides 'crypt://' stream wrapper protocol. * @note We use a stream wrapper because it is the most secure way to handle * decrypted content transfers. There is no safe way to decrypt the entire file * somewhere on the server, so we have to encrypt and decrypt blocks on the fly. @@ -79,10 +79,10 @@ class Stream { private $privateKey; /** - * @param $path raw path relative to data/ - * @param $mode - * @param $options - * @param $opened_path + * @param string $path raw path relative to data/ + * @param string $mode + * @param int $options + * @param string $opened_path * @return bool */ public function stream_open($path, $mode, $options, &$opened_path) { @@ -91,7 +91,7 @@ class Stream { $this->newFile = false; if (!isset($this->rootView)) { - $this->rootView = new \OC_FilesystemView('/'); + $this->rootView = new \OC\Files\View('/'); } $this->session = new \OCA\Encryption\Session($this->rootView); @@ -179,15 +179,15 @@ class Stream { } /** - * @brief Returns the current position of the file pointer - * @return int position of the file pointer + * Returns the current position of the file pointer + * @return int position of the file pointer */ public function stream_tell() { return ftell($this->handle); } /** - * @param $offset + * @param int $offset * @param int $whence * @return bool true if fseek was successful, otherwise false */ @@ -202,7 +202,7 @@ class Stream { } /** - * @param $count + * @param int $count * @return bool|string * @throws \Exception */ @@ -246,7 +246,7 @@ class Stream { } /** - * @brief Encrypt and pad data ready for writing to disk + * Encrypt and pad data ready for writing to disk * @param string $plainData data to be encrypted * @param string $key key to use for encryption * @return string encrypted data on success, false on failure @@ -267,7 +267,7 @@ class Stream { } /** - * @brief Fetch the plain encryption key for the file and set it as plainKey property + * Fetch the plain encryption key for the file and set it as plainKey property * @internal param bool $generate if true, a new key will be generated if none can be found * @return bool true on key found and set, false on key not found and new key generated and set */ @@ -318,7 +318,7 @@ class Stream { } /** - * @brief Handle plain data from the stream, and write it in 8192 byte blocks + * Handle plain data from the stream, and write it in 8192 byte blocks * @param string $data data to be written to disk * @note the data will be written to the path stored in the stream handle, set in stream_open() * @note $data is only ever be a maximum of 8192 bytes long. This is set by PHP internally. stream_write() is called multiple times in a loop on data larger than 8192 bytes @@ -426,9 +426,9 @@ class Stream { /** - * @param $option - * @param $arg1 - * @param $arg2 + * @param int $option + * @param int $arg1 + * @param int|null $arg2 */ public function stream_set_option($option, $arg1, $arg2) { $return = false; @@ -454,7 +454,7 @@ class Stream { } /** - * @param $mode + * @param int $mode */ public function stream_lock($mode) { return flock($this->handle, $mode); diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index 6372ab31b6ec1c2e111825f26dc0926cd2ad4dd3..d20efc3ac7be9894eb3ed55179324103bc812e1c 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -25,8 +25,8 @@ namespace OCA\Encryption; /** - * @brief Class for utilities relating to encrypted file storage system - * @param \OC_FilesystemView $view expected to have OC '/' as root path + * Class for utilities relating to encrypted file storage system + * @param \OC\Files\View $view expected to have OC '/' as root path * @param string $userId ID of the logged in user * @param int $client indicating status of client side encryption. Currently * unused, likely to become obsolete shortly @@ -38,7 +38,7 @@ class Util { const MIGRATION_IN_PROGRESS = -1; // migration is running const MIGRATION_OPEN = 0; // user still needs to be migrated - private $view; // OC_FilesystemView object for filesystem operations + private $view; // OC\Files\View object for filesystem operations private $userId; // ID of the user we use to encrypt/decrypt files private $keyId; // ID of the key we want to manipulate private $client; // Client side encryption mode flag @@ -53,8 +53,8 @@ class Util { private $isPublic; /** - * @param \OC_FilesystemView $view - * @param $userId + * @param \OC\Files\View $view + * @param string $userId * @param bool $client */ public function __construct($view, $userId, $client = false) { @@ -111,7 +111,7 @@ class Util { } /** - * @brief check if the users private & public key exists + * check if the users private & public key exists * @return boolean */ public function userKeysExists() { @@ -125,7 +125,7 @@ class Util { } /** - * @brief Sets up user folders and keys for serverside encryption + * Sets up user folders and keys for serverside encryption * * @param string $passphrase to encrypt server-stored private key with * @return bool @@ -222,7 +222,7 @@ class Util { } /** - * @brief Check whether pwd recovery is enabled for a given user + * Check whether pwd recovery is enabled for a given user * @return bool 1 = yes, 0 = no, false = no record * * @note If records are not being returned, check for a hidden space @@ -264,7 +264,7 @@ class Util { } /** - * @brief Enable / disable pwd recovery for a given user + * Enable / disable pwd recovery for a given user * @param bool $enabled Whether to enable or disable recovery * @return bool */ @@ -300,7 +300,7 @@ class Util { } /** - * @brief Find all files and their encryption status within a directory + * Find all files and their encryption status within a directory * @param string $directory The path of the parent directory to search * @param bool $found the founded files if called again * @return mixed false if 0 found, array on success. Keys: name, path @@ -421,7 +421,7 @@ class Util { } /** - * @brief Check if a given path identifies an encrypted file + * Check if a given path identifies an encrypted file * @param string $path * @return boolean */ @@ -463,7 +463,7 @@ class Util { } /** - * @brief get the file size of the unencrypted file + * get the file size of the unencrypted file * @param string $path absolute path * @return bool */ @@ -537,7 +537,7 @@ class Util { } /** - * @brief fix the file size of the encrypted file + * fix the file size of the encrypted file * @param string $path absolute path * @return boolean true / false if file is encrypted */ @@ -594,7 +594,7 @@ class Util { } /** - * @brief encrypt versions from given file + * encrypt versions from given file * @param array $filelist list of encrypted files, relative to data/user/files * @return boolean */ @@ -640,7 +640,7 @@ class Util { } /** - * @brief decrypt versions from given file + * decrypt versions from given file * @param string $filelist list of decrypted files, relative to data/user/files * @return boolean */ @@ -686,7 +686,7 @@ class Util { } /** - * @brief Decrypt all files + * Decrypt all files * @return bool */ public function decryptAll() { @@ -788,8 +788,8 @@ class Util { } if ($successful) { - $this->view->deleteAll($this->keyfilesPath); - $this->view->deleteAll($this->shareKeysPath); + $this->view->rename($this->keyfilesPath, $this->keyfilesPath . '.backup'); + $this->view->rename($this->shareKeysPath, $this->shareKeysPath . '.backup'); } \OC_FileProxy::$enabled = true; @@ -799,7 +799,7 @@ class Util { } /** - * @brief Encrypt all files in a directory + * Encrypt all files in a directory * @param string $dirPath the directory whose files will be encrypted * @param null $legacyPassphrase * @param null $newPassphrase @@ -926,7 +926,7 @@ class Util { } /** - * @brief Return important encryption related paths + * Return important encryption related paths * @param string $pathName Name of the directory to return the path of * @return string path */ @@ -970,7 +970,7 @@ class Util { } /** - * @brief Filter an array of UIDs to return only ones ready for sharing + * Filter an array of UIDs to return only ones ready for sharing * @param array $unfilteredUsers users to be checked for sharing readiness * @return array as multi-dimensional array. keys: ready, unready */ @@ -1017,7 +1017,7 @@ class Util { } /** - * @brief Decrypt a keyfile + * Decrypt a keyfile * @param string $filePath * @param string $privateKey * @return false|string @@ -1036,7 +1036,7 @@ class Util { } /** - * @brief Encrypt keyfile to multiple users + * Encrypt keyfile to multiple users * @param Session $session * @param array $users list of users which should be able to access the file * @param string $filePath path of the file to be shared @@ -1097,7 +1097,7 @@ class Util { } /** - * @brief Find, sanitise and format users sharing a file + * Find, sanitise and format users sharing a file * @note This wraps other methods into a portable bundle * @param boolean $sharingEnabled * @param string $filePath path relativ to current users files folder @@ -1176,7 +1176,7 @@ class Util { } /** - * @brief set migration status + * set migration status * @param int $status * @return boolean */ @@ -1199,7 +1199,7 @@ class Util { } /** - * @brief start migration mode to initially encrypt users data + * start migration mode to initially encrypt users data * @return boolean */ public function beginMigration() { @@ -1221,7 +1221,7 @@ class Util { } /** - * @brief close migration mode after users data has been encrypted successfully + * close migration mode after users data has been encrypted successfully * @return boolean */ public function finishMigration() { @@ -1237,8 +1237,8 @@ class Util { } /** - * @brief check if files are already migrated to the encryption system - * @return migration status, false = in case of no record + * check if files are already migrated to the encryption system + * @return int|false migration status, false = in case of no record * @note If records are not being returned, check for a hidden space * at the start of the uid in db */ @@ -1288,7 +1288,7 @@ class Util { } /** - * @brief get uid of the owners of the file and the path to the file + * get uid of the owners of the file and the path to the file * @param string $path Path of the file to check * @throws \Exception * @note $shareFilePath must be relative to data/UID/files. Files @@ -1361,13 +1361,13 @@ class Util { return array( $fileOwnerUid, - \OC_Filesystem::normalizePath($filename) + \OC\Files\Filesystem::normalizePath($filename) ); } } /** - * @brief go recursively through a dir and collect all files and sub files. + * go recursively through a dir and collect all files and sub files. * @param string $dir relative to the users files folder * @return array with list of files relative to the users files folder */ @@ -1397,9 +1397,8 @@ class Util { } /** - * @brief get owner of the shared files. - * @param $id - * @internal param int $Id of a share + * get owner of the shared files. + * @param int $id ID of a share * @return string owner */ public function getOwnerFromSharedFile($id) { @@ -1479,7 +1478,7 @@ class Util { } /** - * @param $password + * @param string $password * @return bool */ public function checkRecoveryPassword($password) { @@ -1512,7 +1511,7 @@ class Util { } /** - * @brief add recovery key to all encrypted files + * add recovery key to all encrypted files */ public function addRecoveryKeys($path = '/') { $dirContent = $this->view->getDirectoryContent($this->keyfilesPath . $path); @@ -1522,7 +1521,7 @@ class Util { if ($item['type'] === 'dir') { $this->addRecoveryKeys($filePath . '/'); } else { - $session = new \OCA\Encryption\Session(new \OC_FilesystemView('/')); + $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); $sharingEnabled = \OCP\Share::isEnabled(); // remove '.key' extension from path e.g. 'file.txt.key' to 'file.txt' $file = substr($filePath, 0, -4); @@ -1533,7 +1532,7 @@ class Util { } /** - * @brief remove recovery key to all encrypted files + * remove recovery key to all encrypted files */ public function removeRecoveryKeys($path = '/') { $dirContent = $this->view->getDirectoryContent($this->keyfilesPath . $path); @@ -1551,7 +1550,7 @@ class Util { } /** - * @brief decrypt given file with recovery key and encrypt it again to the owner and his new key + * decrypt given file with recovery key and encrypt it again to the owner and his new key * @param string $file * @param string $privateKey recovery key to decrypt the file */ @@ -1599,7 +1598,7 @@ class Util { } /** - * @brief collect all files and recover them one by one + * collect all files and recover them one by one * @param string $path to look for files keys * @param string $privateKey private recovery key which is used to decrypt the files */ @@ -1619,7 +1618,7 @@ class Util { } /** - * @brief recover users files in case of password lost + * recover users files in case of password lost * @param string $recoveryPassword */ public function recoverUsersFiles($recoveryPassword) { @@ -1638,8 +1637,8 @@ class Util { } /** - * @brief check if the file is stored on a system wide mount point - * @param $path relative to /data/user with leading '/' + * check if the file is stored on a system wide mount point + * @param string $path relative to /data/user with leading '/' * @return boolean */ public function isSystemWideMountPoint($path) { @@ -1655,7 +1654,7 @@ class Util { } /** - * @brief decrypt private key and add it to the current session + * decrypt private key and add it to the current session * @param array $params with 'uid' and 'password' * @return mixed session or false */ @@ -1683,7 +1682,7 @@ class Util { } /* - * @brief remove encryption related keys from the session + * remove encryption related keys from the session */ public function closeEncryptionSession() { $session = new \OCA\Encryption\Session($this->view); diff --git a/apps/files_encryption/settings-personal.php b/apps/files_encryption/settings-personal.php index 09e9df05352a9a121761f07d979534e95a826147..e9875518f67956b3f7227b735bac07eb7d51cbbd 100644 --- a/apps/files_encryption/settings-personal.php +++ b/apps/files_encryption/settings-personal.php @@ -12,7 +12,7 @@ $tmpl = new OCP\Template('files_encryption', 'settings-personal'); $user = \OCP\USER::getUser(); -$view = new \OC_FilesystemView('/'); +$view = new \OC\Files\View('/'); $util = new \OCA\Encryption\Util($view, $user); $session = new \OCA\Encryption\Session($view); diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 123943ea26a9c6cca7593f508c38f7aebf587808..b22cd214eaaad1738e1b6590f8dc42ec5f05198d 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -34,7 +34,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { public $dataUrl; public $dataShort; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $legacyEncryptedData; @@ -79,7 +79,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { $this->genPublicKey = $keypair['publicKey']; $this->genPrivateKey = $keypair['privateKey']; - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // remember files_trashbin state $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin'); @@ -157,7 +157,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { $filename = 'tmp-' . uniqid() . '.test'; - $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId); + $util = new Encryption\Util(new \OC\Files\View(), $this->userId); $cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort); @@ -206,7 +206,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief Test that data that is written by the crypto stream wrapper + * Test that data that is written by the crypto stream wrapper * @note Encrypted data is manually prepared and decrypted here to avoid dependency on success of stream_read * @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual * reassembly of its data @@ -216,7 +216,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { // Generate a a random filename $filename = 'tmp-' . uniqid() . '.test'; - $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId); + $util = new Encryption\Util(new \OC\Files\View(), $this->userId); // Save long data as encrypted file using stream wrapper $cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong); @@ -293,7 +293,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief Test that data that is read by the crypto stream wrapper + * Test that data that is read by the crypto stream wrapper */ function testSymmetricStreamDecryptShortFileContent() { @@ -388,7 +388,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test decryption using legacy blowfish method + * test decryption using legacy blowfish method */ function testLegacyDecryptShort() { @@ -402,7 +402,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test decryption using legacy blowfish method + * test decryption using legacy blowfish method */ function testLegacyDecryptLong() { @@ -660,9 +660,9 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { /** - * @brief encryption using legacy blowfish method + * encryption using legacy blowfish method * @param string $data data to encrypt - * @param $passwd string password + * @param string $passwd password * @return string */ function legacyEncrypt($data, $passwd) { diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php index 047084ca2c177713202d75b30fd402c067027e90..437034726183fe3665e8a1d356323a5926987420 100644 --- a/apps/files_encryption/tests/hooks.php +++ b/apps/files_encryption/tests/hooks.php @@ -32,7 +32,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Hooks - * @brief this class provide basic hook app tests + * this class provide basic hook app tests */ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { @@ -40,7 +40,7 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { const TEST_ENCRYPTION_HOOKS_USER2 = "test-encryption-hooks-user2"; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $user1View; // view on /data/user1/files public $user2View; // view on /data/user2/files @@ -83,9 +83,9 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { \OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1); // init filesystem view - $this->user1View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files'); - $this->user2View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files'); - $this->rootView = new \OC_FilesystemView('/'); + $this->user1View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files'); + $this->user2View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files'); + $this->rootView = new \OC\Files\View('/'); // init short data $this->data = 'hats'; @@ -259,7 +259,7 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { } /** - * @brief test rename operation + * test rename operation */ function testRenameHook() { @@ -311,4 +311,46 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { $this->rootView->unlink('/' . self::TEST_ENCRYPTION_HOOKS_USER1 . '/files/' . $this->folder); } + /** + * @brief replacing encryption keys during password change should be allowed + * until the user logged in for the first time + */ + public function testSetPassphrase() { + + $view = new \OC\Files\View(); + + // set user password for the first time + \OCA\Encryption\Hooks::postCreateUser(array('uid' => 'newUser', 'password' => 'newUserPassword')); + + $this->assertTrue($view->file_exists('public-keys/newUser.public.key')); + $this->assertTrue($view->file_exists('newUser/files_encryption/newUser.private.key')); + + // check if we are able to decrypt the private key + $encryptedKey = \OCA\Encryption\Keymanager::getPrivateKey($view, 'newUser'); + $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'newUserPassword'); + $this->assertTrue(is_string($privateKey)); + + // change the password before the user logged-in for the first time, + // we can replace the encryption keys + \OCA\Encryption\Hooks::setPassphrase(array('uid' => 'newUser', 'password' => 'passwordChanged')); + + $encryptedKey = \OCA\Encryption\Keymanager::getPrivateKey($view, 'newUser'); + $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged'); + $this->assertTrue(is_string($privateKey)); + + // now create a files folder to simulate a already used account + $view->mkdir('/newUser/files'); + + // change the password after the user logged in, now the password should not change + \OCA\Encryption\Hooks::setPassphrase(array('uid' => 'newUser', 'password' => 'passwordChanged2')); + + $encryptedKey = \OCA\Encryption\Keymanager::getPrivateKey($view, 'newUser'); + $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged2'); + $this->assertFalse($privateKey); + + $privateKey = \OCA\Encryption\Crypt::decryptPrivateKey($encryptedKey, 'passwordChanged'); + $this->assertTrue(is_string($privateKey)); + + } + } diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php index 0caf12e91a3eb2eae92b83ce741208792ea80292..2bd2ddc8e68d13d5973e5a23748edc1750c4bcf4 100644 --- a/apps/files_encryption/tests/keymanager.php +++ b/apps/files_encryption/tests/keymanager.php @@ -29,7 +29,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { public $pass; public $stateFilesTrashbin; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $randomKey; @@ -68,7 +68,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { $this->genPublicKey = $keypair['publicKey']; $this->genPrivateKey = $keypair['privateKey']; - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); \OC_User::setUserId(\Test_Encryption_Keymanager::TEST_USER); $this->userId = \Test_Encryption_Keymanager::TEST_USER; @@ -257,4 +257,4 @@ class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager { public static function testGetFilenameFromShareKey($sharekey) { return self::getFilenameFromShareKey($sharekey); } -} \ No newline at end of file +} diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php index 647ee955eb1ac7d763f1504956c725459af475ce..8d6bc81b08d217b03e61ca09cb7cf62fa78f8469 100644 --- a/apps/files_encryption/tests/proxy.php +++ b/apps/files_encryption/tests/proxy.php @@ -33,7 +33,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Proxy - * @brief this class provide basic proxy app tests + * this class provide basic proxy app tests */ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { @@ -42,7 +42,7 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; // view in /data/user/files public $rootView; // view on /data/user @@ -75,8 +75,8 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files'); - $this->rootView = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 ); + $this->view = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files'); + $this->rootView = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 ); // init short data $this->data = 'hats'; @@ -91,7 +91,7 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test if postFileSize returns the unencrypted file size + * test if postFileSize returns the unencrypted file size */ function testPostFileSize() { diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php index 512671c5767b5140c7d93de0727751e4c07080c4..bb3d7505a5df6adc0b96e8a055c147204ef0da42 100755 --- a/apps/files_encryption/tests/share.php +++ b/apps/files_encryption/tests/share.php @@ -48,7 +48,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { public $filename; public $dataShort; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $folder1; @@ -92,7 +92,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { function setUp() { $this->dataShort = 'hats'; - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); $this->folder1 = '/folder1'; $this->subfolder = '/subfolder1'; @@ -669,7 +669,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { // login as admin \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1); - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1); // check if recovery password match $this->assertTrue($util->checkRecoveryPassword('test123')); @@ -777,7 +777,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { // login as user2 \Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2); - $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2); + $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2); // enable recovery for admin $this->assertTrue($util->setRecoveryForUser(1)); @@ -959,7 +959,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase { /** - * @brief test moving a shared file out of the Shared folder + * test moving a shared file out of the Shared folder */ function testRename() { diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index fed2e7d89d10d8eacc6d3d3ef36a5ea53a9ac584..5df9cdbe1f1468c56232a90b368d6d31bd559448 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -33,7 +33,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Stream - * @brief this class provide basic stream tests + * this class provide basic stream tests */ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { @@ -42,7 +42,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; public $dataShort; @@ -71,7 +71,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // init short data $this->dataShort = 'hats'; @@ -183,7 +183,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test if stream wrapper can read files outside from the data folder + * test if stream wrapper can read files outside from the data folder */ function testStreamFromLocalFile() { diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php index 2f9ecfd9d5d1faab63f2b3d37d4a422a42aefed1..5d54b7db24f0b989f03bfad72e38b7ee4bdf5eda 100755 --- a/apps/files_encryption/tests/trashbin.php +++ b/apps/files_encryption/tests/trashbin.php @@ -34,7 +34,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Trashbin - * @brief this class provide basic trashbin app tests + * this class provide basic trashbin app tests */ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { @@ -43,7 +43,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; public $dataShort; @@ -81,7 +81,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // init short data $this->dataShort = 'hats'; @@ -114,7 +114,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test delete file + * test delete file */ function testDeleteFile() { @@ -186,7 +186,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test restore file + * test restore file * * @depends testDeleteFile */ @@ -218,7 +218,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test delete file forever + * test delete file forever */ function testPermanentDeleteFile() { diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php index 88ded7ec40a4b591bf5b5c9359e3ec5950a6b41a..a4dcc5cc8bdcffa26e86c55cbefec523e1df21e4 100755 --- a/apps/files_encryption/tests/util.php +++ b/apps/files_encryption/tests/util.php @@ -29,7 +29,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { public $publicKeyDir; public $pass; /** - * @var OC_FilesystemView + * @var OC\Files\View */ public $view; public $keyfilesPath; @@ -92,7 +92,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); $this->util = new Encryption\Util($this->view, $this->userId); @@ -121,7 +121,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test that paths set during User construction are correct + * test that paths set during User construction are correct */ function testKeyPaths() { $util = new Encryption\Util($this->view, $this->userId); @@ -136,7 +136,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test detection of encrypted files + * test detection of encrypted files */ function testIsEncryptedPath() { @@ -171,7 +171,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test setup of encryption directories + * test setup of encryption directories */ function testSetupServerSide() { $this->assertEquals(true, $this->util->setupServerSide($this->pass)); @@ -179,14 +179,14 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test checking whether account is ready for encryption, + * test checking whether account is ready for encryption, */ function testUserIsReady() { $this->assertEquals(true, $this->util->ready()); } /** - * @brief test checking whether account is not ready for encryption, + * test checking whether account is not ready for encryption, */ // function testUserIsNotReady() { // $this->view->unlink($this->publicKeyDir); @@ -200,12 +200,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { /** * @medium - * @brief test checking whether account is not ready for encryption, + * test checking whether account is not ready for encryption, */ function testIsLegacyUser() { \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); + $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); // Disable encryption proxy to prevent recursive calls $proxyStatus = \OC_FileProxy::$enabled; @@ -279,7 +279,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { } /** -< * @brief Test that data that is read by the crypto stream wrapper +< * Test that data that is read by the crypto stream wrapper */ function testGetFileSize() { \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1); @@ -384,7 +384,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $params = array('uid' => \OCP\User::getUser(), 'password' => \OCP\User::getUser()); - $view = new OC_FilesystemView('/'); + $view = new OC\Files\View('/'); $util = new \OCA\Encryption\Util($view, \OCP\User::getUser()); $result = $util->initEncryption($params); @@ -413,8 +413,16 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { // file should no longer be encrypted $this->assertEquals(0, $fileInfoUnencrypted['encrypted']); + // check if the keys where moved to the backup location + $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/keyfiles.backup')); + $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/keyfiles.backup/' . $filename . '.key')); + $this->assertTrue($this->view->is_dir($this->userId . '/files_encryption/share-keys.backup')); + $this->assertTrue($this->view->file_exists($this->userId . '/files_encryption/share-keys.backup/' . $filename . '.' . $user . '.shareKey')); + // cleanup $this->view->unlink($this->userId . '/files/' . $filename); + $this->view->deleteAll($this->userId . '/files_encryption/keyfiles.backup'); + $this->view->deleteAll($this->userId . '/files_encryption/share-keys.backup'); OC_App::enable('files_encryption'); } @@ -485,8 +493,11 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->view->is_dir($this->userId . '/files_encryption/keyfiles/')); $this->assertFalse($this->view->is_dir($this->userId . '/files_encryption/share-keys/')); + //cleanup $this->view->unlink($this->userId . '/files/' . $file1); $this->view->unlink($this->userId . '/files/' . $file2); + $this->view->deleteAll($this->userId . '/files_encryption/keyfiles.backup'); + $this->view->deleteAll($this->userId . '/files_encryption/share-keys.backup'); } @@ -496,8 +507,8 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { function testEncryptLegacyFiles() { \Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); - $view = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files'); + $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER); + $view = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files'); // Disable encryption proxy to prevent recursive calls $proxyStatus = \OC_FileProxy::$enabled; @@ -543,7 +554,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { } /** - * @param $user + * @param string $user * @param bool $create * @param bool $password */ @@ -584,7 +595,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { * to be able to test the migration path * * @param integer $status needed migration status for test - * @param $user for which user the status should be set + * @param string $user for which user the status should be set * @return boolean */ private function setMigrationStatus($status, $user) { diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php index 1fe4c13d59e8bae7622d38848fd4281bfcf9d410..d33dc58cf920a80d1a016efdcfc35fec30be17af 100755 --- a/apps/files_encryption/tests/webdav.php +++ b/apps/files_encryption/tests/webdav.php @@ -34,7 +34,7 @@ use OCA\Encryption; /** * Class Test_Encryption_Webdav * - * @brief this class provide basic webdav tests for PUT,GET and DELETE + * this class provide basic webdav tests for PUT,GET and DELETE */ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { @@ -43,7 +43,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { public $userId; public $pass; /** - * @var \OC_FilesystemView + * @var \OC\Files\View */ public $view; public $dataShort; @@ -82,7 +82,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1; // init filesystem view - $this->view = new \OC_FilesystemView('/'); + $this->view = new \OC\Files\View('/'); // init short data $this->dataShort = 'hats'; @@ -112,7 +112,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief test webdav put random file + * test webdav put random file */ function testWebdavPUT() { @@ -167,7 +167,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief test webdav get random file + * test webdav get random file * * @depends testWebdavPUT */ @@ -190,7 +190,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief test webdav delete random file + * test webdav delete random file * @depends testWebdavGET */ function testWebdavDELETE($filename) { @@ -216,7 +216,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase { } /** - * @brief handle webdav request + * handle webdav request * * @param bool $body * diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index 003665486f810bff0f0fdc97ff7fd2eefbf5dd31..ca164784fb011724a4c3578a5367b8b1b11724ab 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -32,11 +32,13 @@ OCP\Util::connectHook('OC_User', 'post_login', 'OC\Files\Storage\SMB_OC', 'login OC_Mount_Config::registerBackend('\OC\Files\Storage\Local', array( 'backend' => (string)$l->t('Local'), + 'priority' => 150, 'configuration' => array( 'datadir' => (string)$l->t('Location')))); OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', array( 'backend' => (string)$l->t('Amazon S3'), + 'priority' => 100, 'configuration' => array( 'key' => (string)$l->t('Key'), 'secret' => '*'.$l->t('Secret'), @@ -45,6 +47,7 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', array( 'backend' => (string)$l->t('Amazon S3 and compliant'), + 'priority' => 100, 'configuration' => array( 'key' => (string)$l->t('Access Key'), 'secret' => '*'.$l->t('Secret Key'), @@ -58,6 +61,7 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\AmazonS3', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\Dropbox', array( 'backend' => 'Dropbox', + 'priority' => 100, 'configuration' => array( 'configured' => '#configured', 'app_key' => (string)$l->t('App key'), @@ -69,8 +73,9 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\Dropbox', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\FTP', array( 'backend' => 'FTP', + 'priority' => 100, 'configuration' => array( - 'host' => (string)$l->t('URL'), + 'host' => (string)$l->t('Host'), 'user' => (string)$l->t('Username'), 'password' => '*'.$l->t('Password'), 'root' => '&'.$l->t('Root'), @@ -79,6 +84,7 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\FTP', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\Google', array( 'backend' => 'Google Drive', + 'priority' => 100, 'configuration' => array( 'configured' => '#configured', 'client_id' => (string)$l->t('Client ID'), @@ -90,6 +96,7 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\Google', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\Swift', array( 'backend' => (string)$l->t('OpenStack Object Storage'), + 'priority' => 100, 'configuration' => array( 'user' => (string)$l->t('Username (required)'), 'bucket' => (string)$l->t('Bucket (required)'), @@ -107,8 +114,9 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\Swift', array( if (!OC_Util::runningOnWindows()) { OC_Mount_Config::registerBackend('\OC\Files\Storage\SMB', array( 'backend' => 'SMB / CIFS', + 'priority' => 100, 'configuration' => array( - 'host' => (string)$l->t('URL'), + 'host' => (string)$l->t('Host'), 'user' => (string)$l->t('Username'), 'password' => '*'.$l->t('Password'), 'share' => (string)$l->t('Share'), @@ -117,8 +125,9 @@ if (!OC_Util::runningOnWindows()) { OC_Mount_Config::registerBackend('\OC\Files\Storage\SMB_OC', array( 'backend' => (string)$l->t('SMB / CIFS using OC login'), + 'priority' => 90, 'configuration' => array( - 'host' => (string)$l->t('URL'), + 'host' => (string)$l->t('Host'), 'username_as_share' => '!'.$l->t('Username as share'), 'share' => '&'.$l->t('Share'), 'root' => '&'.$l->t('Root')), @@ -127,6 +136,7 @@ if (!OC_Util::runningOnWindows()) { OC_Mount_Config::registerBackend('\OC\Files\Storage\DAV', array( 'backend' => 'WebDAV', + 'priority' => 100, 'configuration' => array( 'host' => (string)$l->t('URL'), 'user' => (string)$l->t('Username'), @@ -137,6 +147,7 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\DAV', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\OwnCloud', array( 'backend' => 'ownCloud', + 'priority' => 100, 'configuration' => array( 'host' => (string)$l->t('URL'), 'user' => (string)$l->t('Username'), @@ -147,8 +158,9 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\OwnCloud', array( OC_Mount_Config::registerBackend('\OC\Files\Storage\SFTP', array( 'backend' => 'SFTP', + 'priority' => 100, 'configuration' => array( - 'host' => (string)$l->t('URL'), + 'host' => (string)$l->t('Host'), 'user' => (string)$l->t('Username'), 'password' => '*'.$l->t('Password'), 'root' => '&'.$l->t('Root')))); diff --git a/apps/files_external/appinfo/info.xml b/apps/files_external/appinfo/info.xml index 0542b7b10a7afe831d0b917b9daf284949ab08f5..2698706c09084ba431a97e3c4e9afbc41c780e29 100644 --- a/apps/files_external/appinfo/info.xml +++ b/apps/files_external/appinfo/info.xml @@ -4,8 +4,8 @@ External storage support Mount external storage sources AGPL - Robin Appelman, Michael Gapczynski - 4.93 + Robin Appelman, Michael Gapczynski, Vincent Petry + 4.93 true diff --git a/apps/files_external/l10n/ar.php b/apps/files_external/l10n/ar.php index 5bef941c19ce2e53d4a49d9d5059a183c94df643..eb1150eb95ecfdc319362d21e1ba928a8aba9656 100644 --- a/apps/files_external/l10n/ar.php +++ b/apps/files_external/l10n/ar.php @@ -1,10 +1,11 @@ "المكان", -"URL" => "عنوان الموقع", +"Host" => "المضيف", "Username" => "إسم المستخدم", "Password" => "كلمة السر", "Share" => "شارك", +"URL" => "عنوان الموقع", "Saved" => "حفظ", "Folder name" => "اسم المجلد", "Options" => "خيارات", diff --git a/apps/files_external/l10n/ast.php b/apps/files_external/l10n/ast.php index add498191546d5628112ec34ac5f306bb1d3a252..faf0388dd91799c8ef82cab61f15be78c2c19410 100644 --- a/apps/files_external/l10n/ast.php +++ b/apps/files_external/l10n/ast.php @@ -2,16 +2,69 @@ $TRANSLATIONS = array( "Local" => "Llocal", "Location" => "Llocalización", -"URL" => "URL", +"Amazon S3" => "Amazon S3", +"Key" => "Clave", +"Secret" => "Secretu", +"Bucket" => "Depósitu", +"Amazon S3 and compliant" => "Amazon S3 y compatibilidá", +"Access Key" => "Clave d'accesu", +"Secret Key" => "Clave Secreta", +"Hostname (optional)" => "Nome d'equipu (opcional)", +"Port (optional)" => "Puertu (opcional)", +"Region (optional)" => "Rexón (opcional)", +"Enable SSL" => "Habilitar SSL", +"Enable Path Style" => "Habilitar Estilu de ruta", +"App key" => "App principal", +"App secret" => "App secreta", +"Host" => "Sirvidor", "Username" => "Nome d'usuariu", "Password" => "Contraseña", +"Root" => "Raíz", +"Secure ftps://" => "Secure ftps://", +"Client ID" => "ID de veceru", +"Client secret" => "Veceru secretu", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Nome d'usuariu (necesariu)", +"Bucket (required)" => "Depósitu (necesariu)", +"Region (optional for OpenStack Object Storage)" => "Rexón (opcional pa OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "Clave API (necesaria pa Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Nome d'inquilín (necesariu pa OpenStack Object Storage)", +"Password (required for OpenStack Object Storage)" => "Contraseña (necesaria pa OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Nome de Serviciu (necesariu pa OpenStack Object Storage)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "URL d'identidá de puntu final (necesariu pa OpenStack Object Storage)", +"Timeout of HTTP requests in seconds (optional)" => "Tiempu d'espera de peticiones HTTP en segundos (opcional)", "Share" => "Compartir", +"SMB / CIFS using OC login" => "SMB / CIFS usando accesu OC", +"Username as share" => "Nome d'usuariu como Compartición", +"URL" => "URL", +"Secure https://" => "Secure https://", +"Remote subfolder" => "Subcarpeta remota", +"Access granted" => "Accesu concedíu", +"Error configuring Dropbox storage" => "Fallu configurando l'almacenamientu de Dropbox", +"Grant access" => "Conceder accesu", +"Please provide a valid Dropbox app key and secret." => "Por favor, proporciona una clave válida de l'app Dropbox y una clave secreta.", +"Error configuring Google Drive storage" => "Fallu configurando l'almacenamientu de Google Drive", "Saved" => "Guardáu", +"Note: " => "Nota: ", +" and " => "y", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Nota: El soporte de cURL en PHP nun ta activáu o instaláu. Nun pue montase %s. Pídi-y al alministrador de sistema que lu instale.", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Nota: El soporte de FTP en PHP nun ta activáu o instaláu. Nun pue montase %s. Pídi-y al alministrador de sistema que lu instale.", +"Note: \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Nota: \"%s\" nun ta instaláu. Nun pue montase %s. Pídi-y al alministrador de sistema que lu instale.", +"External Storage" => "Almacenamientu esternu", "Folder name" => "Nome de la carpeta", +"External storage" => "Almacenamientu esternu", "Configuration" => "Configuración", "Options" => "Opciones", +"Available for" => "Disponible pa", +"Add storage" => "Amestar almacenamientu", +"No user or group" => "Nengún usuariu o grupu", +"All Users" => "Tolos usuarios", "Groups" => "Grupos", "Users" => "Usuarios", -"Delete" => "Desaniciar" +"Delete" => "Desaniciar", +"Enable User External Storage" => "Habilitar almacenamientu esterno d'usuariu", +"Allow users to mount the following external storage" => "Permitir a los usuarios montar el siguiente almacenamientu esternu", +"SSL root certificates" => "Certificaos raíz SSL", +"Import Root Certificate" => "Importar certificáu raíz" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/bg_BG.php b/apps/files_external/l10n/bg_BG.php index 0969184383e1800c710e33437e258d2ac3327007..13e43314bda18ba584d5ad0d781f7f9a1f8df78c 100644 --- a/apps/files_external/l10n/bg_BG.php +++ b/apps/files_external/l10n/bg_BG.php @@ -1,10 +1,10 @@ "Място", -"URL" => "Уеб адрес", "Username" => "Потребител", "Password" => "Парола", "Share" => "Споделяне", +"URL" => "Уеб адрес", "Access granted" => "Достъпът е даден", "Grant access" => "Даване на достъп", "External Storage" => "Външно хранилище", diff --git a/apps/files_external/l10n/bn_BD.php b/apps/files_external/l10n/bn_BD.php index 3b1978a568c32cbea34ff25e363d73961b32db96..f1ada4b476d29753493f14347015915c371e277f 100644 --- a/apps/files_external/l10n/bn_BD.php +++ b/apps/files_external/l10n/bn_BD.php @@ -1,10 +1,11 @@ "াবস্থান", -"URL" => "URL", +"Host" => "হোস্ট", "Username" => "ব্যবহারকারী", "Password" => "কূটশব্দ", "Share" => "ভাগাভাগি কর", +"URL" => "URL", "Access granted" => "অধিগমনের অনুমতি প্রদান করা হলো", "Error configuring Dropbox storage" => "Dropbox সংরক্ষণাগার নির্ধারণ করতে সমস্যা ", "Grant access" => "অধিগমনের অনুমতি প্রদান কর", diff --git a/apps/files_external/l10n/ca.php b/apps/files_external/l10n/ca.php index e49f26c353cdf745d123919cd5ed7165638ddf72..b478b721c5d47971f11bd5e8c375ba79ab95cb22 100644 --- a/apps/files_external/l10n/ca.php +++ b/apps/files_external/l10n/ca.php @@ -2,10 +2,23 @@ $TRANSLATIONS = array( "Local" => "Local", "Location" => "Ubicació", -"URL" => "URL", +"Amazon S3" => "Amazon S3", +"Key" => "Clau", +"Secret" => "Secret", +"Access Key" => "Clau d'accés", +"Secret Key" => "Clau secreta", +"Enable SSL" => "Habilita SSL", +"Host" => "Equip remot", "Username" => "Nom d'usuari", "Password" => "Contrasenya", +"Secure ftps://" => "Protocol segur ftps://", +"Client ID" => "Client ID", +"Username (required)" => "Nom d'usuari (necessari)", "Share" => "Comparteix", +"Username as share" => "Nom d'usuari per compartir", +"URL" => "URL", +"Secure https://" => "Protocol segur https://", +"Remote subfolder" => "Subcarpeta remota", "Access granted" => "S'ha concedit l'accés", "Error configuring Dropbox storage" => "Error en configurar l'emmagatzemament Dropbox", "Grant access" => "Concedeix accés", diff --git a/apps/files_external/l10n/cs_CZ.php b/apps/files_external/l10n/cs_CZ.php index e953e19a9dd98f42540ed86f56fa33c248e0595c..2d1116ed0f66fbd3949049be2cc8545ddacd73fe 100644 --- a/apps/files_external/l10n/cs_CZ.php +++ b/apps/files_external/l10n/cs_CZ.php @@ -13,7 +13,7 @@ $TRANSLATIONS = array( "Enable SSL" => "Povolit SSL", "App key" => "Klíč aplikace", "App secret" => "Tajemství aplikace", -"URL" => "URL", +"Host" => "Počítač", "Username" => "Uživatelské jméno", "Password" => "Heslo", "Root" => "Root", @@ -25,6 +25,7 @@ $TRANSLATIONS = array( "Share" => "Sdílet", "SMB / CIFS using OC login" => "SMB / CIFS za použití OC loginu", "Username as share" => "Uživatelské jméno jako sdílený adresář", +"URL" => "URL", "Secure https://" => "Zabezpečené https://", "Remote subfolder" => "Vzdálený podadresář", "Access granted" => "Přístup povolen", diff --git a/apps/files_external/l10n/cy_GB.php b/apps/files_external/l10n/cy_GB.php index 9b5d97a48a7c15be8b98891841d15b4732e4eb56..39822fcd3834062f638f928fdc49f50d07d0cea2 100644 --- a/apps/files_external/l10n/cy_GB.php +++ b/apps/files_external/l10n/cy_GB.php @@ -1,10 +1,10 @@ "Lleoliad", -"URL" => "URL", "Username" => "Enw defnyddiwr", "Password" => "Cyfrinair", "Share" => "Rhannu", +"URL" => "URL", "Groups" => "Grwpiau", "Users" => "Defnyddwyr", "Delete" => "Dileu" diff --git a/apps/files_external/l10n/da.php b/apps/files_external/l10n/da.php index a0e8510789eb3b1eaffca3639e6b4f5c485175a3..2d235747ad9584d2a2ccfdc96dc7c0cbdd8ab77f 100644 --- a/apps/files_external/l10n/da.php +++ b/apps/files_external/l10n/da.php @@ -6,7 +6,7 @@ $TRANSLATIONS = array( "Key" => "Nøgle", "Secret" => "Hemmelighed", "Secret Key" => "Hemmelig Nøgle ", -"URL" => "URL", +"Host" => "Host", "Username" => "Brugernavn", "Password" => "Kodeord", "Root" => "Root", @@ -15,6 +15,7 @@ $TRANSLATIONS = array( "Client secret" => "Klient hemmelighed", "OpenStack Object Storage" => "OpenStack Object Storage", "Share" => "Del", +"URL" => "URL", "Secure https://" => "Sikker https://", "Access granted" => "Adgang godkendt", "Error configuring Dropbox storage" => "Fejl ved konfiguration af Dropbox plads", diff --git a/apps/files_external/l10n/de.php b/apps/files_external/l10n/de.php index c41cef968f0700205bbec3022e37804e701671af..03f6f05abb98ab71cc78892fbee99179e2360d7e 100644 --- a/apps/files_external/l10n/de.php +++ b/apps/files_external/l10n/de.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Pfad-Stil aktivieren", "App key" => "App-Schlüssel", "App secret" => "Geheime Zeichenkette der App", -"URL" => "URL", +"Host" => "Host", "Username" => "Benutzername", "Password" => "Passwort", "Root" => "Root", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Teilen", "SMB / CIFS using OC login" => "´", "Username as share" => "Benutzername als Freigabe", +"URL" => "URL", "Secure https://" => "Sicherer HTTPS://", "Remote subfolder" => "Remote-Unterordner:", "Access granted" => "Zugriff gestattet", diff --git a/apps/files_external/l10n/de_CH.php b/apps/files_external/l10n/de_CH.php index 6d7366fe28443ff37f0aa2348f29639960455acc..4e0ac1f3a090795d2b16a69dd0a3e67b5f4666a6 100644 --- a/apps/files_external/l10n/de_CH.php +++ b/apps/files_external/l10n/de_CH.php @@ -1,10 +1,11 @@ "Ort", -"URL" => "URL", +"Host" => "Host", "Username" => "Benutzername", "Password" => "Passwort", "Share" => "Freigeben", +"URL" => "URL", "Access granted" => "Zugriff gestattet", "Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", "Grant access" => "Zugriff gestatten", diff --git a/apps/files_external/l10n/de_DE.php b/apps/files_external/l10n/de_DE.php index 1119a0f8755881d33c39debbfaab4d3a39479e9c..286250f86899a5bf47a48029e75ef1b4010a4077 100644 --- a/apps/files_external/l10n/de_DE.php +++ b/apps/files_external/l10n/de_DE.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Pfad-Stil aktivieren", "App key" => "App-Schlüssel", "App secret" => "Geheime Zeichenkette der App", -"URL" => "URL", +"Host" => "Host", "Username" => "Benutzername", "Password" => "Passwort", "Root" => "Root", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Teilen", "SMB / CIFS using OC login" => "Zeitüberschreitung von HTTP-Anfragen in Sekunden (Optional)", "Username as share" => "Benutzername als Freigabe", +"URL" => "URL", "Secure https://" => "Sicherer HTTPS://", "Remote subfolder" => "Remote-Unterordner:", "Access granted" => "Zugriff gestattet", diff --git a/apps/files_external/l10n/el.php b/apps/files_external/l10n/el.php index cc28d074a0a88ae45123566dbac308c927494f35..18e6574dd28e84ebee25d8609f22e27766f06f64 100644 --- a/apps/files_external/l10n/el.php +++ b/apps/files_external/l10n/el.php @@ -2,21 +2,52 @@ $TRANSLATIONS = array( "Local" => "Τοπικός", "Location" => "Τοποθεσία", +"Amazon S3" => "Amazon S3", "Key" => "Κλειδί", "Secret" => "Μυστικό", -"URL" => "URL", +"Bucket" => "Κάδος", +"Access Key" => "Κλειδί πρόσβασης", +"Secret Key" => "Μυστικό κλειδί", +"Hostname (optional)" => "Όνομα μηχανήματος (προαιρετικά)", +"Port (optional)" => "Πόρτα (προαιρετικά)", +"Region (optional)" => "Περιοχή (προαιρετικά)", +"Enable SSL" => "Ενεργοποίηση SSL", +"Enable Path Style" => "Ενεργοποίηση μορφής διαδρομής", +"App key" => "Κλειδί εφαρμογής", +"App secret" => "Μυστικό εφαρμογής", +"Host" => "Διακομιστής", "Username" => "Όνομα χρήστη", "Password" => "Κωδικός πρόσβασης", +"Root" => "Root", +"Secure ftps://" => "Ασφαλής ftps://", "Client ID" => "ID πελάτη", +"Client secret" => "Μυστικό πελάτη", +"OpenStack Object Storage" => "Αποθήκη αντικειμένων OpenStack", "Username (required)" => "Όνομα χρήστη (απαιτείται)", +"Bucket (required)" => "Κάδος (απαιτείται)", +"Region (optional for OpenStack Object Storage)" => "Περιοχή (προαιρετικά για την αποθήκευση αντικειμένων OpenStack)", +"API Key (required for Rackspace Cloud Files)" => "Κλειδί API (απαιτείται για αρχεία Rackspace Cloud)", +"Password (required for OpenStack Object Storage)" => "Μυστικός κωδικός (απαιτείται για την αποθήκευση αντικειμένων OpenStack)", +"Service Name (required for OpenStack Object Storage)" => "Όνομα υπηρεσίας (απαιτείται για την αποθήκευση αντικειμένων OpenStack)", +"URL of identity endpoint (required for OpenStack Object Storage)" => "Διεύθυνση URL της ταυτότητας τελικού σημείου (απαιτείται για την αποθήκευση αντικειμένων OpenStack)", +"Timeout of HTTP requests in seconds (optional)" => "Χρονικό όριο των αιτήσεων HTTP σε δευτερόλεπτα (προαιρετικά)", "Share" => "Διαμοιράστε", +"SMB / CIFS using OC login" => "SMB / CIFS χρησιμοποιώντας λογαριασμό OC", +"Username as share" => "Όνομα χρήστη ως διαμοιραζόμενος φάκελος", +"URL" => "URL", +"Secure https://" => "Ασφαλής σύνδεση https://", +"Remote subfolder" => "Απομακρυσμένος υποφάκελος", "Access granted" => "Προσβαση παρασχέθηκε", "Error configuring Dropbox storage" => "Σφάλμα ρυθμίζωντας αποθήκευση Dropbox ", "Grant access" => "Παροχή πρόσβασης", "Please provide a valid Dropbox app key and secret." => "Παρακαλούμε δώστε έγκυρο κλειδί Dropbox και μυστικό.", "Error configuring Google Drive storage" => "Σφάλμα ρυθμίζωντας αποθήκευση Google Drive ", "Saved" => "Αποθηκεύτηκαν", +"Note: " => "Σημείωση: ", " and " => "και", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Σημείωση: Η υποστήριξη cURL στην PHP δεν είναι ενεργοποιημένη ή εγκατεστημένη. Η προσάρτηση του %s δεν είναι δυνατή. Παρακαλώ ζητήστε από τον διαχειριστή συστημάτων σας να την εγκαταστήσει.", +"Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Σημείωση: Η υποστήριξη FTP στην PHP δεν είναι ενεργοποιημένη ή εγκατεστημένη. Δεν είναι δυνατή η προσάρτηση του %s. Παρακαλώ ζητήστε από τον διαχειριστή συστημάτων σας να την εγκαταστήσει.", +"Note: \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Σημείωση: Η επέκταση \"%s\" δεν είναι εγκατεστημένη. Δεν είναι δυνατή η προσάρτηση %s. Παρακαλώ ζητήστε από τον διαχειριστή συστημάτων σας να την εγκαταστήσει.", "External Storage" => "Εξωτερικό Αποθηκευτικό Μέσο", "Folder name" => "Όνομα φακέλου", "External storage" => "Εξωτερική αποθήκευση", diff --git a/apps/files_external/l10n/en_GB.php b/apps/files_external/l10n/en_GB.php index 5a0e2456ac09fb8bdaf493fb8854d251a7742180..d4229c607ef895008b6f3c0642df42e487867b16 100644 --- a/apps/files_external/l10n/en_GB.php +++ b/apps/files_external/l10n/en_GB.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Enable Path Style", "App key" => "App key", "App secret" => "App secret", -"URL" => "URL", +"Host" => "Host", "Username" => "Username", "Password" => "Password", "Root" => "Root", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Share", "SMB / CIFS using OC login" => "SMB / CIFS using OC login", "Username as share" => "Username as share", +"URL" => "URL", "Secure https://" => "Secure https://", "Remote subfolder" => "Remote subfolder", "Access granted" => "Access granted", diff --git a/apps/files_external/l10n/eo.php b/apps/files_external/l10n/eo.php index d8915b49b025b107a4265967f80c83009de10bca..3cded77cbdef41cee320b0623d65675451424f2a 100644 --- a/apps/files_external/l10n/eo.php +++ b/apps/files_external/l10n/eo.php @@ -1,24 +1,57 @@ "Loka", "Location" => "Loko", -"URL" => "URL", +"Amazon S3" => "Amazon S3", +"Key" => "Klavo", +"Secret" => "Sekreto", +"Access Key" => "Aliroklavo", +"Secret Key" => "Sekretoklavo", +"Hostname (optional)" => "Gastigonomo (malnepra)", +"Port (optional)" => "Pordo (malnepra)", +"Region (optional)" => "Regiono (malnepra)", +"Enable SSL" => "Kapabligi SSL-on", +"App key" => "Aplikaĵoklavo", +"App secret" => "Aplikaĵosekreto", +"Host" => "Gastigo", "Username" => "Uzantonomo", "Password" => "Pasvorto", +"Root" => "Radiko", +"Secure ftps://" => "Sekura ftps://", +"Client ID" => "Klientidentigilo", +"Client secret" => "Klientosekreto", +"OpenStack Object Storage" => "OpenStack Object Storage", +"Username (required)" => "Uzantonomo (nepra)", +"Region (optional for OpenStack Object Storage)" => "Regiono (malnepra por OpenStack Object Storage)", +"API Key (required for Rackspace Cloud Files)" => "API-klavo (nepra por Rackspace Cloud Files)", +"Password (required for OpenStack Object Storage)" => "Pasvorto (nepra por OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Servonomo (nepra por OpenStack Object Storage)", "Share" => "Kunhavigi", +"URL" => "URL", +"Secure https://" => "Sekura https://", +"Remote subfolder" => "Malloka subdosierujo", "Access granted" => "Alirpermeso donita", "Error configuring Dropbox storage" => "Eraro dum agordado de la memorservo Dropbox", "Grant access" => "Doni alirpermeson", "Please provide a valid Dropbox app key and secret." => "Bonvolu provizi ŝlosilon de la aplikaĵo Dropbox validan kaj sekretan.", "Error configuring Google Drive storage" => "Eraro dum agordado de la memorservo Google Drive", +"Saved" => "Konservita", +"Note: " => "Noto:", +" and " => "kaj", "External Storage" => "Malena memorilo", "Folder name" => "Dosierujnomo", +"External storage" => "Malena memorilo", "Configuration" => "Agordo", "Options" => "Malneproj", +"Available for" => "Disponebla por", +"Add storage" => "Aldoni memorilon", +"No user or group" => "Neniu uzanto aŭ grupo", "All Users" => "Ĉiuj uzantoj", "Groups" => "Grupoj", "Users" => "Uzantoj", "Delete" => "Forigi", "Enable User External Storage" => "Kapabligi malenan memorilon de uzanto", +"Allow users to mount the following external storage" => "Permesi uzantojn munti la jenajn malenajn memorilojn", "SSL root certificates" => "Radikaj SSL-atestoj", "Import Root Certificate" => "Enporti radikan ateston" ); diff --git a/apps/files_external/l10n/es.php b/apps/files_external/l10n/es.php index 3c18b18057e8e7ee72beaa1816c39321c20543ee..bbbe0a8c6130e5925bb785678ded2f2064d0df22 100644 --- a/apps/files_external/l10n/es.php +++ b/apps/files_external/l10n/es.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Habilitar Estilo de Ruta", "App key" => "App principal", "App secret" => "App secreta", -"URL" => "URL", +"Host" => "Servidor", "Username" => "Nombre de usuario", "Password" => "Contraseña", "Root" => "Raíz", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Compartir", "SMB / CIFS using OC login" => "SMB / CIFS usando acceso OC", "Username as share" => "Nombre de Usuario como compartir", +"URL" => "URL", "Secure https://" => "Secure https://", "Remote subfolder" => "Subcarpeta remota", "Access granted" => "Acceso concedido", diff --git a/apps/files_external/l10n/es_AR.php b/apps/files_external/l10n/es_AR.php index c380c6d0d91e93110e5bd0e2e0015f079ba8657e..dfb53d9a78485dba9add5506ec5ba4e7fad447a0 100644 --- a/apps/files_external/l10n/es_AR.php +++ b/apps/files_external/l10n/es_AR.php @@ -1,10 +1,11 @@ "Ubicación", -"URL" => "URL", +"Host" => "Servidor", "Username" => "Nombre de usuario", "Password" => "Contraseña", "Share" => "Compartir", +"URL" => "URL", "Access granted" => "Acceso permitido", "Error configuring Dropbox storage" => "Error al configurar el almacenamiento de Dropbox", "Grant access" => "Permitir acceso", diff --git a/apps/files_external/l10n/es_MX.php b/apps/files_external/l10n/es_MX.php index 73ce83591047769facf64411b4bebeb951c2ca0d..7e28798f58ad85ae7f2be8fafa35975aa86fcf07 100644 --- a/apps/files_external/l10n/es_MX.php +++ b/apps/files_external/l10n/es_MX.php @@ -1,10 +1,11 @@ "Ubicación", -"URL" => "URL", +"Host" => "Servidor", "Username" => "Nombre de usuario", "Password" => "Contraseña", "Share" => "Compartir", +"URL" => "URL", "Access granted" => "Acceso concedido", "Error configuring Dropbox storage" => "Error configurando el almacenamiento de Dropbox", "Grant access" => "Conceder acceso", diff --git a/apps/files_external/l10n/et_EE.php b/apps/files_external/l10n/et_EE.php index e5fc7c6937e4f60aa993751f9041e4e357b2a2cd..73444411979b61c18c14d4d142103befd74c89fc 100644 --- a/apps/files_external/l10n/et_EE.php +++ b/apps/files_external/l10n/et_EE.php @@ -2,10 +2,11 @@ $TRANSLATIONS = array( "Local" => "Kohalik", "Location" => "Asukoht", -"URL" => "URL", +"Host" => "Host", "Username" => "Kasutajanimi", "Password" => "Parool", "Share" => "Jaga", +"URL" => "URL", "Access granted" => "Ligipääs on antud", "Error configuring Dropbox storage" => "Viga Dropboxi salvestusruumi seadistamisel", "Grant access" => "Anna ligipääs", diff --git a/apps/files_external/l10n/eu.php b/apps/files_external/l10n/eu.php index 28376b56b65a88d30e9f5d52f5eeb5bdccbb23fe..ef29ba0484835ca9536f63b27d3af816badee6ef 100644 --- a/apps/files_external/l10n/eu.php +++ b/apps/files_external/l10n/eu.php @@ -5,10 +5,11 @@ $TRANSLATIONS = array( "Amazon S3" => "Amazon S3", "Port (optional)" => "Portua (hautazkoa)", "Enable SSL" => "Gaitu SSL", -"URL" => "URL", +"Host" => "Hostalaria", "Username" => "Erabiltzaile izena", "Password" => "Pasahitza", "Share" => "Partekatu", +"URL" => "URL", "Access granted" => "Sarrera baimendua", "Error configuring Dropbox storage" => "Errore bat egon da Dropbox biltegiratzea konfiguratzean", "Grant access" => "Baimendu sarrera", diff --git a/apps/files_external/l10n/fa.php b/apps/files_external/l10n/fa.php index 6bf8ce8af58080b474ffd80006eb7ef5e65e4c93..674a72873323ec636dd04ee02683b831bfe7797b 100644 --- a/apps/files_external/l10n/fa.php +++ b/apps/files_external/l10n/fa.php @@ -1,10 +1,11 @@ "محل", -"URL" => "آدرس", +"Host" => "میزبانی", "Username" => "نام کاربری", "Password" => "گذرواژه", "Share" => "اشتراک‌گذاری", +"URL" => "آدرس", "Access granted" => "مجوز دسترسی صادر شد", "Error configuring Dropbox storage" => "خطا به هنگام تنظیم فضای دراپ باکس", "Grant access" => " مجوز اعطا دسترسی", diff --git a/apps/files_external/l10n/fi_FI.php b/apps/files_external/l10n/fi_FI.php index 9efc8e09cb712360a47cc871bc771ed60a5a2ea9..aa7fb394d4ed1c89c67c1395b88e589a3b23d5b5 100644 --- a/apps/files_external/l10n/fi_FI.php +++ b/apps/files_external/l10n/fi_FI.php @@ -6,11 +6,13 @@ $TRANSLATIONS = array( "Port (optional)" => "Portti (valinnainen)", "Region (optional)" => "Alue (valinnainen)", "Enable SSL" => "Käytä SSL:ää", -"URL" => "Verkko-osoite", +"Host" => "Isäntä", "Username" => "Käyttäjätunnus", "Password" => "Salasana", "Username (required)" => "Käyttäjätunnus (vaaditaan)", "Share" => "Jaa", +"URL" => "Verkko-osoite", +"Secure https://" => "Salattu https://", "Access granted" => "Pääsy sallittu", "Error configuring Dropbox storage" => "Virhe Dropbox levyn asetuksia tehtäessä", "Grant access" => "Salli pääsy", diff --git a/apps/files_external/l10n/fr.php b/apps/files_external/l10n/fr.php index c03a2f49e0a9739805a6d1cc1e4d43cdb00ca418..ea20abc5256939ae6501f2913bad394e593e2ccb 100644 --- a/apps/files_external/l10n/fr.php +++ b/apps/files_external/l10n/fr.php @@ -4,11 +4,34 @@ $TRANSLATIONS = array( "Location" => "Emplacement", "Amazon S3" => "Amazon S3", "Key" => "Clé", +"Secret" => "Secret", +"Amazon S3 and compliant" => "Compatible avec Amazon S3", "Access Key" => "Clé d'accès", -"URL" => "URL", +"Secret Key" => "Clé secrète", +"Hostname (optional)" => "Nom machine (optionnel)", +"Port (optional)" => "Port (optionnel)", +"Region (optional)" => "Région (facultatif)", +"Enable SSL" => "Activer SSL", +"Enable Path Style" => "Activer le style de chemin", +"App key" => "Clé App", +"Host" => "Hôte", "Username" => "Nom d'utilisateur", "Password" => "Mot de passe", +"Root" => "Root", +"Secure ftps://" => "Sécuriser via ftps://", +"Client ID" => "ID Client", +"Username (required)" => "Nom d'utilisation (requis)", +"API Key (required for Rackspace Cloud Files)" => "Clé API (requis pour Rackspace Cloud Files)", +"Tenantname (required for OpenStack Object Storage)" => "Nom du locataire (requis pour le stockage OpenStack)", +"Password (required for OpenStack Object Storage)" => "Mot de passe (requis pour OpenStack Object Storage)", +"Service Name (required for OpenStack Object Storage)" => "Nom du service (requit pour le stockage OpenStack)", +"Timeout of HTTP requests in seconds (optional)" => "Temps maximal de requête HTTP en seconde (facultatif)", "Share" => "Partager", +"SMB / CIFS using OC login" => "SMB / CIFS utilise le nom d'utilisateur OC", +"Username as share" => "Nom d'utilisateur du partage", +"URL" => "URL", +"Secure https://" => "Sécurisation https://", +"Remote subfolder" => "Sous-dossier distant", "Access granted" => "Accès autorisé", "Error configuring Dropbox storage" => "Erreur lors de la configuration du support de stockage Dropbox", "Grant access" => "Autoriser l'accès", diff --git a/apps/files_external/l10n/gl.php b/apps/files_external/l10n/gl.php index ccbdcce7f3482b30b9dae20cac532aeaa616e11d..248afb5f6a7a8723629ecfe1bee5929160be25ff 100644 --- a/apps/files_external/l10n/gl.php +++ b/apps/files_external/l10n/gl.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Activar o estilo de ruta", "App key" => "Clave da API", "App secret" => "Secreto do aplicativo", -"URL" => "URL", +"Host" => "Servidor", "Username" => "Nome de usuario", "Password" => "Contrasinal", "Root" => "Root (raíz)", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Compartir", "SMB / CIFS using OC login" => "SMB / CIFS usando acceso OC", "Username as share" => "Nome de usuario como compartición", +"URL" => "URL", "Secure https://" => "https:// seguro", "Remote subfolder" => "Subcartafol remoto", "Access granted" => "Concedeuse acceso", diff --git a/apps/files_external/l10n/he.php b/apps/files_external/l10n/he.php index 67cbb0cba2a80df3e03f173c920591381a253f99..f55a35fcadecf2857692f7d5a986073efc6be56f 100644 --- a/apps/files_external/l10n/he.php +++ b/apps/files_external/l10n/he.php @@ -1,10 +1,11 @@ "מיקום", -"URL" => "כתובת", +"Host" => "מארח", "Username" => "שם משתמש", "Password" => "סיסמא", "Share" => "שיתוף", +"URL" => "כתובת", "Access granted" => "הוענקה גישה", "Error configuring Dropbox storage" => "אירעה שגיאה בעת הגדרת אחסון ב־Dropbox", "Grant access" => "הענקת גישה", diff --git a/apps/files_external/l10n/hu_HU.php b/apps/files_external/l10n/hu_HU.php index 831bd69c231b2c3ae20d8f29f9e3132f217e55a2..d9c570d68c9354847b221a608eb1a1742e330c9a 100644 --- a/apps/files_external/l10n/hu_HU.php +++ b/apps/files_external/l10n/hu_HU.php @@ -1,10 +1,11 @@ "Hely", -"URL" => "URL", +"Host" => "Kiszolgáló", "Username" => "Felhasználónév", "Password" => "Jelszó", "Share" => "Megosztás", +"URL" => "URL", "Access granted" => "Érvényes hozzáférés", "Error configuring Dropbox storage" => "A Dropbox tárolót nem sikerült beállítani", "Grant access" => "Megadom a hozzáférést", diff --git a/apps/files_external/l10n/ia.php b/apps/files_external/l10n/ia.php index 844af213d8bf19bf23c499b86b6ede10f2e73bd7..978003e20cb1aa98ebd1f2c2dbf3d08e84439fed 100644 --- a/apps/files_external/l10n/ia.php +++ b/apps/files_external/l10n/ia.php @@ -1,10 +1,10 @@ "Loco", -"URL" => "URL", "Username" => "Nomine de usator", "Password" => "Contrasigno", "Share" => "Compartir", +"URL" => "URL", "Folder name" => "Nomine de dossier", "Groups" => "Gruppos", "Users" => "Usatores", diff --git a/apps/files_external/l10n/id.php b/apps/files_external/l10n/id.php index dd383c4636b72242f94fb2397655aa66b60be42a..a21ea7aef7b84ffb6b72477e8df46be22c031d61 100644 --- a/apps/files_external/l10n/id.php +++ b/apps/files_external/l10n/id.php @@ -7,12 +7,13 @@ $TRANSLATIONS = array( "Port (optional)" => "Port (tambahan)", "Region (optional)" => "Wilayah (tambahan)", "Enable SSL" => "Aktifkan SSL", -"URL" => "tautan", +"Host" => "Host", "Username" => "Nama Pengguna", "Password" => "Sandi", "Root" => "Root", "Username (required)" => "Nama pengguna (dibutuhkan)", "Share" => "Bagikan", +"URL" => "tautan", "Access granted" => "Akses diberikan", "Error configuring Dropbox storage" => "Kesalahan dalam mengonfigurasi penyimpanan Dropbox", "Grant access" => "Berikan hak akses", diff --git a/apps/files_external/l10n/is.php b/apps/files_external/l10n/is.php index 39b750189dcfb84a916f64bf11245ff3f204ca02..daf9c4cb4417742e0af73cf1ef8effc5afa42ecd 100644 --- a/apps/files_external/l10n/is.php +++ b/apps/files_external/l10n/is.php @@ -1,10 +1,11 @@ "Staðsetning", -"URL" => "URL", +"Host" => "Netþjónn", "Username" => "Notendanafn", "Password" => "Lykilorð", "Share" => "Deila", +"URL" => "URL", "Access granted" => "Aðgengi veitt", "Error configuring Dropbox storage" => "Villa við að setja upp Dropbox gagnasvæði", "Grant access" => "Veita aðgengi", diff --git a/apps/files_external/l10n/it.php b/apps/files_external/l10n/it.php index bc5b9d6dcee0392012a0fa270e9a9174a708c890..c6428a27ba196821b915cd239792805424521213 100644 --- a/apps/files_external/l10n/it.php +++ b/apps/files_external/l10n/it.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Abilita stile percorsi", "App key" => "Chiave applicazione", "App secret" => "Segreto applicazione", -"URL" => "URL", +"Host" => "Host", "Username" => "Nome utente", "Password" => "Password", "Root" => "Radice", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Condividi", "SMB / CIFS using OC login" => "SMB / CIFS utilizzando le credenziali di OC", "Username as share" => "Nome utente come condivisione", +"URL" => "URL", "Secure https://" => "Sicuro https://", "Remote subfolder" => "Sottocartella remota", "Access granted" => "Accesso consentito", diff --git a/apps/files_external/l10n/ja.php b/apps/files_external/l10n/ja.php index 17337f28ba29329bd272664c9d2409fbe87402c2..b70dd2a09a45678ad49260caeab20ab87fa79a2e 100644 --- a/apps/files_external/l10n/ja.php +++ b/apps/files_external/l10n/ja.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "パス形式を有効", "App key" => "アプリキー", "App secret" => "アプリシークレット", -"URL" => "URL", +"Host" => "ホスト", "Username" => "ユーザー名", "Password" => "パスワード", "Root" => "ルート", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "共有", "SMB / CIFS using OC login" => "owncloudログインで SMB/CIFSを使用", "Username as share" => "共有名", +"URL" => "URL", "Secure https://" => "セキュア https://", "Remote subfolder" => "リモートサブフォルダ", "Access granted" => "アクセスは許可されました", diff --git a/apps/files_external/l10n/ka_GE.php b/apps/files_external/l10n/ka_GE.php index f7eb01ba94a81e8f2c52606d255dd169512bdbda..a87c8b4879ad9a8d07b3646bbb84e37ca2905d9c 100644 --- a/apps/files_external/l10n/ka_GE.php +++ b/apps/files_external/l10n/ka_GE.php @@ -1,10 +1,11 @@ "ადგილმდებარეობა", -"URL" => "URL", +"Host" => "ჰოსტი", "Username" => "მომხმარებლის სახელი", "Password" => "პაროლი", "Share" => "გაზიარება", +"URL" => "URL", "Access granted" => "დაშვება მინიჭებულია", "Error configuring Dropbox storage" => "შეცდომა Dropbox საცავის კონფიგურირების დროს", "Grant access" => "დაშვების მინიჭება", diff --git a/apps/files_external/l10n/km.php b/apps/files_external/l10n/km.php index 24cd4cb6e6b49664c9ba760620ad7f79fb10b349..da17fac1bffdf4dd55a303920ceb3ea7a3226688 100644 --- a/apps/files_external/l10n/km.php +++ b/apps/files_external/l10n/km.php @@ -1,13 +1,22 @@ "ទីតាំង", -"URL" => "URL", +"Host" => "ម៉ាស៊ីន​ផ្ទុក", "Username" => "ឈ្មោះ​អ្នកប្រើ", "Password" => "ពាក្យសម្ងាត់", "Share" => "ចែក​រំលែក", +"URL" => "URL", +"Access granted" => "បាន​ទទួល​សិទ្ធិ​ចូល", +"Error configuring Dropbox storage" => "កំហុស​ការ​កំណត់​សណ្ឋាន​នៃ​ឃ្លាំងផ្ទុក Dropbox", +"Grant access" => "ទទួល​សិទ្ធិ​ចូល", "Saved" => "បាន​រក្សាទុក", +"External Storage" => "ឃ្លាំងផ្ទុក​ខាងក្រៅ", "Folder name" => "ឈ្មោះ​ថត", +"External storage" => "ឃ្លាំងផ្ទុក​ខាងក្រៅ", +"Configuration" => "ការ​កំណត់​សណ្ឋាន", "Options" => "ជម្រើស", +"Add storage" => "បន្ថែម​ឃ្លាំងផ្ទុក", +"All Users" => "អ្នក​ប្រើ​ទាំងអស់", "Groups" => "ក្រុ", "Users" => "អ្នកប្រើ", "Delete" => "លុប" diff --git a/apps/files_external/l10n/ko.php b/apps/files_external/l10n/ko.php index 6ae8ffdeb8fb26be9096b9ce9b5d70ce983a9003..631f95bc7b956cbfb4ae1687e71b572f1606f64c 100644 --- a/apps/files_external/l10n/ko.php +++ b/apps/files_external/l10n/ko.php @@ -2,10 +2,11 @@ $TRANSLATIONS = array( "Location" => "장소", "Amazon S3" => "Amazon S3", -"URL" => "URL", +"Host" => "호스트", "Username" => "사용자 이름", "Password" => "암호", "Share" => "공유", +"URL" => "URL", "Access granted" => "접근 허가됨", "Error configuring Dropbox storage" => "Dropbox 저장소 설정 오류", "Grant access" => "접근 권한 부여", diff --git a/apps/files_external/l10n/ku_IQ.php b/apps/files_external/l10n/ku_IQ.php index 72cc813352e354cf76003741d2e39c5de3e789f5..3d5a3dd0d3263a0311f67c3d58b7f78819bb8507 100644 --- a/apps/files_external/l10n/ku_IQ.php +++ b/apps/files_external/l10n/ku_IQ.php @@ -1,10 +1,10 @@ "شوێن", -"URL" => "ناونیشانی به‌سته‌ر", "Username" => "ناوی به‌کارهێنه‌ر", "Password" => "وشەی تێپەربو", "Share" => "هاوبەشی کردن", +"URL" => "ناونیشانی به‌سته‌ر", "Folder name" => "ناوی بوخچه", "Users" => "به‌كارهێنه‌ر" ); diff --git a/apps/files_external/l10n/lb.php b/apps/files_external/l10n/lb.php index 49517e7af3ddf47d03f200c177c138e70ed04ee5..233b3f810511e3cdffcd340abab0c78011bffd57 100644 --- a/apps/files_external/l10n/lb.php +++ b/apps/files_external/l10n/lb.php @@ -1,10 +1,11 @@ "Uert", -"URL" => "URL", +"Host" => "Host", "Username" => "Benotzernumm", "Password" => "Passwuert", "Share" => "Deelen", +"URL" => "URL", "Folder name" => "Dossiers Numm:", "Groups" => "Gruppen", "Users" => "Benotzer", diff --git a/apps/files_external/l10n/lt_LT.php b/apps/files_external/l10n/lt_LT.php index 736becc58d5ab34854101c4bb7cb1f0e8d1bc20f..908abcc74885a5b9acda50200df029406009d3ca 100644 --- a/apps/files_external/l10n/lt_LT.php +++ b/apps/files_external/l10n/lt_LT.php @@ -1,10 +1,11 @@ "Vieta", -"URL" => "URL", +"Host" => "Mazgas", "Username" => "Prisijungimo vardas", "Password" => "Slaptažodis", "Share" => "Dalintis", +"URL" => "URL", "Access granted" => "Priėjimas suteiktas", "Error configuring Dropbox storage" => "Klaida nustatinėjant Dropbox talpyklą", "Grant access" => "Suteikti priėjimą", diff --git a/apps/files_external/l10n/lv.php b/apps/files_external/l10n/lv.php index 3506e55323a8622bb79113f68dbc8723dcf37ef8..5234bda7dce11d56a4f9d82674e0064c43531a2f 100644 --- a/apps/files_external/l10n/lv.php +++ b/apps/files_external/l10n/lv.php @@ -1,10 +1,11 @@ "Vieta", -"URL" => "URL", +"Host" => "Resursdators", "Username" => "Lietotājvārds", "Password" => "Parole", "Share" => "Dalīties", +"URL" => "URL", "Access granted" => "Piešķirta pieeja", "Error configuring Dropbox storage" => "Kļūda, konfigurējot Dropbox krātuvi", "Grant access" => "Piešķirt pieeju", diff --git a/apps/files_external/l10n/mk.php b/apps/files_external/l10n/mk.php index 0a72b65168acb72fd843512f1bda5f585b59db78..e1bf57d5b93f48711984d569c2b8447cc759dcdb 100644 --- a/apps/files_external/l10n/mk.php +++ b/apps/files_external/l10n/mk.php @@ -1,10 +1,11 @@ "Локација", -"URL" => "Адреса", +"Host" => "Домаќин", "Username" => "Корисничко име", "Password" => "Лозинка", "Share" => "Сподели", +"URL" => "Адреса", "Access granted" => "Пристапот е дозволен", "Error configuring Dropbox storage" => "Грешка при конфигурација на Dropbox", "Grant access" => "Дозволи пристап", diff --git a/apps/files_external/l10n/ms_MY.php b/apps/files_external/l10n/ms_MY.php index 789527e4a49171fba04dc0461c99b586d8a5ca46..e19ec499780ded8746877df7172bc0bdf7d5013b 100644 --- a/apps/files_external/l10n/ms_MY.php +++ b/apps/files_external/l10n/ms_MY.php @@ -1,10 +1,10 @@ "Lokasi", -"URL" => "URL", "Username" => "Nama pengguna", "Password" => "Kata laluan", "Share" => "Kongsi", +"URL" => "URL", "Groups" => "Kumpulan", "Users" => "Pengguna", "Delete" => "Padam" diff --git a/apps/files_external/l10n/nb_NO.php b/apps/files_external/l10n/nb_NO.php index f1f0a09fd533143f34a2d7107a98f471a9d18d85..7897f4b3f8d812026e059510757720818d26c5eb 100644 --- a/apps/files_external/l10n/nb_NO.php +++ b/apps/files_external/l10n/nb_NO.php @@ -3,10 +3,11 @@ $TRANSLATIONS = array( "Local" => "Lokal", "Location" => "Sted", "Amazon S3" => "Amazon S3", -"URL" => "URL", +"Host" => "Tjener", "Username" => "Brukernavn", "Password" => "Passord", "Share" => "Del", +"URL" => "URL", "Access granted" => "Tilgang innvilget", "Error configuring Dropbox storage" => "Feil ved konfigurering av Dropbox-lagring", "Grant access" => "Gi tilgang", diff --git a/apps/files_external/l10n/nl.php b/apps/files_external/l10n/nl.php index 2e88c1874048fc9b4a845b7f4cb97c0bb9eba8ce..2bdc047e96d8c936a16fa9654c7996d84e47a67a 100644 --- a/apps/files_external/l10n/nl.php +++ b/apps/files_external/l10n/nl.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Activeren pad stijl", "App key" => "App key", "App secret" => "App secret", -"URL" => "URL", +"Host" => "Host", "Username" => "Gebruikersnaam", "Password" => "Wachtwoord", "Root" => "Root", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Share", "SMB / CIFS using OC login" => "SMB / CIFS via OC inlog", "Username as share" => "Gebruikersnaam als share", +"URL" => "URL", "Secure https://" => "Secure https://", "Remote subfolder" => "Externe submap", "Access granted" => "Toegang toegestaan", diff --git a/apps/files_external/l10n/nn_NO.php b/apps/files_external/l10n/nn_NO.php index 542d3ec0421aefcf60a30bfe884b4d6384464d47..0ee80369eec4417ae7ffd3ab791c5f280a667f52 100644 --- a/apps/files_external/l10n/nn_NO.php +++ b/apps/files_external/l10n/nn_NO.php @@ -1,10 +1,11 @@ "Stad", -"URL" => "Nettstad", +"Host" => "Tenar", "Username" => "Brukarnamn", "Password" => "Passord", "Share" => "Del", +"URL" => "Nettstad", "Folder name" => "Mappenamn", "Configuration" => "Innstillingar", "Groups" => "Grupper", diff --git a/apps/files_external/l10n/oc.php b/apps/files_external/l10n/oc.php index e854c9f25ae5b48927b1d783c8d252e6a46def3a..bd5c98ca0513858026a9705d16abab385707654c 100644 --- a/apps/files_external/l10n/oc.php +++ b/apps/files_external/l10n/oc.php @@ -1,10 +1,10 @@ "Plaça", -"URL" => "URL", "Username" => "Non d'usancièr", "Password" => "Senhal", "Share" => "Parteja", +"URL" => "URL", "Groups" => "Grops", "Users" => "Usancièrs", "Delete" => "Escafa" diff --git a/apps/files_external/l10n/pl.php b/apps/files_external/l10n/pl.php index 9c13371b166ff7f1ae78be91b0204ef64ace6e79..74d9347b606717aa837a1e0ad936f9113fb42c07 100644 --- a/apps/files_external/l10n/pl.php +++ b/apps/files_external/l10n/pl.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Włącz styl ścieżki", "App key" => "Klucz aplikacji", "App secret" => "Hasło aplikacji", -"URL" => "URL", +"Host" => "Host", "Username" => "Nazwa użytkownika", "Password" => "Hasło", "Root" => "Root", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Udostępnij", "SMB / CIFS using OC login" => "SMB / CIFS przy użyciu loginu OC", "Username as share" => "Użytkownik jako zasób", +"URL" => "URL", "Secure https://" => "Bezpieczny https://", "Remote subfolder" => "Zdalny podfolder", "Access granted" => "Dostęp do", diff --git a/apps/files_external/l10n/pt_BR.php b/apps/files_external/l10n/pt_BR.php index d9544ae159775828555e192fc5af83172cc6f147..b027a92e50e3e170b122d566e0918f04a91eb21c 100644 --- a/apps/files_external/l10n/pt_BR.php +++ b/apps/files_external/l10n/pt_BR.php @@ -16,7 +16,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Habilitar Estilo do Caminho", "App key" => "Chave do Aplicativo", "App secret" => "Segredo da Aplicação", -"URL" => "URL", +"Host" => "Servidor", "Username" => "Nome de Usuário", "Password" => "Senha", "Root" => "Raiz", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Compartilhar", "SMB / CIFS using OC login" => "SMB / CIFS usando OC logon", "Username as share" => "Nome de usuário como compartilhado", +"URL" => "URL", "Secure https://" => "https:// segura", "Remote subfolder" => "Subpasta remota", "Access granted" => "Acesso concedido", diff --git a/apps/files_external/l10n/pt_PT.php b/apps/files_external/l10n/pt_PT.php index 767ddeec8a661420385227b9f3ba933a3c7d7d3b..27919976deed4fc4d3c56e3e13a209ce7066f1df 100644 --- a/apps/files_external/l10n/pt_PT.php +++ b/apps/files_external/l10n/pt_PT.php @@ -12,14 +12,18 @@ $TRANSLATIONS = array( "Enable SSL" => "Activar SSL", "App key" => "Chave da aplicação", "App secret" => "Chave secreta da aplicação", -"URL" => "URL", +"Host" => "Endereço", "Username" => "Nome de utilizador", "Password" => "Palavra-passe", "Root" => "Raiz", +"Secure ftps://" => "ftps:// Seguro", "Client ID" => "ID Cliente", "Client secret" => "Segredo do cliente", "Username (required)" => "Utilizador (requerido)", "Share" => "Partilhar", +"Username as share" => "Utilizar nome de utilizador como partilha", +"URL" => "URL", +"Secure https://" => "https:// Seguro", "Remote subfolder" => "Sub-pasta remota ", "Access granted" => "Acesso autorizado", "Error configuring Dropbox storage" => "Erro ao configurar o armazenamento do Dropbox", diff --git a/apps/files_external/l10n/ro.php b/apps/files_external/l10n/ro.php index cc48e20ab08cd4f2057676027a963318634562f9..d5e1e90c54aeb1c9d829ce31e21c3d9030d1e2aa 100644 --- a/apps/files_external/l10n/ro.php +++ b/apps/files_external/l10n/ro.php @@ -1,10 +1,11 @@ "Locație", -"URL" => "URL", +"Host" => "Gazdă", "Username" => "Nume utilizator", "Password" => "Parolă", "Share" => "Partajează", +"URL" => "URL", "Access granted" => "Acces permis", "Error configuring Dropbox storage" => "Eroare la configurarea mediului de stocare Dropbox", "Grant access" => "Permite accesul", diff --git a/apps/files_external/l10n/ru.php b/apps/files_external/l10n/ru.php index f8037d1cdfa1c879f79013b2311e8bb7a423340c..b4985dd5dc9dd34c2bdb5de7d34c36a15135eb79 100644 --- a/apps/files_external/l10n/ru.php +++ b/apps/files_external/l10n/ru.php @@ -2,22 +2,36 @@ $TRANSLATIONS = array( "Local" => "Локально", "Location" => "Местоположение", -"URL" => "Ссылка", +"Amazon S3" => "Amazon S3", +"Hostname (optional)" => "Хост (опц.)", +"Port (optional)" => "Порт (опц.)", +"Region (optional)" => "Регион (опционально)", +"Enable SSL" => "Включить SSL", +"Host" => "Сервер", "Username" => "Имя пользователя", "Password" => "Пароль", +"Secure ftps://" => "Безопасный ftps://", +"Username (required)" => "Имя пользователя (обяз.)", "Share" => "Открыть доступ", +"URL" => "Ссылка", +"Secure https://" => "Безопасный https://", "Access granted" => "Доступ предоставлен", "Error configuring Dropbox storage" => "Ошибка при настройке хранилища Dropbox", "Grant access" => "Предоставление доступа", "Please provide a valid Dropbox app key and secret." => "Пожалуйста, предоставьте действующий ключ Dropbox и пароль.", "Error configuring Google Drive storage" => "Ошибка при настройке хранилища Google Drive", "Saved" => "Сохранено", +"Note: " => "Примечание: ", +" and " => "и", +"Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." => "Примечание: Поддержка cURL в PHP не включена или не установлен модуль. Подключение %s невозможно. Обратитесь к вашему системному администратору.", "External Storage" => "Внешний носитель", "Folder name" => "Имя папки", "External storage" => "Внешний носитель данных", "Configuration" => "Конфигурация", "Options" => "Опции", +"Available for" => "Доступно для", "Add storage" => "Добавить носитель данных", +"No user or group" => "Нет пользователя или группы", "All Users" => "Все пользователи", "Groups" => "Группы", "Users" => "Пользователи", diff --git a/apps/files_external/l10n/si_LK.php b/apps/files_external/l10n/si_LK.php index 908f82d8ee931fc9dcde94fb7c13ca12e53ac0a6..960ededaa6378032c2dbd3c4772c321590658a73 100644 --- a/apps/files_external/l10n/si_LK.php +++ b/apps/files_external/l10n/si_LK.php @@ -1,10 +1,11 @@ "ස්ථානය", -"URL" => "URL", +"Host" => "සත්කාරකය", "Username" => "පරිශීලක නම", "Password" => "මුර පදය", "Share" => "බෙදා හදා ගන්න", +"URL" => "URL", "Access granted" => "පිවිසීමට හැක", "Error configuring Dropbox storage" => "Dropbox ගබඩාව වින්‍යාස කිරීමේ දෝශයක් ඇත", "Grant access" => "පිවිසුම ලබාදෙන්න", diff --git a/apps/files_external/l10n/sk_SK.php b/apps/files_external/l10n/sk_SK.php index e30b007c3cb8422f4f08df896192f9149e8183b0..f576d92cdac60b2d00d5dd94eaf079e1f738f627 100644 --- a/apps/files_external/l10n/sk_SK.php +++ b/apps/files_external/l10n/sk_SK.php @@ -2,10 +2,11 @@ $TRANSLATIONS = array( "Local" => "Lokálny", "Location" => "Umiestnenie", -"URL" => "URL", +"Host" => "Hostiteľ", "Username" => "Používateľské meno", "Password" => "Heslo", "Share" => "Zdieľať", +"URL" => "URL", "Access granted" => "Prístup povolený", "Error configuring Dropbox storage" => "Chyba pri konfigurácii úložiska Dropbox", "Grant access" => "Povoliť prístup", diff --git a/apps/files_external/l10n/sl.php b/apps/files_external/l10n/sl.php index eceffdfc6230c28fc4a6078d56b18b835461767e..c47e962b6e864c33771f62e4d0854caea94a0ba5 100644 --- a/apps/files_external/l10n/sl.php +++ b/apps/files_external/l10n/sl.php @@ -15,7 +15,7 @@ $TRANSLATIONS = array( "Enable Path Style" => "Omogoči slog poti", "App key" => "Programski ključ", "App secret" => "Skrivni programski ključ", -"URL" => "Naslov URL", +"Host" => "Gostitelj", "Username" => "Uporabniško ime", "Password" => "Geslo", "Root" => "Koren", @@ -26,6 +26,7 @@ $TRANSLATIONS = array( "Share" => "Souporaba", "SMB / CIFS using OC login" => "SMB / CIFS z uporabo prijave OC", "Username as share" => "Uporabniško ime za souporabo", +"URL" => "Naslov URL", "Secure https://" => "Varni način https://", "Remote subfolder" => "Oddaljena podrejena mapa", "Access granted" => "Dostop je odobren", diff --git a/apps/files_external/l10n/sq.php b/apps/files_external/l10n/sq.php index 563a1b7dd926ba8aa732f23b4bdf5743914e8afa..1904514fdc4791e70bef38a1e834ec200f6198c2 100644 --- a/apps/files_external/l10n/sq.php +++ b/apps/files_external/l10n/sq.php @@ -1,10 +1,11 @@ "Vendndodhja", -"URL" => "URL-i", +"Host" => "Pritësi", "Username" => "Përdoruesi", "Password" => "fjalëkalim", "Share" => "Ndaj", +"URL" => "URL-i", "Groups" => "Grupet", "Users" => "Përdoruesit", "Delete" => "Elimino" diff --git a/apps/files_external/l10n/sr.php b/apps/files_external/l10n/sr.php index b0276764a8dc296f52dd8716e50093a07beb19c9..bf150f5b5b0fb4472a9e9c67ed5bbae1f833f4ee 100644 --- a/apps/files_external/l10n/sr.php +++ b/apps/files_external/l10n/sr.php @@ -1,6 +1,7 @@ "Локација", +"Host" => "Домаћин", "Username" => "Корисничко име", "Password" => "Лозинка", "Share" => "Дели", diff --git a/apps/files_external/l10n/sv.php b/apps/files_external/l10n/sv.php index a15ea0ed164473ad545bc9330a8aaf56374119e3..686ac791942c07cd60ebc2f04a8ece4fc4ff13fc 100644 --- a/apps/files_external/l10n/sv.php +++ b/apps/files_external/l10n/sv.php @@ -2,10 +2,22 @@ $TRANSLATIONS = array( "Local" => "Lokal", "Location" => "Plats", -"URL" => "URL", +"Amazon S3" => "Amazon S3", +"Key" => "Nyckel", +"Secret" => "Hemlig", +"Hostname (optional)" => "Värdnamn (valfritt)", +"Port (optional)" => "Port (valfritt)", +"Region (optional)" => "Region (valfritt)", +"Enable SSL" => "Aktivera SSL", +"Host" => "Server", "Username" => "Användarnamn", "Password" => "Lösenord", +"Root" => "Root", +"Secure ftps://" => "Säker ftps://", +"Username (required)" => "Användarnamn (måste anges)", "Share" => "Dela", +"URL" => "URL", +"Secure https://" => "Säker https://", "Access granted" => "Åtkomst beviljad", "Error configuring Dropbox storage" => "Fel vid konfigurering av Dropbox", "Grant access" => "Bevilja åtkomst", diff --git a/apps/files_external/l10n/ta_LK.php b/apps/files_external/l10n/ta_LK.php index 066cf411dd612cc981dc59d2af956571faad099e..a94b7417ff5ea1cff26aa138edc6a1a930622a57 100644 --- a/apps/files_external/l10n/ta_LK.php +++ b/apps/files_external/l10n/ta_LK.php @@ -1,10 +1,11 @@ "இடம்", -"URL" => "URL", +"Host" => "ஓம்புனர்", "Username" => "பயனாளர் பெயர்", "Password" => "கடவுச்சொல்", "Share" => "பகிர்வு", +"URL" => "URL", "Access granted" => "அனுமதி வழங்கப்பட்டது", "Error configuring Dropbox storage" => "Dropbox சேமிப்பை தகவமைப்பதில் வழு", "Grant access" => "அனுமதியை வழங்கல்", diff --git a/apps/files_external/l10n/th_TH.php b/apps/files_external/l10n/th_TH.php index 3edf8c6382427236ecbee258f17c2d30f1e81a70..9f393a2546f46dd9878d1fe55433a9c9f4801735 100644 --- a/apps/files_external/l10n/th_TH.php +++ b/apps/files_external/l10n/th_TH.php @@ -1,10 +1,11 @@ "ตำแหน่งที่อยู่", -"URL" => "URL", +"Host" => "โฮสต์", "Username" => "ชื่อผู้ใช้งาน", "Password" => "รหัสผ่าน", "Share" => "แชร์", +"URL" => "URL", "Access granted" => "การเข้าถึงได้รับอนุญาตแล้ว", "Error configuring Dropbox storage" => "เกิดข้อผิดพลาดในการกำหนดค่าพื้นที่จัดเก็บข้อมูล Dropbox", "Grant access" => "อนุญาตให้เข้าถึงได้", diff --git a/apps/files_external/l10n/tr.php b/apps/files_external/l10n/tr.php index aa3290bd4bca936a4a63cca5ec0cf5abd32f6102..346d2a8be3f8cdccfb9c09da286a8924cea8896b 100644 --- a/apps/files_external/l10n/tr.php +++ b/apps/files_external/l10n/tr.php @@ -16,9 +16,9 @@ $TRANSLATIONS = array( "Enable Path Style" => "Yol Biçemini Etkinleştir", "App key" => "Uyg. anahtarı", "App secret" => "Uyg. parolası", -"URL" => "URL", -"Username" => "Kullanıcı Adı:", -"Password" => "Parola:", +"Host" => "Sunucu", +"Username" => "Kullanıcı Adı", +"Password" => "Parola", "Root" => "Kök", "Secure ftps://" => "Güvenli ftps://", "Client ID" => "İstemci Kimliğ", @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Share" => "Paylaş", "SMB / CIFS using OC login" => "OC oturumu kullanarak SMB / CIFS", "Username as share" => "Paylaşım olarak kullanıcı adı", +"URL" => "URL", "Secure https://" => "Güvenli https://", "Remote subfolder" => "Uzak alt klasör", "Access granted" => "Giriş kabul edildi", diff --git a/apps/files_external/l10n/ug.php b/apps/files_external/l10n/ug.php index bd7dc4298650328383a787a7605d70af0f8c6154..701a5457ae2e762cfcd946841903f63dcbd2e755 100644 --- a/apps/files_external/l10n/ug.php +++ b/apps/files_external/l10n/ug.php @@ -1,10 +1,11 @@ "ئورنى", -"URL" => "URL", +"Host" => "باش ئاپپارات", "Username" => "ئىشلەتكۈچى ئاتى", "Password" => "ئىم", "Share" => "ھەمبەھىر", +"URL" => "URL", "Folder name" => "قىسقۇچ ئاتى", "External storage" => "سىرتقى ساقلىغۇچ", "Configuration" => "سەپلىمە", diff --git a/apps/files_external/l10n/uk.php b/apps/files_external/l10n/uk.php index f644fe8606329d86f5b67141e7fbb310ec987f84..aea352a6863ee2f9df79a1c9bff96bc834b77393 100644 --- a/apps/files_external/l10n/uk.php +++ b/apps/files_external/l10n/uk.php @@ -1,10 +1,11 @@ "Місце", -"URL" => "URL", +"Host" => "Хост", "Username" => "Ім'я користувача", "Password" => "Пароль", "Share" => "Поділитися", +"URL" => "URL", "Access granted" => "Доступ дозволено", "Error configuring Dropbox storage" => "Помилка при налаштуванні сховища Dropbox", "Grant access" => "Дозволити доступ", diff --git a/apps/files_external/l10n/ur_PK.php b/apps/files_external/l10n/ur_PK.php index e2138b9046b15f4822ebddfe89411c7869f2cd2e..5d4695b5115839d356d3c4d51d123b6abeb5a098 100644 --- a/apps/files_external/l10n/ur_PK.php +++ b/apps/files_external/l10n/ur_PK.php @@ -1,7 +1,11 @@ "مقام", "Username" => "یوزر نیم", "Password" => "پاسورڈ", -"Users" => "یوزرز" +"Share" => "تقسیم", +"URL" => "یو ار ایل", +"Users" => "یوزرز", +"Delete" => "حذف کریں" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_external/l10n/vi.php b/apps/files_external/l10n/vi.php index 86d1236f665fab00fb66fa921d2af31637eb5533..03d50bc1433c740fff815b158be6abdc9cb0104b 100644 --- a/apps/files_external/l10n/vi.php +++ b/apps/files_external/l10n/vi.php @@ -1,10 +1,11 @@ "Vị trí", -"URL" => "URL", +"Host" => "Máy chủ", "Username" => "Tên đăng nhập", "Password" => "Mật khẩu", "Share" => "Chia sẻ", +"URL" => "URL", "Access granted" => "Đã cấp quyền truy cập", "Error configuring Dropbox storage" => "Lỗi cấu hình lưu trữ Dropbox ", "Grant access" => "Cấp quyền truy cập", diff --git a/apps/files_external/l10n/zh_CN.php b/apps/files_external/l10n/zh_CN.php index 53e76d1dd7bac472cb8e7f41b06109e9f521398a..95e9c0e643eb6885bf81ced9f8063825154fe57d 100644 --- a/apps/files_external/l10n/zh_CN.php +++ b/apps/files_external/l10n/zh_CN.php @@ -8,13 +8,14 @@ $TRANSLATIONS = array( "Port (optional)" => "端口 (可选)", "Region (optional)" => "区域 (optional)", "Enable SSL" => "启用 SSL", -"URL" => "URL", +"Host" => "主机", "Username" => "用户名", "Password" => "密码", "Root" => "根路径", "Secure ftps://" => "安全 ftps://", "Share" => "共享", "SMB / CIFS using OC login" => "SMB / CIFS 使用 OC 登录信息", +"URL" => "URL", "Secure https://" => "安全 https://", "Remote subfolder" => "远程子文件夹", "Access granted" => "权限已授予。", diff --git a/apps/files_external/l10n/zh_HK.php b/apps/files_external/l10n/zh_HK.php index b3a22c91bb2836bf8c2fd76761f7fb6cf4f02a23..05fa0921874fe1ffac1258fe750ed0d52996ffd2 100644 --- a/apps/files_external/l10n/zh_HK.php +++ b/apps/files_external/l10n/zh_HK.php @@ -1,10 +1,11 @@ "網址", "Username" => "用戶名稱", "Password" => "密碼", "Share" => "分享", +"URL" => "網址", "Folder name" => "資料夾名稱", +"Options" => "選項", "Groups" => "群組", "Users" => "用戶", "Delete" => "刪除" diff --git a/apps/files_external/l10n/zh_TW.php b/apps/files_external/l10n/zh_TW.php index a4b0ebe4dd53918397df85353356a29e2e32b120..154009f7a18306c4ab6fa65baa975898364c86ad 100644 --- a/apps/files_external/l10n/zh_TW.php +++ b/apps/files_external/l10n/zh_TW.php @@ -2,10 +2,11 @@ $TRANSLATIONS = array( "Local" => "本地", "Location" => "地點", -"URL" => "URL", +"Host" => "主機", "Username" => "使用者名稱:", "Password" => "密碼", "Share" => "分享", +"URL" => "URL", "Access granted" => "允許存取", "Error configuring Dropbox storage" => "設定 Dropbox 儲存時發生錯誤", "Grant access" => "允許存取", diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 2093fb7e58cf7aadf249db84cc9614fb904d4cb8..7ff17f0e98a3f371d7a0d823f931966fe54af6bb 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -25,7 +25,7 @@ namespace OC\Files\Storage; set_include_path(get_include_path() . PATH_SEPARATOR . - \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); + \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); require 'aws-autoloader.php'; use Aws\S3\S3Client; diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 15fbda927e0fde8e1040974ff02875d690d1f7d5..21f63bf439d31cb3aec9df64216353c7470da9e5 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -35,6 +35,7 @@ class OC_Mount_Config { const MOUNT_TYPE_GLOBAL = 'global'; const MOUNT_TYPE_GROUP = 'group'; const MOUNT_TYPE_USER = 'user'; + const MOUNT_TYPE_PERSONAL = 'personal'; // whether to skip backend test (for unit tests, as this static class is not mockable) public static $skipTest = false; @@ -126,6 +127,8 @@ class OC_Mount_Config { $datadir = \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data"); $mount_file = \OC_Config::getValue("mount_file", $datadir . "/mount.json"); + $backends = self::getBackends(); + //move config file to it's new position if (is_file(\OC::$SERVERROOT . '/config/mount.json')) { rename(\OC::$SERVERROOT . '/config/mount.json', $mount_file); @@ -133,12 +136,45 @@ class OC_Mount_Config { // Load system mount points $mountConfig = self::readData(); + + // Global mount points (is this redundant?) if (isset($mountConfig[self::MOUNT_TYPE_GLOBAL])) { foreach ($mountConfig[self::MOUNT_TYPE_GLOBAL] as $mountPoint => $options) { $options['options'] = self::decryptPasswords($options['options']); - $mountPoints[$mountPoint] = $options; + if (!isset($options['priority'])) { + $options['priority'] = $backends[$options['class']]['priority']; + } + + // Override if priority greater + if ( (!isset($mountPoints[$mountPoint])) + || ($options['priority'] >= $mountPoints[$mountPoint]['priority']) ) { + $options['priority_type'] = self::MOUNT_TYPE_GLOBAL; + $mountPoints[$mountPoint] = $options; + } } } + // All user mount points + if (isset($mountConfig[self::MOUNT_TYPE_USER]) && isset($mountConfig[self::MOUNT_TYPE_USER]['all'])) { + $mounts = $mountConfig[self::MOUNT_TYPE_USER]['all']; + foreach ($mounts as $mountPoint => $options) { + $mountPoint = self::setUserVars($user, $mountPoint); + foreach ($options as &$option) { + $option = self::setUserVars($user, $option); + } + $options['options'] = self::decryptPasswords($options['options']); + if (!isset($options['priority'])) { + $options['priority'] = $backends[$options['class']]['priority']; + } + + // Override if priority greater + if ( (!isset($mountPoints[$mountPoint])) + || ($options['priority'] >= $mountPoints[$mountPoint]['priority']) ) { + $options['priority_type'] = self::MOUNT_TYPE_GLOBAL; + $mountPoints[$mountPoint] = $options; + } + } + } + // Group mount points if (isset($mountConfig[self::MOUNT_TYPE_GROUP])) { foreach ($mountConfig[self::MOUNT_TYPE_GROUP] as $group => $mounts) { if (\OC_Group::inGroup($user, $group)) { @@ -148,21 +184,42 @@ class OC_Mount_Config { $option = self::setUserVars($user, $option); } $options['options'] = self::decryptPasswords($options['options']); - $mountPoints[$mountPoint] = $options; + if (!isset($options['priority'])) { + $options['priority'] = $backends[$options['class']]['priority']; + } + + // Override if priority greater or if priority type different + if ( (!isset($mountPoints[$mountPoint])) + || ($options['priority'] >= $mountPoints[$mountPoint]['priority']) + || ($mountPoints[$mountPoint]['priority_type'] !== self::MOUNT_TYPE_GROUP) ) { + $options['priority_type'] = self::MOUNT_TYPE_GROUP; + $mountPoints[$mountPoint] = $options; + } } } } } + // User mount points if (isset($mountConfig[self::MOUNT_TYPE_USER])) { foreach ($mountConfig[self::MOUNT_TYPE_USER] as $mountUser => $mounts) { - if ($mountUser === 'all' or strtolower($mountUser) === strtolower($user)) { + if (strtolower($mountUser) === strtolower($user)) { foreach ($mounts as $mountPoint => $options) { $mountPoint = self::setUserVars($user, $mountPoint); foreach ($options as &$option) { $option = self::setUserVars($user, $option); } $options['options'] = self::decryptPasswords($options['options']); - $mountPoints[$mountPoint] = $options; + if (!isset($options['priority'])) { + $options['priority'] = $backends[$options['class']]['priority']; + } + + // Override if priority greater or if priority type different + if ( (!isset($mountPoints[$mountPoint])) + || ($options['priority'] >= $mountPoints[$mountPoint]['priority']) + || ($mountPoints[$mountPoint]['priority_type'] !== self::MOUNT_TYPE_USER) ) { + $options['priority_type'] = self::MOUNT_TYPE_USER; + $mountPoints[$mountPoint] = $options; + } } } } @@ -173,6 +230,9 @@ class OC_Mount_Config { if (isset($mountConfig[self::MOUNT_TYPE_USER][$user])) { foreach ($mountConfig[self::MOUNT_TYPE_USER][$user] as $mountPoint => $options) { $options['options'] = self::decryptPasswords($options['options']); + + // Always override previous config + $options['priority_type'] = self::MOUNT_TYPE_PERSONAL; $mountPoints[$mountPoint] = $options; } } @@ -244,6 +304,9 @@ class OC_Mount_Config { $mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15); } $mount['options'] = self::decryptPasswords($mount['options']); + if (!isset($mount['priority'])) { + $mount['priority'] = $backends[$mount['class']]['priority']; + } // Remove '/$user/files/' from mount point $mountPoint = substr($mountPoint, 13); @@ -251,6 +314,7 @@ class OC_Mount_Config { 'class' => $mount['class'], 'mountpoint' => $mountPoint, 'backend' => $backends[$mount['class']]['backend'], + 'priority' => $mount['priority'], 'options' => $mount['options'], 'applicable' => array('groups' => array($group), 'users' => array()), 'status' => self::getBackendStatus($mount['class'], $mount['options'], false) @@ -275,12 +339,16 @@ class OC_Mount_Config { $mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15); } $mount['options'] = self::decryptPasswords($mount['options']); + if (!isset($mount['priority'])) { + $mount['priority'] = $backends[$mount['class']]['priority']; + } // Remove '/$user/files/' from mount point $mountPoint = substr($mountPoint, 13); $config = array( 'class' => $mount['class'], 'mountpoint' => $mountPoint, 'backend' => $backends[$mount['class']]['backend'], + 'priority' => $mount['priority'], 'options' => $mount['options'], 'applicable' => array('groups' => array(), 'users' => array($user)), 'status' => self::getBackendStatus($mount['class'], $mount['options'], false) @@ -359,10 +427,11 @@ class OC_Mount_Config { * Add a mount point to the filesystem * @param string $mountPoint Mount point * @param string $class Backend class - * @param array Backend parameters for the class + * @param array $classOptions Backend parameters for the class * @param string $mountType MOUNT_TYPE_GROUP | MOUNT_TYPE_USER * @param string $applicable User or group to apply mount to - * @param bool Personal or system mount point i.e. is this being called from the personal or admin page + * @param bool $isPersonal Personal or system mount point i.e. is this being called from the personal or admin page + * @param int|null $priority Mount point priority, null for default * @return boolean */ public static function addMountPoint($mountPoint, @@ -370,7 +439,8 @@ class OC_Mount_Config { $classOptions, $mountType, $applicable, - $isPersonal = false) { + $isPersonal = false, + $priority = null) { $backends = self::getBackends(); $mountPoint = OC\Files\Filesystem::normalizePath($mountPoint); if ($mountPoint === '' || $mountPoint === '/') { @@ -400,28 +470,35 @@ class OC_Mount_Config { 'options' => self::encryptPasswords($classOptions)) ) ); + if (! $isPersonal && !is_null($priority)) { + $mount[$applicable][$mountPoint]['priority'] = $priority; + } + $mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL); - // Merge the new mount point into the current mount points - if (isset($mountPoints[$mountType])) { - if (isset($mountPoints[$mountType][$applicable])) { - $mountPoints[$mountType][$applicable] - = array_merge($mountPoints[$mountType][$applicable], $mount[$applicable]); + $mountPoints = self::mergeMountPoints($mountPoints, $mount, $mountType); + + // Set default priority if none set + if (!isset($mountPoints[$mountType][$applicable][$mountPoint]['priority'])) { + if (isset($backends[$class]['priority'])) { + $mountPoints[$mountType][$applicable][$mountPoint]['priority'] + = $backends[$class]['priority']; } else { - $mountPoints[$mountType] = array_merge($mountPoints[$mountType], $mount); + $mountPoints[$mountType][$applicable][$mountPoint]['priority'] + = 100; } - } else { - $mountPoints[$mountType] = $mount; } + self::writeData($isPersonal ? OCP\User::getUser() : NULL, $mountPoints); + return self::getBackendStatus($class, $classOptions, $isPersonal); } /** * - * @param string Mount point - * @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER - * @param string User or group to remove mount from - * @param bool Personal or system mount point + * @param string $mountPoint Mount point + * @param string $mountType MOUNT_TYPE_GROUP | MOUNT_TYPE_USER + * @param string $applicable User or group to remove mount from + * @param bool $isPersonal Personal or system mount point * @return bool */ public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) { @@ -618,9 +695,9 @@ class OC_Mount_Config { /** * Returns a dependency missing message - * @param $l OC_L10N - * @param $module string - * @param $backend string + * @param OC_L10N $l + * @param string $module + * @param string $backend * @return string */ private static function getSingleDependencyMessage($l, $module, $backend) { @@ -666,7 +743,7 @@ class OC_Mount_Config { /** * Encrypt a single password * @param string $password plain text password - * @return encrypted password + * @return string encrypted password */ private static function encryptPassword($password) { $cipher = self::getCipher(); @@ -678,7 +755,7 @@ class OC_Mount_Config { /** * Decrypts a single password * @param string $encryptedPassword encrypted password - * @return plain text password + * @return string plain text password */ private static function decryptPassword($encryptedPassword) { $cipher = self::getCipher(); @@ -689,6 +766,36 @@ class OC_Mount_Config { return $cipher->decrypt($binaryPassword); } + /** + * Merges mount points + * @param array $data Existing mount points + * @param array $mountPoint New mount point + * @param string $mountType + * @return array + */ + private static function mergeMountPoints($data, $mountPoint, $mountType) { + $applicable = key($mountPoint); + $mountPath = key($mountPoint[$applicable]); + if (isset($data[$mountType])) { + if (isset($data[$mountType][$applicable])) { + // Merge priorities + if (isset($data[$mountType][$applicable][$mountPath]) + && isset($data[$mountType][$applicable][$mountPath]['priority']) + && !isset($mountPoint[$applicable][$mountPath]['priority'])) { + $mountPoint[$applicable][$mountPath]['priority'] + = $data[$mountType][$applicable][$mountPath]['priority']; + } + $data[$mountType][$applicable] + = array_merge($data[$mountType][$applicable], $mountPoint[$applicable]); + } else { + $data[$mountType] = array_merge($data[$mountType], $mountPoint); + } + } else { + $data[$mountType] = $mountPoint; + } + return $data; + } + /** * Returns the encryption cipher */ diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 38de3360f2b40c348427e5c15a04774ebd67a33f..9f297d22dcb83bfd8a48512562f2c82f271f67ad 100755 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -44,7 +44,7 @@ class Dropbox extends \OC\Files\Storage\Common { $this->id = 'dropbox::'.$params['app_key'] . $params['token']. '/' . $this->root; $oauth = new \Dropbox_OAuth_Curl($params['app_key'], $params['app_secret']); $oauth->setToken($params['token'], $params['token_secret']); - $this->dropbox = new \Dropbox_API($oauth, 'dropbox'); + $this->dropbox = new \Dropbox_API($oauth, 'auto'); } else { throw new \Exception('Creating \OC\Files\Storage\Dropbox storage failed'); } @@ -63,10 +63,10 @@ class Dropbox extends \OC\Files\Storage\Common { } /** - * @brief Returns the path's metadata + * Returns the path's metadata * @param string $path path for which to return the metadata - * @param $list if true, also return the directory's contents - * @return directory contents if $list is true, file metadata if $list is + * @param bool $list if true, also return the directory's contents + * @return mixed directory contents if $list is true, file metadata if $list is * false, null if the file doesn't exist or "false" if the operation failed */ private function getMetaData($path, $list = false) { diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index b3f8b1444ae5d599de0ba504f8d2689adde0ca81..2650a94f85ef33656f7ae68f59a9609ff65954b9 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -64,7 +64,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{ /** * Unlinks file or directory - * @param string @path + * @param string $path */ public function unlink($path) { if ($this->is_dir($path)) { diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index b1d355323d9a078df9948f94367c0dc91ad6abb0..6e53c4a99310c9805ac8b5e76b886cb3a91bf4a8 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -83,7 +83,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ /** * Unlinks file or directory - * @param string @path + * @param string $path */ public function unlink($path) { if ($this->is_dir($path)) { diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index a202d3843cb212925b5ba82b5cea18064b653857..03364867b0c69829d4980d6270fbe5dcb425ca05 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -23,7 +23,7 @@ namespace OC\Files\Storage; set_include_path(get_include_path() . PATH_SEPARATOR . - \OC_App::getAppPath('files_external') . '/3rdparty/php-opencloud/lib'); + \OC_App::getAppPath('files_external') . '/3rdparty/php-opencloud/lib'); require_once 'openstack.php'; use \OpenCloud; @@ -31,25 +31,25 @@ use \OpenCloud\Common\Exceptions; class Swift extends \OC\Files\Storage\Common { - /** - * @var \OpenCloud\ObjectStore - */ + /** + * @var \OpenCloud\ObjectStore + */ private $connection; - /** - * @var \OpenCloud\ObjectStore\Container - */ + /** + * @var \OpenCloud\ObjectStore\Container + */ private $container; - /** - * @var \OpenCloud\OpenStack - */ + /** + * @var \OpenCloud\OpenStack + */ private $anchor; - /** - * @var string - */ + /** + * @var string + */ private $bucket; - /** - * @var array - */ + /** + * @var array + */ private static $tmpFiles = array(); /** diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php index 14fe1d90b7aac32679ee174778fdde5273b32d43..9b04e200e2b6933b52a0795ab911d5e5926dd4f5 100644 --- a/apps/files_external/tests/mountconfig.php +++ b/apps/files_external/tests/mountconfig.php @@ -41,16 +41,22 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase { const TEST_USER1 = 'user1'; const TEST_USER2 = 'user2'; const TEST_GROUP1 = 'group1'; + const TEST_GROUP1B = 'group1b'; const TEST_GROUP2 = 'group2'; + const TEST_GROUP2B = 'group2b'; public function setUp() { \OC_User::createUser(self::TEST_USER1, self::TEST_USER1); \OC_User::createUser(self::TEST_USER2, self::TEST_USER2); \OC_Group::createGroup(self::TEST_GROUP1); + \OC_Group::createGroup(self::TEST_GROUP1B); \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1); + \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1B); \OC_Group::createGroup(self::TEST_GROUP2); + \OC_Group::createGroup(self::TEST_GROUP2B); \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2); + \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2B); \OC_User::setUserId(self::TEST_USER1); $this->userHome = \OC_User::getHome(self::TEST_USER1); @@ -81,7 +87,9 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase { \OC_User::deleteUser(self::TEST_USER2); \OC_User::deleteUser(self::TEST_USER1); \OC_Group::deleteGroup(self::TEST_GROUP1); + \OC_Group::deleteGroup(self::TEST_GROUP1B); \OC_Group::deleteGroup(self::TEST_GROUP2); + \OC_Group::deleteGroup(self::TEST_GROUP2B); @unlink($this->dataDir . '/mount.json'); @@ -635,4 +643,161 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase { $this->assertEquals('ext', $config[1]['mountpoint']); $this->assertEquals($options2, $config[1]['options']); } + + public function priorityDataProvider() { + return array( + + // test 1 - group vs group + array( + array( + array( + 'isPersonal' => false, + 'mountType' => OC_Mount_Config::MOUNT_TYPE_GROUP, + 'applicable' => self::TEST_GROUP1, + 'priority' => 50 + ), + array( + 'isPersonal' => false, + 'mountType' => OC_Mount_Config::MOUNT_TYPE_GROUP, + 'applicable' => self::TEST_GROUP1B, + 'priority' => 60 + ) + ), + 1 + ), + // test 2 - user vs personal + array( + array( + array( + 'isPersonal' => false, + 'mountType' => OC_Mount_Config::MOUNT_TYPE_USER, + 'applicable' => self::TEST_USER1, + 'priority' => 2000 + ), + array( + 'isPersonal' => true, + 'mountType' => OC_Mount_Config::MOUNT_TYPE_USER, + 'applicable' => self::TEST_USER1, + 'priority' => null + ) + ), + 1 + ), + // test 3 - all vs group vs user + array( + array( + array( + 'isPersonal' => false, + 'mountType' => OC_Mount_Config::MOUNT_TYPE_USER, + 'applicable' => 'all', + 'priority' => 70 + ), + array( + 'isPersonal' => false, + 'mountType' => OC_Mount_Config::MOUNT_TYPE_GROUP, + 'applicable' => self::TEST_GROUP1, + 'priority' => 60 + ), + array( + 'isPersonal' => false, + 'mountType' => OC_Mount_Config::MOUNT_TYPE_USER, + 'applicable' => self::TEST_USER1, + 'priority' => 50 + ) + ), + 2 + ) + + ); + } + + /** + * Ensure priorities are being respected + * Test user is self::TEST_USER1 + * + * @dataProvider priorityDataProvider + * @param array[] $mounts array of associative array of mount parameters: + * bool $isPersonal + * string $mountType + * string $applicable + * int|null $priority null for personal + * @param int $expected index of expected visible mount + */ + public function testPriority($mounts, $expected) { + $mountConfig = array( + 'host' => 'somehost', + 'user' => 'someuser', + 'password' => 'somepassword', + 'root' => 'someroot' + ); + + // Add mount points + foreach($mounts as $i => $mount) { + $this->assertTrue( + OC_Mount_Config::addMountPoint( + '/ext', + '\OC\Files\Storage\SMB', + $mountConfig + array('id' => $i), + $mount['mountType'], + $mount['applicable'], + $mount['isPersonal'], + $mount['priority'] + ) + ); + } + + // Get mount points for user + $mountPoints = OC_Mount_Config::getAbsoluteMountPoints(self::TEST_USER1); + + $this->assertEquals(1, count($mountPoints)); + $this->assertEquals($expected, $mountPoints['/'.self::TEST_USER1.'/files/ext']['options']['id']); + } + + /** + * Test for persistence of priority when changing mount options + */ + public function testPriorityPersistence() { + $class = '\OC\Files\Storage\SMB'; + $priority = 123; + $mountConfig = array( + 'host' => 'somehost', + 'user' => 'someuser', + 'password' => 'somepassword', + 'root' => 'someroot' + ); + + $this->assertTrue( + OC_Mount_Config::addMountPoint( + '/ext', + $class, + $mountConfig, + OC_Mount_Config::MOUNT_TYPE_USER, + self::TEST_USER1, + false, + $priority + ) + ); + + // Check for correct priority + $mountPoints = OC_Mount_Config::getAbsoluteMountPoints(self::TEST_USER1); + $this->assertEquals($priority, + $mountPoints['/'.self::TEST_USER1.'/files/ext']['priority']); + + // Simulate changed mount options (without priority set) + $this->assertTrue( + OC_Mount_Config::addMountPoint( + '/ext', + $class, + $mountConfig, + OC_Mount_Config::MOUNT_TYPE_USER, + self::TEST_USER1, + false + ) + ); + + // Check for correct priority + $mountPoints = OC_Mount_Config::getAbsoluteMountPoints(self::TEST_USER1); + $this->assertEquals($priority, + $mountPoints['/'.self::TEST_USER1.'/files/ext']['priority']); + } } diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php index 4b645496253f704567b31e5895289e82dac105b0..82bacb3d38de4a41f141fbf8d62d2992097a757e 100644 --- a/apps/files_sharing/ajax/list.php +++ b/apps/files_sharing/ajax/list.php @@ -20,11 +20,6 @@ * */ -// only need filesystem apps -$RUNTIME_APPTYPES=array('filesystem'); - -// Init owncloud - if(!\OC_App::isEnabled('files_sharing')){ exit; } @@ -47,6 +42,9 @@ if (isset($_GET['dir'])) { $relativePath = $_GET['dir']; } +$sortAttribute = isset( $_GET['sort'] ) ? $_GET['sort'] : 'name'; +$sortDirection = isset( $_GET['sortdirection'] ) ? ($_GET['sortdirection'] === 'desc') : false; + $data = \OCA\Files_Sharing\Helper::setupFromToken($token, $relativePath, $password); $linkItem = $data['linkItem']; @@ -64,7 +62,7 @@ $data = array(); $baseUrl = OCP\Util::linkTo('files_sharing', 'index.php') . '?t=' . urlencode($token) . '&dir='; // make filelist -$files = \OCA\Files\Helper::getFiles($dir); +$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection); $formattedFiles = array(); foreach ($files as $file) { diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 0ef34578117434b00b36cab65ec056fd9478f939..fa43f33721c4606ba087356ee46954676221c125 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -9,6 +9,7 @@ OC::$CLASSPATH['OC\Files\Cache\Shared_Updater'] = 'files_sharing/lib/updater.php OC::$CLASSPATH['OC\Files\Cache\Shared_Watcher'] = 'files_sharing/lib/watcher.php'; OC::$CLASSPATH['OCA\Files\Share\Api'] = 'files_sharing/lib/api.php'; OC::$CLASSPATH['OCA\Files\Share\Maintainer'] = 'files_sharing/lib/maintainer.php'; +OC::$CLASSPATH['OCA\Files\Share\Proxy'] = 'files_sharing/lib/proxy.php'; OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup'); OCP\Share::registerBackend('file', 'OC_Share_Backend_File'); OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file'); @@ -18,3 +19,5 @@ OCP\Util::addScript('files_sharing', 'share'); \OC_Hook::connect('OC_Filesystem', 'delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook'); \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook'); \OC_Hook::connect('OC_Appconfig', 'post_set_value', '\OCA\Files\Share\Maintainer', 'configChangeHook'); + +OC_FileProxy::register(new OCA\Files\Share\Proxy()); diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 9b42c1e17b5a8ff757517a2f79e845f2e841aff3..077433a53abc814586bf78f73f1f7b47eae33217 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -4,8 +4,8 @@ Share Files File sharing between users AGPL - Michael Gapczynski - 4.93 + Michael Gapczynski, Bjoern Schiessle + 4.93 true diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css index 67d847019462d77f6ed4a7e1544d11eb38b8c39a..1bafb7807441cc96713ff3f97f35e1ab12ec93e3 100644 --- a/apps/files_sharing/css/public.css +++ b/apps/files_sharing/css/public.css @@ -1,7 +1,3 @@ -#controls { - left: 0; -} - #preview { background: #fff; text-align: center; @@ -48,13 +44,6 @@ p.info a { max-width:100%; } -/* some margin for the file type icon */ -#imgframe .publicpreview { - margin-top: 10%; -} - - - thead { padding-left: 0 !important; /* fixes multiselect bar offset on shared page */ } diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 0b4dec817643ae7f5d03732ba9365f4ad64c5047..d825ee9de15b227c2475192fc5e525553afc8b53 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -8,95 +8,170 @@ * */ -/* global OC, FileActions, FileList, Files */ +/* global FileActions, Files */ +/* global dragOptions, folderDropOptions */ +OCA.Sharing = {}; +if (!OCA.Files) { + OCA.Files = {}; +} +OCA.Sharing.PublicApp = { + _initialized: false, -$(document).ready(function() { - - var mimetype = $('#mimetype').val(); + initialize: function($el) { + var self = this; + if (this._initialized) { + return; + } + this._initialized = true; + this.initialDir = $('#dir').val(); - if (typeof FileActions !== 'undefined') { - // Show file preview if previewer is available, images are already handled by the template - if (mimetype.substr(0, mimetype.indexOf('/')) !== 'image' && $('.publicpreview').length === 0) { - // Trigger default action if not download TODO - var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ); - if (typeof action !== 'undefined') { - action($('#filename').val()); - } + // file list mode ? + if ($el.find('#filestable').length) { + this.fileList = new OCA.Files.FileList( + $el, + { + scrollContainer: $(window), + dragOptions: dragOptions, + folderDropOptions: folderDropOptions + } + ); + this.files = OCA.Files.Files; + this.files.initialize(); } - } - // dynamically load image previews - if (mimetype.substr(0, mimetype.indexOf('/')) === 'image' ) { + var mimetype = $('#mimetype').val(); - var params = { - x: $(document).width() * window.devicePixelRatio, - a: 'true', - file: encodeURIComponent($('#dir').val() + $('#filename').val()), - t: $('#sharingToken').val() - }; + if (typeof FileActions !== 'undefined') { + // Show file preview if previewer is available, images are already handled by the template + if (mimetype.substr(0, mimetype.indexOf('/')) !== 'image' && $('.publicpreview').length === 0) { + // Trigger default action if not download TODO + var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ); + if (typeof action !== 'undefined') { + action($('#filename').val()); + } + } + } - var img = $(''); - img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params)); - img.appendTo('#imgframe'); - } + // dynamically load image previews + if (mimetype.substr(0, mimetype.indexOf('/')) === 'image' ) { - // override since the format is different - if (typeof Files !== 'undefined') { - Files.getDownloadUrl = function(filename, dir) { - if ($.isArray(filename)) { - filename = JSON.stringify(filename); - } - var path = dir || FileList.getCurrentDirectory(); var params = { - service: 'files', + x: $(document).width() * window.devicePixelRatio, + a: 'true', + file: encodeURIComponent(this.initialDir + $('#filename').val()), t: $('#sharingToken').val(), - path: path, - files: filename, - download: null + scalingup: 0 }; - return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); - }; - Files.getAjaxUrl = function(action, params) { - params = params || {}; - params.t = $('#sharingToken').val(); - return OC.filePath('files_sharing', 'ajax', action + '.php') + '?' + OC.buildQueryString(params); - }; + var img = $(''); + img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params)); + img.appendTo('#imgframe'); + } - FileList.linkTo = function(dir) { - var params = { - service: 'files', - t: $('#sharingToken').val(), - dir: dir + if (this.fileList) { + // TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests) + this.fileList.getDownloadUrl = function(filename, dir) { + if ($.isArray(filename)) { + filename = JSON.stringify(filename); + } + var path = dir || FileList.getCurrentDirectory(); + var params = { + service: 'files', + t: $('#sharingToken').val(), + path: path, + files: filename, + download: null + }; + return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); }; - return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); - }; - Files.generatePreviewUrl = function(urlSpec) { - urlSpec.t = $('#dirToken').val(); - return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec); - }; + this.fileList.getAjaxUrl = function(action, params) { + params = params || {}; + params.t = $('#sharingToken').val(); + return OC.filePath('files_sharing', 'ajax', action + '.php') + '?' + OC.buildQueryString(params); + }; - var file_upload_start = $('#file_upload_start'); - file_upload_start.on('fileuploadadd', function(e, data) { - var fileDirectory = ''; - if(typeof data.files[0].relativePath !== 'undefined') { - fileDirectory = data.files[0].relativePath; - } + this.fileList.linkTo = function(dir) { + var params = { + service: 'files', + t: $('#sharingToken').val(), + dir: dir + }; + return OC.filePath('', '', 'public.php') + '?' + OC.buildQueryString(params); + }; - // Add custom data to the upload handler - data.formData = { - requesttoken: $('#publicUploadRequestToken').val(), - dirToken: $('#dirToken').val(), - subdir: $('input#dir').val(), - file_directory: fileDirectory + this.fileList.generatePreviewUrl = function(urlSpec) { + urlSpec.t = $('#dirToken').val(); + return OC.generateUrl('/apps/files_sharing/ajax/publicpreview.php?') + $.param(urlSpec); }; + + var file_upload_start = $('#file_upload_start'); + file_upload_start.on('fileuploadadd', function(e, data) { + var fileDirectory = ''; + if(typeof data.files[0].relativePath !== 'undefined') { + fileDirectory = data.files[0].relativePath; + } + + // Add custom data to the upload handler + data.formData = { + requesttoken: $('#publicUploadRequestToken').val(), + dirToken: $('#dirToken').val(), + subdir: self.fileList.getCurrentDirectory(), + file_directory: fileDirectory + }; + }); + + this.fileActions = _.extend({}, OCA.Files.FileActions); + this.fileActions.registerDefaultActions(this.fileList); + delete this.fileActions.actions.all.Share; + this.fileList.setFileActions(this.fileActions); + + this.fileList.changeDirectory(this.initialDir || '/', false, true); + + // URL history handling + this.fileList.$el.on('changeDirectory', _.bind(this._onDirectoryChanged, this)); + OC.Util.History.addOnPopStateHandler(_.bind(this._onUrlChanged, this)); + } + + $(document).on('click', '#directLink', function() { + $(this).focus(); + $(this).select(); }); + + // legacy + window.FileList = this.fileList; + }, + + _onDirectoryChanged: function(e) { + OC.Util.History.pushState({ + service: 'files', + t: $('#sharingToken').val(), + // arghhhh, why is this not called "dir" !? + path: e.dir + }); + }, + + _onUrlChanged: function(params) { + this.fileList.changeDirectory(params.path || params.dir, false, true); } +}; - $(document).on('click', '#directLink', function() { - $(this).focus(); - $(this).select(); - }); +$(document).ready(function() { + var App = OCA.Sharing.PublicApp; + App.initialize($('#preview')); + if (window.Files) { + // HACK: for oc-dialogs previews that depends on Files: + Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) { + return App.fileList.lazyLoadPreview({ + path: path, + mime: mime, + callback: ready, + width: width, + height: height, + etag: etag + }); + }; + } }); + diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 3c7c9239a6cbf3f870a3a253936ffeb27983210d..84c5bf57b38b457c6fa6d8c5254147a3ae18066f 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -8,31 +8,64 @@ * */ -/* global OC, t, FileList, FileActions */ +/* global FileList, FileActions */ $(document).ready(function() { - var disableSharing = $('#disableSharing').data('status'), - sharesLoaded = false; + var sharesLoaded = false; - if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) { - var oldCreateRow = FileList._createRow; - FileList._createRow = function(fileData) { - var tr = oldCreateRow.apply(this, arguments); - if (fileData.shareOwner) { - tr.attr('data-share-owner', fileData.shareOwner); - } - return tr; - }; + if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') { + // TODO: make a separate class for this or a hook or jQuery event ? + if (OCA.Files.FileList) { + var oldCreateRow = OCA.Files.FileList.prototype._createRow; + OCA.Files.FileList.prototype._createRow = function(fileData) { + var tr = oldCreateRow.apply(this, arguments); + if (fileData.shareOwner) { + tr.attr('data-share-owner', fileData.shareOwner); + // user should always be able to rename a mount point + if (fileData.isShareMountPoint) { + tr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE); + tr.attr('data-reshare-permissions', fileData.permissions); + } + } + return tr; + }; + } $('#fileList').on('fileActionsReady',function(){ + // if no share action exists because the admin disabled sharing for this user + // we create a share notification action to inform the user about files + // shared with him otherwise we just update the existing share action. + var $fileList = $(this); + $fileList.find('[data-share-owner]').each(function() { + var $tr = $(this); + var $action; + var owner; + var message; + var permissions = $tr.data('permissions'); + if(permissions & OC.PERMISSION_SHARE) { + $action = $tr.find('[data-Action="Share"]'); + $action.addClass('permanent'); + owner = $tr.closest('tr').attr('data-share-owner'); + message = ' ' + t('files_sharing', 'Shared by {owner}', {owner: owner}); + $action.find('span').text(message); + } else { + var shareNotification = '' + + ' '; + $tr.find('.fileactions').append(function() { + var owner = $(this).closest('tr').attr('data-share-owner'); + var shareBy = t('files_sharing', 'Shared by {owner}', {owner: owner}); + var $result = $(shareNotification + ' ' + shareBy + '
'); + $result.on('click', function() { + return false; + }); + return $result; + }); + } + }) - var allShared = $('#fileList').find('[data-share-owner] [data-Action="Share"]'); - allShared.addClass('permanent'); - allShared.find('span').text(function(){ - var $owner = $(this).closest('tr').attr('data-share-owner'); - return ' ' + t('files_sharing', 'Shared by {owner}', {owner: $owner}); - }); - + // FIXME: these calls are also working on hard-coded + // list selectors... if (!sharesLoaded){ OC.Share.loadIcons('file'); // assume that we got all shares, so switching directories @@ -44,13 +77,17 @@ $(document).ready(function() { } }); - FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) { + FileActions.register('all', 'Share', OC.PERMISSION_SHARE, OC.imagePath('core', 'actions/share'), function(filename) { var tr = FileList.findFileEl(filename); var itemType = 'file'; if ($(tr).data('type') == 'dir') { itemType = 'folder'; } - var possiblePermissions = $(tr).data('permissions'); + var possiblePermissions = $(tr).data('reshare-permissions'); + if (_.isUndefined(possiblePermissions)) { + possiblePermissions = $(tr).data('permissions'); + } + var appendTo = $(tr).find('td.filename'); // Check if drop down is already visible for a different file if (OC.Share.droppedDown) { diff --git a/apps/files_sharing/l10n/fa.php b/apps/files_sharing/l10n/fa.php index 1176401f1a30023e1f5dde3d03d1897386c7c495..fb6a4bc87098af7d1306b5e36ee1cfa366dfffb2 100644 --- a/apps/files_sharing/l10n/fa.php +++ b/apps/files_sharing/l10n/fa.php @@ -1,8 +1,17 @@ "اشتراک گذارنده {owner}", +"This share is password-protected" => "این اشتراک توسط رمز عبور محافظت می شود", "The password is wrong. Try again." => "رمزعبور اشتباه می باشد. دوباره امتحان کنید.", "Password" => "گذرواژه", -"Download" => "دانلود" +"Sorry, this link doesn’t seem to work anymore." => "متاسفانه این پیوند دیگر کار نمی کند", +"Reasons might be:" => "ممکن است به این دلایل باشد:", +"the item was removed" => "این مورد حذف شده است", +"the link expired" => "این پیوند منقضی شده است", +"sharing is disabled" => "قابلیت اشتراک گذاری غیرفعال است", +"For more info, please ask the person who sent this link." => "برای اطلاعات بیشتر، لطفا از شخصی که این پیوند را ارسال کرده سوال بفرمایید.", +"Download" => "دانلود", +"Download %s" => "دانلود %s", +"Direct link" => "پیوند مستقیم" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/l10n/km.php b/apps/files_sharing/l10n/km.php index db353c9cb7486bab848fa80fc8854ee27ad1b0cf..75f5679d97a37016b9ecd20212a7ad05a83393e8 100644 --- a/apps/files_sharing/l10n/km.php +++ b/apps/files_sharing/l10n/km.php @@ -1,6 +1,17 @@ "{owner} បាន​ចែក​រំលែក", +"This share is password-protected" => "ការ​ចែករំលែក​នេះ​ត្រូវ​បាន​ការពារ​ដោយ​ពាក្យ​សម្ងាត់", +"The password is wrong. Try again." => "ពាក្យ​សម្ងាត់​ខុស​ហើយ។ ព្យាយាម​ម្ដង​ទៀត។", "Password" => "ពាក្យសម្ងាត់", -"Download" => "ទាញយក" +"Sorry, this link doesn’t seem to work anymore." => "សូម​ទោស តំណ​នេះ​ហាក់​ដូច​ជា​លែង​ដើរ​ហើយ។", +"Reasons might be:" => "មូលហេតុ​អាច​ជា៖", +"the item was removed" => "របស់​ត្រូវ​បាន​ដក​ចេញ", +"the link expired" => "តំណ​ផុត​ពេល​កំណត់", +"sharing is disabled" => "មិន​អនុញ្ញាត​ការ​ចែករំលែក", +"For more info, please ask the person who sent this link." => "សម្រាប់​ព័ត៌មាន​បន្ថែម សូម​សួរ​អ្នក​ដែល​ផ្ញើ​តំណ​នេះ។", +"Download" => "ទាញយក", +"Download %s" => "ទាញយក %s", +"Direct link" => "តំណ​ផ្ទាល់" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php index 438d3cc4ba3702e23cc698b201b2a64275ff2866..21fd5d00a4ce227c1c79f2093323e1824d610e6a 100644 --- a/apps/files_sharing/lib/api.php +++ b/apps/files_sharing/lib/api.php @@ -25,7 +25,7 @@ namespace OCA\Files\Share; class Api { /** - * @brief get all shares + * get all shares * * @param array $params option 'file' to limit the result to a specific file/folder * @return \OC_OCS_Result share information @@ -60,7 +60,7 @@ class Api { } /** - * @brief get share information for a given share + * get share information for a given share * * @param array $params which contains a 'id' * @return \OC_OCS_Result share information @@ -76,7 +76,7 @@ class Api { } /** - * @brief collect all share information, either of a specific share or all + * collect all share information, either of a specific share or all * shares for a given path * @param array $params * @return \OC_OCS_Result @@ -130,7 +130,7 @@ class Api { } /** - * @brief add reshares to a array of shares + * add reshares to a array of shares * @param array $shares array of shares * @param int $itemSource item source ID * @return array new shares array which includes reshares @@ -161,7 +161,7 @@ class Api { } /** - * @brief get share from all files in a given folder (non-recursive) + * get share from all files in a given folder (non-recursive) * @param array $params contains 'path' to the folder * @return \OC_OCS_Result */ @@ -196,7 +196,7 @@ class Api { } /** - * @breif create a new share + * create a new share * @param array $params * @return \OC_OCS_Result */ @@ -313,7 +313,7 @@ class Api { } /** - * @brief update permissions for a share + * update permissions for a share * @param array $share information about the share * @param array $params contains 'permissions' * @return \OC_OCS_Result @@ -358,7 +358,7 @@ class Api { } /** - * @brief enable/disable public upload + * enable/disable public upload * @param array $share information about the share * @param array $params contains 'publicUpload' which can be 'yes' or 'no' * @return \OC_OCS_Result @@ -384,9 +384,9 @@ class Api { } /** - * @brief update password for public link share + * update password for public link share * @param array $share information about the share - * @param type $params 'password' + * @param array $params 'password' * @return \OC_OCS_Result */ private static function updatePassword($share, $params) { @@ -418,13 +418,18 @@ class Api { return new \OC_OCS_Result(null, 404, "share doesn't exists, can't change password"); } - $result = \OCP\Share::shareItem( - $itemType, - $itemSource, - \OCP\Share::SHARE_TYPE_LINK, - $shareWith, - $permissions - ); + try { + $result = \OCP\Share::shareItem( + $itemType, + $itemSource, + \OCP\Share::SHARE_TYPE_LINK, + $shareWith, + $permissions + ); + } catch (\Exception $e) { + return new \OC_OCS_Result(null, 403, $e->getMessage()); + } + if($result) { return new \OC_OCS_Result(); } @@ -433,7 +438,7 @@ class Api { } /** - * @brief unshare a file/folder + * unshare a file/folder * @param array $params contains the shareID 'id' which should be unshared * @return \OC_OCS_Result */ @@ -473,7 +478,7 @@ class Api { } /** - * @brief get file ID from a given path + * get file ID from a given path * @param string $path * @return string fileID or null */ @@ -490,7 +495,7 @@ class Api { } /** - * @brief get itemType + * get itemType * @param string $path * @return string type 'file', 'folder' or null of file/folder doesn't exists */ @@ -508,7 +513,7 @@ class Api { } /** - * @brief get some information from a given share + * get some information from a given share * @param int $shareID * @return array with: item_source, share_type, share_with, item_type, permissions */ diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index f74315c85f9990bd1a9ca61201a7c391d55bf98c..9d83ed13b87a2be161611303e97a1a918d68ac4d 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -42,7 +42,7 @@ class Shared_Cache extends Cache { } /** - * @brief Get the source cache of a shared file or folder + * Get the source cache of a shared file or folder * @param string $target Shared target file path * @return \OC\Files\Cache\Cache */ @@ -80,7 +80,7 @@ class Shared_Cache extends Cache { /** * get the stored metadata of a file or folder * - * @param string /int $file + * @param string|int $file * @return array */ public function get($file) { @@ -424,7 +424,7 @@ class Shared_Cache extends Cache { * * @param int $id * @param string $pathEnd (optional) used internally for recursive calls - * @return string | null + * @return string|null */ public function getPathById($id, $pathEnd = '') { // direct shares are easy diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php index dd4056b48f1ed0095a3825bf303177df4164d3c0..49546f012a63e87b7535ca8d4017cd6c3efd8cee 100644 --- a/apps/files_sharing/lib/helper.php +++ b/apps/files_sharing/lib/helper.php @@ -162,7 +162,7 @@ class Helper { } /** - * @brief Format a path to be relative to the /user/files/ directory + * Format a path to be relative to the /user/files/ directory * @param string $path the absolute path * @return string e.g. turns '/admin/files/test.txt' into 'test.txt' */ @@ -180,4 +180,26 @@ class Helper { return $relPath; } + + /** + * check if file name already exists and generate unique target + * + * @param string $path + * @param array $excludeList + * @param \OC\Files\View $view + * @return string $path + */ + public static function generateUniqueTarget($path, $excludeList, $view) { + $pathinfo = pathinfo($path); + $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : ''; + $name = $pathinfo['filename']; + $dir = $pathinfo['dirname']; + $i = 2; + while ($view->file_exists($path) || in_array($path, $excludeList)) { + $path = \OC\Files\Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext); + $i++; + } + + return $path; + } } diff --git a/apps/files_sharing/lib/maintainer.php b/apps/files_sharing/lib/maintainer.php index bbb3268410e641a9309edf7e0f828b2ceb530976..f07c09e5aee48b85f1b079623d785f07d3d6cd6e 100644 --- a/apps/files_sharing/lib/maintainer.php +++ b/apps/files_sharing/lib/maintainer.php @@ -33,7 +33,7 @@ class Maintainer { * Keeps track of the "allow links" config setting * and removes all link shares if the config option is set to "no" * - * @param array with app, key, value as named values + * @param array $params array with app, key, value as named values */ static public function configChangeHook($params) { if($params['app'] === 'core' && $params['key'] === 'shareapi_allow_links' && $params['value'] === 'no') { diff --git a/apps/files_sharing/lib/permissions.php b/apps/files_sharing/lib/permissions.php index c3ad63e2fd26b6ab8725d3b9619151ea85beea87..f32ebabe40d4763821d0824be65b11d0cd045b99 100644 --- a/apps/files_sharing/lib/permissions.php +++ b/apps/files_sharing/lib/permissions.php @@ -30,6 +30,7 @@ class Shared_Permissions extends Permissions { * @return int (-1 if file no permissions set) */ public function get($fileId, $user) { + if ($fileId == -1) { // if we ask for the mount point return -1 so that we can get the correct // permissions by the path, with the root fileId we have no idea which share is meant @@ -37,11 +38,14 @@ class Shared_Permissions extends Permissions { } $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, null, true); + + $permission = -1; + if ($source) { - return $source['permissions']; - } else { - return -1; + $permission = $this->updatePermissions($source['permissions']); } + + return $permission; } /** @@ -55,7 +59,7 @@ class Shared_Permissions extends Permissions { $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, null, false); if ($source) { - return $source['permissions']; + return $this->updatePermissions($source['permissions']); } else { return -1; } @@ -106,7 +110,7 @@ class Shared_Permissions extends Permissions { $result = $query->execute(array($parentId)); $filePermissions = array(); while ($row = $result->fetchRow()) { - $filePermissions[$row['fileid']] = $permissions; + $filePermissions[$row['fileid']] = $this->updatePermissions($permissions); } return $filePermissions; } diff --git a/apps/files_sharing/lib/proxy.php b/apps/files_sharing/lib/proxy.php new file mode 100644 index 0000000000000000000000000000000000000000..c899a4b4dd372e46a608aa97c69b4d5946ddc12a --- /dev/null +++ b/apps/files_sharing/lib/proxy.php @@ -0,0 +1,69 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see . + * + */ + +namespace OCA\Files\Share; + +class Proxy extends \OC_FileProxy { + + /** + * check if the deleted folder contains share mount points and move them + * up to the parent + * + * @param string $path + */ + public function preUnlink($path) { + $this->moveMountPointsUp($path); + } + + /** + * check if the deleted folder contains share mount points and move them + * up to the parent + * + * @param string $path + */ + public function preRmdir($path) { + $this->moveMountPointsUp($path); + } + + /** + * move share mount points up to the parent + * + * @param string $path + */ + private function moveMountPointsUp($path) { + $view = new \OC\Files\View('/'); + + // find share mount points within $path and move them up to the parent folder + // before we delete $path + $mountManager = \OC\Files\Filesystem::getMountManager(); + $mountedShares = $mountManager->findIn($path); + foreach ($mountedShares as $mount) { + if ($mount->getStorage() instanceof \OC\Files\Storage\Shared) { + $mountPoint = $mount->getMountPoint(); + $mountPointName = $mount->getMountPointName(); + $target = \OCA\Files_Sharing\Helper::generateUniqueTarget(dirname($path) . '/' . $mountPointName, array(), $view); + $view->rename($mountPoint, $target); + } + } + } + +} diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index 9950b4d61fde712098c268d58df3015aeb20ddca..91595461a618c2935e07284a5ff4eb68dcd5ce6a 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -54,7 +54,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { } /** - * @brief create unique target + * create unique target * @param string $filePath * @param string $shareWith * @param string $exclude @@ -75,16 +75,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { $excludeList = array_merge($excludeList, $exclude); } - $pathinfo = pathinfo($target); - $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : ''; - $name = $pathinfo['filename']; - $i = 2; - while ($view->file_exists($target) || in_array($target, $excludeList)) { - $target = '/' . $name . ' ('.$i.')' . $ext; - $i++; - } - - return $target; + return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view); } public function formatItems($items, $format, $parameters = null) { @@ -154,7 +145,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { } /** - * @brief resolve reshares to return the correct source item + * resolve reshares to return the correct source item * @param array $source * @return array source item */ diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index d4a817fca3461c462fffe005593c5226b918a149..67ccbd134035a7a66bdd9d251acc4c87c41f4453 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -36,7 +36,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @breif get id of the mount point + * get id of the mount point * @return string */ public function getId() { @@ -44,7 +44,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @breif get file cache of the shared item source + * get file cache of the shared item source * @return string */ public function getSourceId() { @@ -52,9 +52,8 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Get the source file path, permissions, and owner for a shared file - * @param string Shared target file path - * @param string $target + * Get the source file path, permissions, and owner for a shared file + * @param string $target Shared target file path * @return Returns array with the keys path, permissions, and owner or false if not found */ public function getFile($target) { @@ -76,9 +75,8 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Get the source file path for a shared file - * @param string Shared target file path - * @param string $target + * Get the source file path for a shared file + * @param string $target Shared target file path * @return string source file path or false if not found */ public function getSourcePath($target) { @@ -100,8 +98,8 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Get the permissions granted for a shared file - * @param string Shared target file path + * Get the permissions granted for a shared file + * @param string $target Shared target file path * @return int CRUDS permissions granted */ public function getPermissions($target) { @@ -110,6 +108,11 @@ class Shared extends \OC\Files\Storage\Common { if (pathinfo($target, PATHINFO_EXTENSION) === 'part') { $permissions |= \OCP\PERMISSION_DELETE; } + + if (\OC_Util::isSharingDisabledForUser()) { + $permissions &= ~\OCP\PERMISSION_SHARE; + } + return $permissions; } @@ -174,13 +177,9 @@ class Shared extends \OC\Files\Storage\Common { } public function filesize($path) { - if ($path == '' || $path == '/' || $this->is_dir($path)) { - return 0; - } else if ($source = $this->getSourcePath($path)) { - list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source); - return $storage->filesize($internalPath); - } - return false; + $source = $this->getSourcePath($path); + list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source); + return $storage->filesize($internalPath); } public function isCreatable($path) { @@ -200,6 +199,9 @@ class Shared extends \OC\Files\Storage\Common { } public function isSharable($path) { + if (\OCP\Util::isSharingDisabledForUser()) { + return false; + } return ($this->getPermissions($path) & \OCP\PERMISSION_SHARE); } @@ -265,7 +267,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief Format a path to be relative to the /user/files/ directory + * Format a path to be relative to the /user/files/ directory * @param string $path the absolute path * @return string e.g. turns '/admin/files/test.txt' into '/test.txt' */ @@ -289,7 +291,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief rename a shared folder/file + * rename a shared folder/file * @param string $sourcePath * @param string $targetPath * @return bool @@ -307,27 +309,12 @@ class Shared extends \OC\Files\Storage\Common { $relTargetPath = $this->stripUserFilesPath($targetPath); - // if the user renames a mount point from a group share we need to create a new db entry - // for the unique name - if ($this->getShareType() === \OCP\Share::SHARE_TYPE_GROUP && $this->uniqueNameSet() === false) { - $query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` (`item_type`, `item_source`, `item_target`,' - .' `share_type`, `share_with`, `uid_owner`, `permissions`, `stime`, `file_source`,' - .' `file_target`, `token`, `parent`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)'); - $arguments = array($this->share['item_type'], $this->share['item_source'], $this->share['item_target'], - 2, \OCP\User::getUser(), $this->share['uid_owner'], $this->share['permissions'], $this->share['stime'], $this->share['file_source'], - $relTargetPath, $this->share['token'], $this->share['id']); - - } else { - // rename mount point - $query = \OC_DB::prepare( - 'Update `*PREFIX*share` - SET `file_target` = ? - WHERE `id` = ?' - ); - $arguments = array($relTargetPath, $this->getShareId()); + if ($relTargetPath === false) { + \OCP\Util::writeLog('file sharing', 'Wrong target path given: ' . $targetPath, \OCP\Util::ERROR); + return false; } - $result = $query->execute($arguments); + $result = self::updateFileTarget($relTargetPath, $this->share); if ($result) { // update the mount manager with the new paths @@ -345,9 +332,39 @@ class Shared extends \OC\Files\Storage\Common { \OCP\Util::ERROR); } - return $result; + return (bool)$result; } + /** + * @update fileTarget in the database if the mount point changed + * @param string $newPath + * @param array $share reference to the share which should be modified + * @return type + */ + private static function updateFileTarget($newPath, &$share) { + // if the user renames a mount point from a group share we need to create a new db entry + // for the unique name + if ($share['share_type'] === \OCP\Share::SHARE_TYPE_GROUP && + (isset($share['unique_name']) && $share['unique_name'])) { + $query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` (`item_type`, `item_source`, `item_target`,' + .' `share_type`, `share_with`, `uid_owner`, `permissions`, `stime`, `file_source`,' + .' `file_target`, `token`, `parent`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)'); + $arguments = array($share['item_type'], $share['item_source'], $share['item_target'], + 2, \OCP\User::getUser(), $share['uid_owner'], $share['permissions'], $share['stime'], $share['file_source'], + $newPath, $share['token'], $share['id']); + + } else { + // rename mount point + $query = \OC_DB::prepare( + 'Update `*PREFIX*share` + SET `file_target` = ? + WHERE `id` = ?' + ); + $arguments = array($newPath, $share['id']); + } + + return $query->execute($arguments); + } public function rename($path1, $path2) { @@ -473,6 +490,7 @@ class Shared extends \OC\Files\Storage\Common { || $shares ) { foreach ($shares as $share) { + self::verifyMountPoint($share); \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', array( 'share' => $share, @@ -483,19 +501,39 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief return mount point of share, relative to data/user/files - * @return string + * check if the parent folder exists otherwise move the mount point up + * + * @param array $share reference to the share we want to check */ - public function getMountPoint() { - return $this->share['file_target']; + private static function verifyMountPoint(&$share) { + $mountPoint = basename($share['file_target']); + $parent = dirname($share['file_target']); + + while (!\OC\Files\Filesystem::is_dir($parent)) { + $parent = dirname($parent); + } + + $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget( + \OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint), + array(), + new \OC\Files\View('/' . \OCP\User::getUser() . '/files') + ); + + if($newMountPoint !== $share['file_target']) { + + self::updateFileTarget($newMountPoint, $share); + $share['file_target'] = $newMountPoint; + + } } /** - * @brief get share type - * @return integer can be single user share (0) group share (1), unique group share name (2) + * return mount point of share, relative to data/user/files + * + * @return string */ - private function getShareType() { - return $this->share['share_type']; + public function getMountPoint() { + return $this->share['file_target']; } private function setMountPoint($path) { @@ -503,30 +541,17 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief does the group share already has a user specific unique name - * @return bool - */ - private function uniqueNameSet() { - return (isset($this->share['unique_name']) && $this->share['unique_name']); - } - - /** + * the share now uses a unique name of this user + * * @brief the share now uses a unique name of this user */ private function setUniqueName() { $this->share['unique_name'] = true; } - /** - * @brief get share ID - * @return integer unique share ID - */ - private function getShareId() { - return $this->share['id']; - } - /** * @brief get the user who shared the file + * * @return string */ public function getSharedFrom() { @@ -534,7 +559,7 @@ class Shared extends \OC\Files\Storage\Common { } /** - * @brief return share type, can be "file" or "folder" + * return share type, can be "file" or "folder" * @return string */ public function getItemType() { diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index 49044383df571d52bbb840c075d5929b48593db9..5cb2b638e5a67dcd5d21c3070ae360fb67cb73b6 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -27,7 +27,7 @@ class Shared_Updater { static private $toRemove = array(); /** - * @brief walk up the users file tree and update the etags + * walk up the users file tree and update the etags * @param string $user * @param string $path */ @@ -78,7 +78,7 @@ class Shared_Updater { } /** - * @brief remove all shares for a given file if the file was deleted + * remove all shares for a given file if the file was deleted * * @param string $path */ @@ -115,11 +115,14 @@ class Shared_Updater { * @param array $params */ static public function deleteHook($params) { - self::correctFolders($params['path']); - $fileInfo = \OC\Files\Filesystem::getFileInfo($params['path']); + $path = $params['path']; + self::correctFolders($path); + + $fileInfo = \OC\Files\Filesystem::getFileInfo($path); + // mark file as deleted so that we can clean up the share table if // the file was deleted successfully - self::$toRemove[$params['path']] = $fileInfo['fileid']; + self::$toRemove[$path] = $fileInfo['fileid']; } /** diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index e17ffc48036d79d42bdd260fecd8f75c215235f5..8a86cb3806a6f2c29ca3017ca93ae9fc6e621bea 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -149,11 +149,11 @@ if (isset($path)) { $freeSpace=OCP\Util::freeSpace($path); $uploadLimit=OCP\Util::uploadLimit(); - $folder = new OCP\Template('files', 'index', ''); + $folder = new OCP\Template('files', 'list', ''); $folder->assign('dir', $getPath); $folder->assign('dirToken', $linkItem['token']); $folder->assign('permissions', OCP\PERMISSION_READ); - $folder->assign('isPublic',true); + $folder->assign('isPublic', true); $folder->assign('publicUploadEnabled', 'no'); $folder->assign('files', $files); $folder->assign('uploadMaxFilesize', $maxUploadFilesize); @@ -162,7 +162,6 @@ if (isset($path)) { $folder->assign('uploadLimit', $uploadLimit); // PHP upload limit $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $folder->assign('usedSpacePercent', 0); - $folder->assign('disableSharing', true); $folder->assign('trash', false); $tmpl->assign('folder', $folder->fetchPage()); $allowZip = OCP\Config::getSystemValue('allowZipDownload', true); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 9471752b6b5d493bc9d2e58c0978a5d68353ee2b..234b6d098387bca9f88d87408256e0371c7696a2 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -10,7 +10,7 @@ -