diff --git a/AUTHORS b/AUTHORS index c30a6bf426..7e0d8f6587 100644 --- a/AUTHORS +++ b/AUTHORS @@ -28,4 +28,4 @@ With help from many libraries and frameworks including: … "Lock” symbol from thenounproject.com collection -"Clock” symbol by Brandon Hopkins, from thenounproject.com collection \ No newline at end of file +"Clock” symbol by Brandon Hopkins, from thenounproject.com collection diff --git a/COPYING-README b/COPYING-README index 49e035186e..8c26709d76 100644 --- a/COPYING-README +++ b/COPYING-README @@ -12,4 +12,4 @@ Licensing of components: All unmodified files from these and other sources retain their original copyright and license notices: see the relevant individual files. -Attribution information for ownCloud is contained in the AUTHORS file. \ No newline at end of file +Attribution information for ownCloud is contained in the AUTHORS file. diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php index b2bfd53506..6a34cbe4ef 100644 --- a/apps/files/ajax/download.php +++ b/apps/files/ajax/download.php @@ -39,4 +39,4 @@ if (!is_array($files_list)) { $files_list = array($files); } -OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false); +OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD'); diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 878e4cb215..c50e96b242 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -10,7 +10,7 @@ OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; -$doBreadcrumb = isset( $_GET['breadcrumb'] ) ? true : false; +$doBreadcrumb = isset($_GET['breadcrumb']); $data = array(); // Make breadcrumb diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index 8c1aad8668..d224e79d01 100644 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -77,6 +77,12 @@ if($source) { exit(); } else { $success = false; + if (!$content) { + $templateManager = OC_Helper::getFileTemplateManager(); + $mimeType = OC_Helper::getMimeType($target); + $content = $templateManager->getTemplate($mimeType); + } + if($content) { $success = \OC\Files\Filesystem::file_put_contents($target, $content); } else { @@ -87,9 +93,11 @@ if($source) { $meta = \OC\Files\Filesystem::getFileInfo($target); $id = $meta['fileid']; $mime = $meta['mimetype']; + $size = $meta['size']; OCP\JSON::success(array('data' => array( 'id' => $id, 'mime' => $mime, + 'size' => $size, 'content' => $content, ))); exit(); diff --git a/apps/files/ajax/rename.php b/apps/files/ajax/rename.php index f455185828..5b07c306af 100644 --- a/apps/files/ajax/rename.php +++ b/apps/files/ajax/rename.php @@ -38,4 +38,4 @@ if($result['success'] === true){ OCP\JSON::success(array('data' => $result['data'])); } else { OCP\JSON::error(array('data' => $result['data'])); -} \ No newline at end of file +} diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index 99739cb4ce..aa839b81d1 100644 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -5,11 +5,11 @@ $l = OC_L10N::get('files'); OCP\App::registerAdmin('files', 'admin'); -OCP\App::addNavigationEntry( array( "id" => "files_index", - "order" => 0, - "href" => OCP\Util::linkTo( "files", "index.php" ), - "icon" => OCP\Util::imagePath( "core", "places/files.svg" ), - "name" => $l->t("Files") )); +OCP\App::addNavigationEntry(array("id" => "files_index", + "order" => 0, + "href" => OCP\Util::linkTo("files", "index.php"), + "icon" => OCP\Util::imagePath("core", "places/files.svg"), + "name" => $l->t("Files"))); OC_Search::registerProvider('OC_Search_Provider_File'); @@ -21,3 +21,7 @@ OC_Search::registerProvider('OC_Search_Provider_File'); \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Updater', 'renameHook'); \OCP\BackgroundJob::addRegularTask('\OC\Files\Cache\BackgroundWatcher', 'checkNext'); + +$templateManager = OC_Helper::getFileTemplateManager(); +$templateManager->registerTemplate('text/html', 'core/templates/filetemplates/template.html'); + diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php index fcd5f4b260..f3d8e9a4f4 100644 --- a/apps/files/appinfo/routes.php +++ b/apps/files/appinfo/routes.php @@ -11,4 +11,4 @@ $this->create('download', 'download{file}') ->actionInclude('files/download.php'); // Register with the capabilities API -OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', OC_API::USER_AUTH); \ No newline at end of file +OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', OC_API::USER_AUTH); diff --git a/apps/files/css/files.css b/apps/files/css/files.css index be42a0056d..b94d6fbcbe 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -49,12 +49,22 @@ z-index:20; position:relative; cursor:pointer; overflow:hidden; } -#uploadprogresswrapper { float: right; position: relative; } -#uploadprogresswrapper #uploadprogressbar { - position:relative; float: right; - margin-left: 12px; width:10em; height:1.5em; top:.4em; +#uploadprogresswrapper { + position: relative; + display: inline; +} +#uploadprogressbar { + position:relative; + float: left; + margin-left: 12px; + width: 130px; + height: 26px; display:inline-block; } +#uploadprogressbar + stop { + font-size: 13px; +} + /* FILE TABLE */ @@ -275,14 +285,14 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } display:none; } #fileList tr:hover a.action, #fileList a.action.permanent { - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=.5)"; - filter: alpha(opacity=.5); + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + filter: alpha(opacity=50); opacity: .5; display:inline; } #fileList tr:hover a.action:hover { - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)"; - filter: alpha(opacity=1); + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); opacity: 1; display:inline; } diff --git a/apps/files/index.php b/apps/files/index.php index e2ea8802d0..c05c2a9384 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -151,5 +151,6 @@ if ($needUpgrade) { $tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']); $tmpl->assign('isPublic', false); $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); + $tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles()); $tmpl->printPage(); } diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 02e940aa3c..16d96fbb38 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1,343 +1,345 @@ $(document).ready(function() { - file_upload_param = { - dropZone: $('#content'), // restrict dropZone to content div - //singleFileUploads is on by default, so the data.files array will always have length 1 - add: function(e, data) { + file_upload_param = { + dropZone: $('#content'), // restrict dropZone to content div + //singleFileUploads is on by default, so the data.files array will always have length 1 + add: function(e, data) { - if(data.files[0].type === '' && data.files[0].size == 4096) - { - data.textStatus = 'dirorzero'; - data.errorThrown = t('files','Unable to upload your file as it is a directory or has 0 bytes'); - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); - fu._trigger('fail', e, data); - return true; //don't upload this file but go on with next in queue - } - - var totalSize=0; - $.each(data.originalFiles, function(i,file){ - totalSize+=file.size; - }); - - if(totalSize>$('#max_upload').val()){ - data.textStatus = 'notenoughspace'; - data.errorThrown = t('files','Not enough space available'); - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); - fu._trigger('fail', e, data); - return false; //don't upload anything - } - - // start the actual file upload - var jqXHR = data.submit(); - - // remember jqXHR to show warning to user when he navigates away but an upload is still in progress - if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') { - var dirName = data.context.data('file'); - if(typeof uploadingFiles[dirName] === 'undefined') { - uploadingFiles[dirName] = {}; - } - uploadingFiles[dirName][data.files[0].name] = jqXHR; - } else { - uploadingFiles[data.files[0].name] = jqXHR; - } - - //show cancel button - if($('html.lte9').length === 0 && data.dataType !== 'iframe') { - $('#uploadprogresswrapper input.stop').show(); - } - }, - /** - * called after the first add, does NOT have the data param - * @param e - */ - start: function(e) { - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - return; - } - $('#uploadprogressbar').progressbar({value:0}); - $('#uploadprogressbar').fadeIn(); - }, - fail: function(e, data) { - if (typeof data.textStatus !== 'undefined' && data.textStatus !== 'success' ) { - if (data.textStatus === 'abort') { - $('#notification').text(t('files', 'Upload cancelled.')); - } else { - // HTTP connection problem - $('#notification').text(data.errorThrown); - } - $('#notification').fadeIn(); - //hide notification after 5 sec - setTimeout(function() { - $('#notification').fadeOut(); - }, 5000); - } - delete uploadingFiles[data.files[0].name]; - }, - progress: function(e, data) { - // TODO: show nice progress bar in file row - }, - progressall: function(e, data) { - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - return; - } - var progress = (data.loaded/data.total)*100; - $('#uploadprogressbar').progressbar('value',progress); - }, - /** - * called for every successful upload - * @param e - * @param data - */ - done:function(e, data) { - // handle different responses (json or body from iframe for ie) - 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]; - } else { - data.textStatus = 'servererror'; - data.errorThrown = t('files', result.data.message); - var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); - fu._trigger('fail', e, data); - } - - var filename = result[0].originalname; - - // delete jqXHR reference - if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') { - var dirName = data.context.data('file'); - delete uploadingFiles[dirName][filename]; - if ($.assocArraySize(uploadingFiles[dirName]) == 0) { - delete uploadingFiles[dirName]; - } - } else { - delete uploadingFiles[filename]; - } - - }, - /** - * called after last upload - * @param e - * @param data - */ - stop: function(e, data) { - if(data.dataType !== 'iframe') { - $('#uploadprogresswrapper input.stop').hide(); - } - - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - return; - } - - $('#uploadprogressbar').progressbar('value',100); - $('#uploadprogressbar').fadeOut(); - } - } - var file_upload_handler = function() { - $('#file_upload_start').fileupload(file_upload_param); - }; - - - - if ( document.getElementById('data-upload-form') ) { - $(file_upload_handler); - } - $.assocArraySize = function(obj) { - // http://stackoverflow.com/a/6700/11236 - var size = 0, key; - for (key in obj) { - if (obj.hasOwnProperty(key)) size++; - } - return size; - }; - - // warn user not to leave the page while upload is in progress - $(window).bind('beforeunload', function(e) { - if ($.assocArraySize(uploadingFiles) > 0) - return t('files','File upload is in progress. Leaving the page now will cancel the upload.'); - }); - - //add multiply file upload attribute to all browsers except konqueror (which crashes when it's used) - if(navigator.userAgent.search(/konqueror/i)==-1){ - $('#file_upload_start').attr('multiple','multiple') - } - - //if the breadcrumb is to long, start by replacing foldernames with '...' except for the current folder - var crumb=$('div.crumb').first(); - while($('div.controls').height()>40 && crumb.next('div.crumb').length>0){ - crumb.children('a').text('...'); - crumb=crumb.next('div.crumb'); - } - //if that isn't enough, start removing items from the breacrumb except for the current folder and it's parent - var crumb=$('div.crumb').first(); - var next=crumb.next('div.crumb'); - while($('div.controls').height()>40 && next.next('div.crumb').length>0){ - crumb.remove(); - crumb=next; - next=crumb.next('div.crumb'); - } - //still not enough, start shorting down the current folder name - var crumb=$('div.crumb>a').last(); - while($('div.controls').height()>40 && crumb.text().length>6){ - var text=crumb.text() - text=text.substr(0,text.length-6)+'...'; - crumb.text(text); - } - - $(document).click(function(){ - $('#new>ul').hide(); - $('#new').removeClass('active'); - $('#new li').each(function(i,element){ - if($(element).children('p').length==0){ - $(element).children('form').remove(); - $(element).append('
'+$(element).data('text')+'
'); - } - }); - }); - $('#new li').click(function(){ - if($(this).children('p').length==0){ - return; - } - - $('#new li').each(function(i,element){ - if($(element).children('p').length==0){ - $(element).children('form').remove(); - $(element).append(''+$(element).data('text')+'
'); - } - }); - - var type=$(this).data('type'); - var text=$(this).children('p').text(); - $(this).data('text',text); - $(this).children('p').remove(); - var form=$(''); - var input=$(''); - form.append(input); - $(this).append(form); - input.focus(); - form.submit(function(event){ - event.stopPropagation(); - event.preventDefault(); - var newname=input.val(); - if(type == 'web' && newname.length == 0) { - OC.Notification.show(t('files', 'URL cannot be empty.')); - return false; - } else if (type != 'web' && !Files.isFileNameValid(newname)) { - return false; - } else if( type == 'folder' && $('#dir').val() == '/' && newname == 'Shared') { - OC.Notification.show(t('files','Invalid folder name. Usage of \'Shared\' is reserved by ownCloud')); - return false; - } - if (FileList.lastAction) { - FileList.lastAction(); - } - var name = getUniqueName(newname); - if (newname != name) { - FileList.checkName(name, newname, true); - var hidden = true; - } else { - var hidden = false; - } - switch(type){ - case 'file': - $.post( - OC.filePath('files','ajax','newfile.php'), - {dir:$('#dir').val(),filename:name}, - function(result){ - if (result.status == 'success') { - var date=new Date(); - FileList.addFile(name,0,date,false,hidden); - var tr=$('tr').filterAttr('data-file',name); - tr.attr('data-mime',result.data.mime); - tr.attr('data-id', result.data.id); - getMimeIcon(result.data.mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); - }); - } else { - OC.dialogs.alert(result.data.message, t('core', 'Error')); + if(data.files[0].type === '' && data.files[0].size == 4096) + { + data.textStatus = 'dirorzero'; + data.errorThrown = t('files','Unable to upload your file as it is a directory or has 0 bytes'); + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + fu._trigger('fail', e, data); + return true; //don't upload this file but go on with next in queue } - } - ); - break; - case 'folder': - $.post( - OC.filePath('files','ajax','newfolder.php'), - {dir:$('#dir').val(),foldername:name}, - function(result){ - if (result.status == 'success') { - var date=new Date(); - FileList.addDir(name,0,date,hidden); - var tr=$('tr').filterAttr('data-file',name); - tr.attr('data-id', result.data.id); - } else { - OC.dialogs.alert(result.data.message, t('core', 'Error')); - } - } - ); - break; - case 'web': - if(name.substr(0,8)!='https://' && name.substr(0,7)!='http://'){ - name='http://'+name; - } - var localName=name; - if(localName.substr(localName.length-1,1)=='/'){//strip / - localName=localName.substr(0,localName.length-1) - } - if(localName.indexOf('/')){//use last part of url - localName=localName.split('/').pop(); - } else { //or the domain - localName=(localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.',''); - } - localName = getUniqueName(localName); - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - } else { - $('#uploadprogressbar').progressbar({value:0}); - $('#uploadprogressbar').fadeIn(); - } - var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName}); - eventSource.listen('progress',function(progress){ - //IE < 10 does not fire the necessary events for the progress bar. - if($('html.lte9').length > 0) { - } else { + var totalSize=0; + $.each(data.originalFiles, function(i,file){ + totalSize+=file.size; + }); + + if(totalSize>$('#max_upload').val()){ + data.textStatus = 'notenoughspace'; + data.errorThrown = t('files','Not enough space available'); + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + fu._trigger('fail', e, data); + return false; //don't upload anything + } + + // start the actual file upload + var jqXHR = data.submit(); + + // remember jqXHR to show warning to user when he navigates away but an upload is still in progress + if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') { + var dirName = data.context.data('file'); + if(typeof uploadingFiles[dirName] === 'undefined') { + uploadingFiles[dirName] = {}; + } + uploadingFiles[dirName][data.files[0].name] = jqXHR; + } else { + uploadingFiles[data.files[0].name] = jqXHR; + } + + //show cancel button + if($('html.lte9').length === 0 && data.dataType !== 'iframe') { + $('#uploadprogresswrapper input.stop').show(); + } + }, + /** + * called after the first add, does NOT have the data param + * @param e + */ + start: function(e) { + //IE < 10 does not fire the necessary events for the progress bar. + if($('html.lte9').length > 0) { + return; + } + $('#uploadprogressbar').progressbar({value:0}); + $('#uploadprogressbar').fadeIn(); + }, + fail: function(e, data) { + if (typeof data.textStatus !== 'undefined' && data.textStatus !== 'success' ) { + if (data.textStatus === 'abort') { + $('#notification').text(t('files', 'Upload cancelled.')); + } else { + // HTTP connection problem + $('#notification').text(data.errorThrown); + } + $('#notification').fadeIn(); + //hide notification after 5 sec + setTimeout(function() { + $('#notification').fadeOut(); + }, 5000); + } + delete uploadingFiles[data.files[0].name]; + }, + progress: function(e, data) { + // TODO: show nice progress bar in file row + }, + progressall: function(e, data) { + //IE < 10 does not fire the necessary events for the progress bar. + if($('html.lte9').length > 0) { + return; + } + var progress = (data.loaded/data.total)*100; $('#uploadprogressbar').progressbar('value',progress); - } - }); - eventSource.listen('success',function(data){ - var mime=data.mime; - var size=data.size; - var id=data.id; - $('#uploadprogressbar').fadeOut(); - var date=new Date(); - FileList.addFile(localName,size,date,false,hidden); - var tr=$('tr').filterAttr('data-file',localName); - tr.data('mime',mime).data('id',id); - tr.attr('data-id', id); - getMimeIcon(mime,function(path){ - tr.find('td.filename').attr('style','background-image:url('+path+')'); - }); - }); - eventSource.listen('error',function(error){ - $('#uploadprogressbar').fadeOut(); - alert(error); - }); - break; - } - var li=form.parent(); - form.remove(); - li.append(''+li.data('text')+'
'); - $('#new>a').click(); + }, + /** + * called for every successful upload + * @param e + * @param data + */ + done:function(e, data) { + // handle different responses (json or body from iframe for ie) + 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]; + } else { + data.textStatus = 'servererror'; + data.errorThrown = t('files', result.data.message); + var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); + fu._trigger('fail', e, data); + } + + var filename = result[0].originalname; + + // delete jqXHR reference + if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') { + var dirName = data.context.data('file'); + delete uploadingFiles[dirName][filename]; + if ($.assocArraySize(uploadingFiles[dirName]) == 0) { + delete uploadingFiles[dirName]; + } + } else { + delete uploadingFiles[filename]; + } + + }, + /** + * called after last upload + * @param e + * @param data + */ + stop: function(e, data) { + if(data.dataType !== 'iframe') { + $('#uploadprogresswrapper input.stop').hide(); + } + + //IE < 10 does not fire the necessary events for the progress bar. + if($('html.lte9').length > 0) { + return; + } + + $('#uploadprogressbar').progressbar('value',100); + $('#uploadprogressbar').fadeOut(); + } + } + var file_upload_handler = function() { + $('#file_upload_start').fileupload(file_upload_param); + }; + + + + if ( document.getElementById('data-upload-form') ) { + $(file_upload_handler); + } + $.assocArraySize = function(obj) { + // http://stackoverflow.com/a/6700/11236 + var size = 0, key; + for (key in obj) { + if (obj.hasOwnProperty(key)) size++; + } + return size; + }; + + // warn user not to leave the page while upload is in progress + $(window).bind('beforeunload', function(e) { + if ($.assocArraySize(uploadingFiles) > 0) + return t('files','File upload is in progress. Leaving the page now will cancel the upload.'); + }); + + //add multiply file upload attribute to all browsers except konqueror (which crashes when it's used) + if(navigator.userAgent.search(/konqueror/i)==-1){ + $('#file_upload_start').attr('multiple','multiple') + } + + //if the breadcrumb is to long, start by replacing foldernames with '...' except for the current folder + var crumb=$('div.crumb').first(); + while($('div.controls').height()>40 && crumb.next('div.crumb').length>0){ + crumb.children('a').text('...'); + crumb=crumb.next('div.crumb'); + } + //if that isn't enough, start removing items from the breacrumb except for the current folder and it's parent + var crumb=$('div.crumb').first(); + var next=crumb.next('div.crumb'); + while($('div.controls').height()>40 && next.next('div.crumb').length>0){ + crumb.remove(); + crumb=next; + next=crumb.next('div.crumb'); + } + //still not enough, start shorting down the current folder name + var crumb=$('div.crumb>a').last(); + while($('div.controls').height()>40 && crumb.text().length>6){ + var text=crumb.text() + text=text.substr(0,text.length-6)+'...'; + crumb.text(text); + } + + $(document).click(function(){ + $('#new>ul').hide(); + $('#new').removeClass('active'); + $('#new li').each(function(i,element){ + if($(element).children('p').length==0){ + $(element).children('form').remove(); + $(element).append(''+$(element).data('text')+'
'); + } + }); + }); + $('#new li').click(function(){ + if($(this).children('p').length==0){ + return; + } + + $('#new li').each(function(i,element){ + if($(element).children('p').length==0){ + $(element).children('form').remove(); + $(element).append(''+$(element).data('text')+'
'); + } + }); + + var type=$(this).data('type'); + var text=$(this).children('p').text(); + $(this).data('text',text); + $(this).children('p').remove(); + var form=$(''); + var input=$(''); + form.append(input); + $(this).append(form); + input.focus(); + form.submit(function(event){ + event.stopPropagation(); + event.preventDefault(); + var newname=input.val(); + if(type == 'web' && newname.length == 0) { + OC.Notification.show(t('files', 'URL cannot be empty.')); + return false; + } else if (type != 'web' && !Files.isFileNameValid(newname)) { + return false; + } else if( type == 'folder' && $('#dir').val() == '/' && newname == 'Shared') { + OC.Notification.show(t('files','Invalid folder name. Usage of \'Shared\' is reserved by ownCloud')); + return false; + } + if (FileList.lastAction) { + FileList.lastAction(); + } + var name = getUniqueName(newname); + if (newname != name) { + FileList.checkName(name, newname, true); + var hidden = true; + } else { + var hidden = false; + } + switch(type){ + case 'file': + $.post( + OC.filePath('files','ajax','newfile.php'), + {dir:$('#dir').val(),filename:name}, + function(result){ + if (result.status == 'success') { + var date=new Date(); + FileList.addFile(name,0,date,false,hidden); + var tr=$('tr').filterAttr('data-file',name); + tr.attr('data-size',result.data.size); + tr.attr('data-mime',result.data.mime); + tr.attr('data-id', result.data.id); + tr.find('.filesize').text(humanFileSize(result.data.size)); + getMimeIcon(result.data.mime,function(path){ + tr.find('td.filename').attr('style','background-image:url('+path+')'); + }); + } else { + OC.dialogs.alert(result.data.message, t('core', 'Error')); + } + } + ); + break; + case 'folder': + $.post( + OC.filePath('files','ajax','newfolder.php'), + {dir:$('#dir').val(),foldername:name}, + function(result){ + if (result.status == 'success') { + var date=new Date(); + FileList.addDir(name,0,date,hidden); + var tr=$('tr').filterAttr('data-file',name); + tr.attr('data-id', result.data.id); + } else { + OC.dialogs.alert(result.data.message, t('core', 'Error')); + } + } + ); + break; + case 'web': + if(name.substr(0,8)!='https://' && name.substr(0,7)!='http://'){ + name='http://'+name; + } + var localName=name; + if(localName.substr(localName.length-1,1)=='/'){//strip / + localName=localName.substr(0,localName.length-1) + } + if(localName.indexOf('/')){//use last part of url + localName=localName.split('/').pop(); + } else { //or the domain + localName=(localName.match(/:\/\/(.[^\/]+)/)[1]).replace('www.',''); + } + localName = getUniqueName(localName); + //IE < 10 does not fire the necessary events for the progress bar. + if($('html.lte9').length > 0) { + } else { + $('#uploadprogressbar').progressbar({value:0}); + $('#uploadprogressbar').fadeIn(); + } + + var eventSource=new OC.EventSource(OC.filePath('files','ajax','newfile.php'),{dir:$('#dir').val(),source:name,filename:localName}); + eventSource.listen('progress',function(progress){ + //IE < 10 does not fire the necessary events for the progress bar. + if($('html.lte9').length > 0) { + } else { + $('#uploadprogressbar').progressbar('value',progress); + } + }); + eventSource.listen('success',function(data){ + var mime=data.mime; + var size=data.size; + var id=data.id; + $('#uploadprogressbar').fadeOut(); + var date=new Date(); + FileList.addFile(localName,size,date,false,hidden); + var tr=$('tr').filterAttr('data-file',localName); + tr.data('mime',mime).data('id',id); + tr.attr('data-id', id); + getMimeIcon(mime,function(path){ + tr.find('td.filename').attr('style','background-image:url('+path+')'); + }); + }); + eventSource.listen('error',function(error){ + $('#uploadprogressbar').fadeOut(); + alert(error); + }); + break; + } + var li=form.parent(); + form.remove(); + li.append(''+li.data('text')+'
'); + $('#new>a').click(); + }); }); - }); }); diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index aa66a57a7b..5027211b53 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -65,7 +65,7 @@ var FileActions = { FileActions.currentFile = parent; var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); var file = FileActions.getCurrentFile(); - if ($('tr').filterAttr('data-file', file).data('renaming')) { + if ($('tr[data-file="'+file+'"]').data('renaming')) { return; } parent.children('a.name').append(''); @@ -123,14 +123,11 @@ var FileActions = { img = img(file); } if (typeof trashBinApp !== 'undefined' && trashBinApp) { - var html = ''; + var html = ''; } else { - var html = ''; + var html = ''; } var element = $(html); - if (img) { - element.append($('')); - } element.data('action', actions['Delete']); element.on('click', {a: null, elem: parent, actionFunc: actions['Delete']}, actionHandler); parent.parent().children().last().append(element); @@ -164,10 +161,11 @@ $(document).ready(function () { window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val()); }); } - $('#fileList tr').each(function () { FileActions.display($(this).children('td.filename')); }); + + $('#fileList').trigger(jQuery.Event("fileActionsReady")); }); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 10a297ddad..41245c00ba 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -15,7 +15,7 @@ var FileList={ // filename td td = $('t('For more info, please ask the person who sent this link.')); ?>
- \ No newline at end of file + diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php index 3b1e0ac30c..2c101f0a72 100644 --- a/apps/files_trashbin/appinfo/app.php +++ b/apps/files_trashbin/appinfo/app.php @@ -4,4 +4,4 @@ OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'files_trashbin/lib/hooks.php'; OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'files_trashbin/lib/trash.php'; // register hooks -\OCA\Files_Trashbin\Trashbin::registerHooks(); \ No newline at end of file +\OCA\Files_Trashbin\Trashbin::registerHooks(); diff --git a/apps/files_trashbin/appinfo/update.php b/apps/files_trashbin/appinfo/update.php index f4dad7b26b..0ca232668d 100644 --- a/apps/files_trashbin/appinfo/update.php +++ b/apps/files_trashbin/appinfo/update.php @@ -7,4 +7,4 @@ if (version_compare($installedVersion, '0.4', '<')) { //enforce a recalculation during next usage. $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trashsize`'); $result = $query->execute(); -} \ No newline at end of file +} diff --git a/apps/files_trashbin/js/disableDefaultActions.js b/apps/files_trashbin/js/disableDefaultActions.js index df08bfb1a5..afa80cacd6 100644 --- a/apps/files_trashbin/js/disableDefaultActions.js +++ b/apps/files_trashbin/js/disableDefaultActions.js @@ -1,4 +1,4 @@ /* disable download and sharing actions */ var disableDownloadActions = true; var disableSharing = true; -var trashBinApp = true; \ No newline at end of file +var trashBinApp = true; diff --git a/apps/files_trashbin/l10n/ar.php b/apps/files_trashbin/l10n/ar.php index ccb80f959e..710a9d1419 100644 --- a/apps/files_trashbin/l10n/ar.php +++ b/apps/files_trashbin/l10n/ar.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "حذف بشكل دائم", "Name" => "اسم", "Deleted" => "تم الحذف", -"1 folder" => "مجلد عدد 1", -"{count} folders" => "{count} مجلدات", -"1 file" => "ملف واحد", -"{count} files" => "{count} ملفات", +"_%n folder_::_%n folders_" => array("","","","","",""), +"_%n file_::_%n files_" => array("","","","","",""), "Nothing in here. Your trash bin is empty!" => "لا يوجد شيء هنا. سلة المهملات خاليه.", "Restore" => "استعيد", "Delete" => "إلغاء", diff --git a/apps/files_trashbin/l10n/bg_BG.php b/apps/files_trashbin/l10n/bg_BG.php index 5ae41a324a..3c12e6906e 100644 --- a/apps/files_trashbin/l10n/bg_BG.php +++ b/apps/files_trashbin/l10n/bg_BG.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Изтриване завинаги", "Name" => "Име", "Deleted" => "Изтрито", -"1 folder" => "1 папка", -"{count} folders" => "{count} папки", -"1 file" => "1 файл", -"{count} files" => "{count} файла", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "Няма нищо. Кофата е празна!", "Restore" => "Възтановяване", "Delete" => "Изтриване", diff --git a/apps/files_trashbin/l10n/bn_BD.php b/apps/files_trashbin/l10n/bn_BD.php index a33a6de89a..c3741dbd1d 100644 --- a/apps/files_trashbin/l10n/bn_BD.php +++ b/apps/files_trashbin/l10n/bn_BD.php @@ -2,10 +2,8 @@ $TRANSLATIONS = array( "Error" => "সমস্যা", "Name" => "রাম", -"1 folder" => "১টি ফোল্ডার", -"{count} folders" => "{count} টি ফোল্ডার", -"1 file" => "১টি ফাইল", -"{count} files" => "{count} টি ফাইল", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "মুছে" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/ca.php b/apps/files_trashbin/l10n/ca.php index 2e4fa4dbe0..6e226b7fc8 100644 --- a/apps/files_trashbin/l10n/ca.php +++ b/apps/files_trashbin/l10n/ca.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Esborra permanentment", "Name" => "Nom", "Deleted" => "Eliminat", -"1 folder" => "1 carpeta", -"{count} folders" => "{count} carpetes", -"1 file" => "1 fitxer", -"{count} files" => "{count} fitxers", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "restaurat", "Nothing in here. Your trash bin is empty!" => "La paperera està buida!", "Restore" => "Recupera", diff --git a/apps/files_trashbin/l10n/cs_CZ.php b/apps/files_trashbin/l10n/cs_CZ.php index eef9accb83..383d2a217f 100644 --- a/apps/files_trashbin/l10n/cs_CZ.php +++ b/apps/files_trashbin/l10n/cs_CZ.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Trvale odstranit", "Name" => "Název", "Deleted" => "Smazáno", -"1 folder" => "1 složka", -"{count} folders" => "{count} složky", -"1 file" => "1 soubor", -"{count} files" => "{count} soubory", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "restored" => "obnoveno", "Nothing in here. Your trash bin is empty!" => "Žádný obsah. Váš koš je prázdný.", "Restore" => "Obnovit", diff --git a/apps/files_trashbin/l10n/cy_GB.php b/apps/files_trashbin/l10n/cy_GB.php index af0c5239b5..123a445c2c 100644 --- a/apps/files_trashbin/l10n/cy_GB.php +++ b/apps/files_trashbin/l10n/cy_GB.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Dileu'n barhaol", "Name" => "Enw", "Deleted" => "Wedi dileu", -"1 folder" => "1 blygell", -"{count} folders" => "{count} plygell", -"1 file" => "1 ffeil", -"{count} files" => "{count} ffeil", +"_%n folder_::_%n folders_" => array("","","",""), +"_%n file_::_%n files_" => array("","","",""), "Nothing in here. Your trash bin is empty!" => "Does dim byd yma. Mae eich bin sbwriel yn wag!", "Restore" => "Adfer", "Delete" => "Dileu", diff --git a/apps/files_trashbin/l10n/da.php b/apps/files_trashbin/l10n/da.php index 4e0bbc23a8..2fbc089387 100644 --- a/apps/files_trashbin/l10n/da.php +++ b/apps/files_trashbin/l10n/da.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Slet permanent", "Name" => "Navn", "Deleted" => "Slettet", -"1 folder" => "1 mappe", -"{count} folders" => "{count} mapper", -"1 file" => "1 fil", -"{count} files" => "{count} filer", +"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"), +"_%n file_::_%n files_" => array("%n fil","%n filer"), "restored" => "Gendannet", "Nothing in here. Your trash bin is empty!" => "Intet at se her. Din papirkurv er tom!", "Restore" => "Gendan", diff --git a/apps/files_trashbin/l10n/de.php b/apps/files_trashbin/l10n/de.php index 856317f3c6..ad6e0839bd 100644 --- a/apps/files_trashbin/l10n/de.php +++ b/apps/files_trashbin/l10n/de.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Endgültig löschen", "Name" => "Name", "Deleted" => "gelöscht", -"1 folder" => "1 Ordner", -"{count} folders" => "{count} Ordner", -"1 file" => "1 Datei", -"{count} files" => "{count} Dateien", +"_%n folder_::_%n folders_" => array("","%n Ordner"), +"_%n file_::_%n files_" => array("","%n Dateien"), "restored" => "Wiederhergestellt", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, der Papierkorb ist leer!", "Restore" => "Wiederherstellen", diff --git a/apps/files_trashbin/l10n/de_DE.php b/apps/files_trashbin/l10n/de_DE.php index bd1e3fb9e2..0df6941280 100644 --- a/apps/files_trashbin/l10n/de_DE.php +++ b/apps/files_trashbin/l10n/de_DE.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Endgültig löschen", "Name" => "Name", "Deleted" => "Gelöscht", -"1 folder" => "1 Ordner", -"{count} folders" => "{count} Ordner", -"1 file" => "1 Datei", -"{count} files" => "{count} Dateien", +"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"), +"_%n file_::_%n files_" => array("%n Dateien","%n Dateien"), "restored" => "Wiederhergestellt", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", "Restore" => "Wiederherstellen", diff --git a/apps/files_trashbin/l10n/el.php b/apps/files_trashbin/l10n/el.php index 19331cd1f6..759e5299e4 100644 --- a/apps/files_trashbin/l10n/el.php +++ b/apps/files_trashbin/l10n/el.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Μόνιμη διαγραφή", "Name" => "Όνομα", "Deleted" => "Διαγράφηκε", -"1 folder" => "1 φάκελος", -"{count} folders" => "{count} φάκελοι", -"1 file" => "1 αρχείο", -"{count} files" => "{count} αρχεία", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "έγινε επαναφορά", "Nothing in here. Your trash bin is empty!" => "Δεν υπάρχει τίποτα εδώ. Ο κάδος σας είναι άδειος!", "Restore" => "Επαναφορά", diff --git a/apps/files_trashbin/l10n/eo.php b/apps/files_trashbin/l10n/eo.php index 373a503fc6..d1e30cba58 100644 --- a/apps/files_trashbin/l10n/eo.php +++ b/apps/files_trashbin/l10n/eo.php @@ -3,10 +3,8 @@ $TRANSLATIONS = array( "Error" => "Eraro", "Delete permanently" => "Forigi por ĉiam", "Name" => "Nomo", -"1 folder" => "1 dosierujo", -"{count} folders" => "{count} dosierujoj", -"1 file" => "1 dosiero", -"{count} files" => "{count} dosierujoj", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Restore" => "Restaŭri", "Delete" => "Forigi", "Deleted Files" => "Forigitaj dosieroj" diff --git a/apps/files_trashbin/l10n/es.php b/apps/files_trashbin/l10n/es.php index 58e5c6c903..956d89ae68 100644 --- a/apps/files_trashbin/l10n/es.php +++ b/apps/files_trashbin/l10n/es.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Eliminar permanentemente", "Name" => "Nombre", "Deleted" => "Eliminado", -"1 folder" => "1 carpeta", -"{count} folders" => "{count} carpetas", -"1 file" => "1 archivo", -"{count} files" => "{count} archivos", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "recuperado", "Nothing in here. Your trash bin is empty!" => "No hay nada aquí. ¡Tu papelera esta vacía!", "Restore" => "Recuperar", diff --git a/apps/files_trashbin/l10n/es_AR.php b/apps/files_trashbin/l10n/es_AR.php index 98f140983c..6f47255b50 100644 --- a/apps/files_trashbin/l10n/es_AR.php +++ b/apps/files_trashbin/l10n/es_AR.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Borrar de manera permanente", "Name" => "Nombre", "Deleted" => "Borrado", -"1 folder" => "1 directorio", -"{count} folders" => "{count} directorios", -"1 file" => "1 archivo", -"{count} files" => "{count} archivos", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "No hay nada acá. ¡La papelera está vacía!", "Restore" => "Recuperar", "Delete" => "Borrar", diff --git a/apps/files_trashbin/l10n/et_EE.php b/apps/files_trashbin/l10n/et_EE.php index 293d639b42..2cfcafa804 100644 --- a/apps/files_trashbin/l10n/et_EE.php +++ b/apps/files_trashbin/l10n/et_EE.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Kustuta jäädavalt", "Name" => "Nimi", "Deleted" => "Kustutatud", -"1 folder" => "1 kaust", -"{count} folders" => "{count} kausta", -"1 file" => "1 fail", -"{count} files" => "{count} faili", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "taastatud", "Nothing in here. Your trash bin is empty!" => "Siin pole midagi. Sinu prügikast on tühi!", "Restore" => "Taasta", diff --git a/apps/files_trashbin/l10n/eu.php b/apps/files_trashbin/l10n/eu.php index 2649124836..b114dc3386 100644 --- a/apps/files_trashbin/l10n/eu.php +++ b/apps/files_trashbin/l10n/eu.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Ezabatu betirako", "Name" => "Izena", "Deleted" => "Ezabatuta", -"1 folder" => "karpeta bat", -"{count} folders" => "{count} karpeta", -"1 file" => "fitxategi bat", -"{count} files" => "{count} fitxategi", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "Ez dago ezer ez. Zure zakarrontzia hutsik dago!", "Restore" => "Berrezarri", "Delete" => "Ezabatu", diff --git a/apps/files_trashbin/l10n/fa.php b/apps/files_trashbin/l10n/fa.php index 33a8d418cc..654f20a5f1 100644 --- a/apps/files_trashbin/l10n/fa.php +++ b/apps/files_trashbin/l10n/fa.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "حذف قطعی", "Name" => "نام", "Deleted" => "حذف شده", -"1 folder" => "1 پوشه", -"{count} folders" => "{ شمار} پوشه ها", -"1 file" => "1 پرونده", -"{count} files" => "{ شمار } فایل ها", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "هیچ چیزی اینجا نیست. سطل زباله ی شما خالی است.", "Restore" => "بازیابی", "Delete" => "حذف", diff --git a/apps/files_trashbin/l10n/fi_FI.php b/apps/files_trashbin/l10n/fi_FI.php index fec0567fbe..f03950981c 100644 --- a/apps/files_trashbin/l10n/fi_FI.php +++ b/apps/files_trashbin/l10n/fi_FI.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Poista pysyvästi", "Name" => "Nimi", "Deleted" => "Poistettu", -"1 folder" => "1 kansio", -"{count} folders" => "{count} kansiota", -"1 file" => "1 tiedosto", -"{count} files" => "{count} tiedostoa", +"_%n folder_::_%n folders_" => array("%n kansio","%n kansiota"), +"_%n file_::_%n files_" => array("%n tiedosto","%n tiedostoa"), "restored" => "palautettu", "Nothing in here. Your trash bin is empty!" => "Tyhjää täynnä! Roskakorissa ei ole mitään.", "Restore" => "Palauta", diff --git a/apps/files_trashbin/l10n/fr.php b/apps/files_trashbin/l10n/fr.php index 17c524d712..8854190e2c 100644 --- a/apps/files_trashbin/l10n/fr.php +++ b/apps/files_trashbin/l10n/fr.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Supprimer de façon définitive", "Name" => "Nom", "Deleted" => "Effacé", -"1 folder" => "1 dossier", -"{count} folders" => "{count} dossiers", -"1 file" => "1 fichier", -"{count} files" => "{count} fichiers", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !", "Restore" => "Restaurer", "Delete" => "Supprimer", diff --git a/apps/files_trashbin/l10n/gl.php b/apps/files_trashbin/l10n/gl.php index 9b222e6e15..568c17607f 100644 --- a/apps/files_trashbin/l10n/gl.php +++ b/apps/files_trashbin/l10n/gl.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Eliminar permanentemente", "Name" => "Nome", "Deleted" => "Eliminado", -"1 folder" => "1 cartafol", -"{count} folders" => "{count} cartafoles", -"1 file" => "1 ficheiro", -"{count} files" => "{count} ficheiros", +"_%n folder_::_%n folders_" => array("%n cartafol","%n cartafoles"), +"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"), "restored" => "restaurado", "Nothing in here. Your trash bin is empty!" => "Aquí non hai nada. O cesto do lixo está baleiro!", "Restore" => "Restablecer", diff --git a/apps/files_trashbin/l10n/he.php b/apps/files_trashbin/l10n/he.php index 1a0e3f4772..6aa6264a31 100644 --- a/apps/files_trashbin/l10n/he.php +++ b/apps/files_trashbin/l10n/he.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "מחיקה לצמיתות", "Name" => "שם", "Deleted" => "נמחק", -"1 folder" => "תיקייה אחת", -"{count} folders" => "{count} תיקיות", -"1 file" => "קובץ אחד", -"{count} files" => "{count} קבצים", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "אין כאן שום דבר. סל המיחזור שלך ריק!", "Restore" => "שחזור", "Delete" => "מחיקה", diff --git a/apps/files_trashbin/l10n/hr.php b/apps/files_trashbin/l10n/hr.php index 8e8fd22f8e..d227b4979a 100644 --- a/apps/files_trashbin/l10n/hr.php +++ b/apps/files_trashbin/l10n/hr.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Error" => "Greška", "Name" => "Ime", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "Delete" => "Obriši" ); $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_trashbin/l10n/hu_HU.php b/apps/files_trashbin/l10n/hu_HU.php index 7ed9eb7eba..aac6cf7800 100644 --- a/apps/files_trashbin/l10n/hu_HU.php +++ b/apps/files_trashbin/l10n/hu_HU.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Végleges törlés", "Name" => "Név", "Deleted" => "Törölve", -"1 folder" => "1 mappa", -"{count} folders" => "{count} mappa", -"1 file" => "1 fájl", -"{count} files" => "{count} fájl", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "visszaállítva", "Nothing in here. Your trash bin is empty!" => "Itt nincs semmi. Az Ön szemetes mappája üres!", "Restore" => "Visszaállítás", diff --git a/apps/files_trashbin/l10n/hy.php b/apps/files_trashbin/l10n/hy.php index f933bec8fe..6ff58b5620 100644 --- a/apps/files_trashbin/l10n/hy.php +++ b/apps/files_trashbin/l10n/hy.php @@ -1,5 +1,7 @@ array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "Ջնջել" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/ia.php b/apps/files_trashbin/l10n/ia.php index 7709ef030e..c583344a81 100644 --- a/apps/files_trashbin/l10n/ia.php +++ b/apps/files_trashbin/l10n/ia.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Error" => "Error", "Name" => "Nomine", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "Deler" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/id.php b/apps/files_trashbin/l10n/id.php index 4fbe154963..6aad1302f4 100644 --- a/apps/files_trashbin/l10n/id.php +++ b/apps/files_trashbin/l10n/id.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Hapus secara permanen", "Name" => "Nama", "Deleted" => "Dihapus", -"1 folder" => "1 folder", -"{count} folders" => "{count} folder", -"1 file" => "1 berkas", -"{count} files" => "{count} berkas", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "Tempat sampah anda kosong!", "Restore" => "Pulihkan", "Delete" => "Hapus", diff --git a/apps/files_trashbin/l10n/is.php b/apps/files_trashbin/l10n/is.php index 1cf794db97..55ae433646 100644 --- a/apps/files_trashbin/l10n/is.php +++ b/apps/files_trashbin/l10n/is.php @@ -2,10 +2,8 @@ $TRANSLATIONS = array( "Error" => "Villa", "Name" => "Nafn", -"1 folder" => "1 mappa", -"{count} folders" => "{count} möppur", -"1 file" => "1 skrá", -"{count} files" => "{count} skrár", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "Eyða" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/it.php b/apps/files_trashbin/l10n/it.php index 0843cd5c2e..0dc2b938f8 100644 --- a/apps/files_trashbin/l10n/it.php +++ b/apps/files_trashbin/l10n/it.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Elimina definitivamente", "Name" => "Nome", "Deleted" => "Eliminati", -"1 folder" => "1 cartella", -"{count} folders" => "{count} cartelle", -"1 file" => "1 file", -"{count} files" => "{count} file", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "ripristinati", "Nothing in here. Your trash bin is empty!" => "Qui non c'è niente. Il tuo cestino è vuoto.", "Restore" => "Ripristina", diff --git a/apps/files_trashbin/l10n/ja_JP.php b/apps/files_trashbin/l10n/ja_JP.php index 40fc0ded83..eb9748d57c 100644 --- a/apps/files_trashbin/l10n/ja_JP.php +++ b/apps/files_trashbin/l10n/ja_JP.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "完全に削除する", "Name" => "名前", "Deleted" => "削除済み", -"1 folder" => "1 フォルダ", -"{count} folders" => "{count} フォルダ", -"1 file" => "1 ファイル", -"{count} files" => "{count} ファイル", +"_%n folder_::_%n folders_" => array("%n個のフォルダ"), +"_%n file_::_%n files_" => array("%n個のファイル"), "restored" => "復元済", "Nothing in here. Your trash bin is empty!" => "ここには何もありません。ゴミ箱は空です!", "Restore" => "復元", diff --git a/apps/files_trashbin/l10n/ka_GE.php b/apps/files_trashbin/l10n/ka_GE.php index 6390613642..236d8951e9 100644 --- a/apps/files_trashbin/l10n/ka_GE.php +++ b/apps/files_trashbin/l10n/ka_GE.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "სრულად წაშლა", "Name" => "სახელი", "Deleted" => "წაშლილი", -"1 folder" => "1 საქაღალდე", -"{count} folders" => "{count} საქაღალდე", -"1 file" => "1 ფაილი", -"{count} files" => "{count} ფაილი", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "აქ არაფერი არ არის. სანაგვე ყუთი ცარიელია!", "Restore" => "აღდგენა", "Delete" => "წაშლა", diff --git a/apps/files_trashbin/l10n/ko.php b/apps/files_trashbin/l10n/ko.php index 68845b5472..f2e604d759 100644 --- a/apps/files_trashbin/l10n/ko.php +++ b/apps/files_trashbin/l10n/ko.php @@ -3,10 +3,8 @@ $TRANSLATIONS = array( "Error" => "오류", "Delete permanently" => "영원히 삭제", "Name" => "이름", -"1 folder" => "폴더 1개", -"{count} folders" => "폴더 {count}개", -"1 file" => "파일 1개", -"{count} files" => "파일 {count}개", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Restore" => "복원", "Delete" => "삭제" ); diff --git a/apps/files_trashbin/l10n/ku_IQ.php b/apps/files_trashbin/l10n/ku_IQ.php index c1962a4075..3f110f0600 100644 --- a/apps/files_trashbin/l10n/ku_IQ.php +++ b/apps/files_trashbin/l10n/ku_IQ.php @@ -1,6 +1,8 @@ "ههڵه", -"Name" => "ناو" +"Name" => "ناو", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("","") ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/lb.php b/apps/files_trashbin/l10n/lb.php index b434ae7217..cbfd515a8b 100644 --- a/apps/files_trashbin/l10n/lb.php +++ b/apps/files_trashbin/l10n/lb.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Error" => "Fehler", "Name" => "Numm", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "Läschen" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/lt_LT.php b/apps/files_trashbin/l10n/lt_LT.php index 4fd43bd17b..c4a12ff217 100644 --- a/apps/files_trashbin/l10n/lt_LT.php +++ b/apps/files_trashbin/l10n/lt_LT.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Ištrinti negrįžtamai", "Name" => "Pavadinimas", "Deleted" => "Ištrinti", -"1 folder" => "1 aplankalas", -"{count} folders" => "{count} aplankalai", -"1 file" => "1 failas", -"{count} files" => "{count} failai", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "Nothing in here. Your trash bin is empty!" => "Nieko nėra. Jūsų šiukšliadėžė tuščia!", "Restore" => "Atstatyti", "Delete" => "Ištrinti", diff --git a/apps/files_trashbin/l10n/lv.php b/apps/files_trashbin/l10n/lv.php index 5753162e29..ccbf117fda 100644 --- a/apps/files_trashbin/l10n/lv.php +++ b/apps/files_trashbin/l10n/lv.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Dzēst pavisam", "Name" => "Nosaukums", "Deleted" => "Dzēsts", -"1 folder" => "1 mape", -"{count} folders" => "{count} mapes", -"1 file" => "1 datne", -"{count} files" => "{count} datnes", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "Nothing in here. Your trash bin is empty!" => "Šeit nekā nav. Jūsu miskaste ir tukša!", "Restore" => "Atjaunot", "Delete" => "Dzēst", diff --git a/apps/files_trashbin/l10n/mk.php b/apps/files_trashbin/l10n/mk.php index 078140039b..965518dbc8 100644 --- a/apps/files_trashbin/l10n/mk.php +++ b/apps/files_trashbin/l10n/mk.php @@ -2,10 +2,8 @@ $TRANSLATIONS = array( "Error" => "Грешка", "Name" => "Име", -"1 folder" => "1 папка", -"{count} folders" => "{count} папки", -"1 file" => "1 датотека", -"{count} files" => "{count} датотеки", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "Избриши" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/apps/files_trashbin/l10n/ms_MY.php b/apps/files_trashbin/l10n/ms_MY.php index 1972eba031..1b5ca07c70 100644 --- a/apps/files_trashbin/l10n/ms_MY.php +++ b/apps/files_trashbin/l10n/ms_MY.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Error" => "Ralat", "Name" => "Nama", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Delete" => "Padam" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/nb_NO.php b/apps/files_trashbin/l10n/nb_NO.php index e650904a41..8a69b3d87a 100644 --- a/apps/files_trashbin/l10n/nb_NO.php +++ b/apps/files_trashbin/l10n/nb_NO.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Slett permanent", "Name" => "Navn", "Deleted" => "Slettet", -"1 folder" => "1 mappe", -"{count} folders" => "{count} mapper", -"1 file" => "1 fil", -"{count} files" => "{count} filer", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "Ingenting her. Søppelkassen din er tom!", "Restore" => "Gjenopprett", "Delete" => "Slett", diff --git a/apps/files_trashbin/l10n/nl.php b/apps/files_trashbin/l10n/nl.php index 21b6d39378..2c6dcb2fcb 100644 --- a/apps/files_trashbin/l10n/nl.php +++ b/apps/files_trashbin/l10n/nl.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Verwijder definitief", "Name" => "Naam", "Deleted" => "Verwijderd", -"1 folder" => "1 map", -"{count} folders" => "{count} mappen", -"1 file" => "1 bestand", -"{count} files" => "{count} bestanden", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "hersteld", "Nothing in here. Your trash bin is empty!" => "Niets te vinden. Uw prullenbak is leeg!", "Restore" => "Herstellen", diff --git a/apps/files_trashbin/l10n/nn_NO.php b/apps/files_trashbin/l10n/nn_NO.php index 3e1f9b819a..9e351668e3 100644 --- a/apps/files_trashbin/l10n/nn_NO.php +++ b/apps/files_trashbin/l10n/nn_NO.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Slett for godt", "Name" => "Namn", "Deleted" => "Sletta", -"1 folder" => "1 mappe", -"{count} folders" => "{count} mapper", -"1 file" => "1 fil", -"{count} files" => "{count} filer", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "Ingenting her. Papirkorga di er tom!", "Restore" => "Gjenopprett", "Delete" => "Slett", diff --git a/apps/files_trashbin/l10n/oc.php b/apps/files_trashbin/l10n/oc.php index b472683f08..a62902c3b7 100644 --- a/apps/files_trashbin/l10n/oc.php +++ b/apps/files_trashbin/l10n/oc.php @@ -2,6 +2,8 @@ $TRANSLATIONS = array( "Error" => "Error", "Name" => "Nom", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "Escafa" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/apps/files_trashbin/l10n/pl.php b/apps/files_trashbin/l10n/pl.php index d31a671eb5..e8295e2ff0 100644 --- a/apps/files_trashbin/l10n/pl.php +++ b/apps/files_trashbin/l10n/pl.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Trwale usuń", "Name" => "Nazwa", "Deleted" => "Usunięte", -"1 folder" => "1 folder", -"{count} folders" => "Ilość folderów: {count}", -"1 file" => "1 plik", -"{count} files" => "Ilość plików: {count}", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "restored" => "przywrócony", "Nothing in here. Your trash bin is empty!" => "Nic tu nie ma. Twój kosz jest pusty!", "Restore" => "Przywróć", diff --git a/apps/files_trashbin/l10n/pt_BR.php b/apps/files_trashbin/l10n/pt_BR.php index 26eea51b81..1e3c67ba02 100644 --- a/apps/files_trashbin/l10n/pt_BR.php +++ b/apps/files_trashbin/l10n/pt_BR.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Excluir permanentemente", "Name" => "Nome", "Deleted" => "Excluído", -"1 folder" => "1 pasta", -"{count} folders" => "{count} pastas", -"1 file" => "1 arquivo", -"{count} files" => "{count} arquivos", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "restaurado", "Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!", "Restore" => "Restaurar", diff --git a/apps/files_trashbin/l10n/pt_PT.php b/apps/files_trashbin/l10n/pt_PT.php index 15213892d2..0c88d132b5 100644 --- a/apps/files_trashbin/l10n/pt_PT.php +++ b/apps/files_trashbin/l10n/pt_PT.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Eliminar permanentemente", "Name" => "Nome", "Deleted" => "Apagado", -"1 folder" => "1 pasta", -"{count} folders" => "{count} pastas", -"1 file" => "1 ficheiro", -"{count} files" => "{count} ficheiros", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "Restaurado", "Nothing in here. Your trash bin is empty!" => "Não hà ficheiros. O lixo está vazio!", "Restore" => "Restaurar", diff --git a/apps/files_trashbin/l10n/ro.php b/apps/files_trashbin/l10n/ro.php index 3c38f16b39..0b1d2cd9e1 100644 --- a/apps/files_trashbin/l10n/ro.php +++ b/apps/files_trashbin/l10n/ro.php @@ -3,10 +3,8 @@ $TRANSLATIONS = array( "Error" => "Eroare", "Delete permanently" => "Stergere permanenta", "Name" => "Nume", -"1 folder" => "1 folder", -"{count} folders" => "{count} foldare", -"1 file" => "1 fisier", -"{count} files" => "{count} fisiere", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "Delete" => "Șterge" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/apps/files_trashbin/l10n/ru.php b/apps/files_trashbin/l10n/ru.php index d883115281..909e4d7131 100644 --- a/apps/files_trashbin/l10n/ru.php +++ b/apps/files_trashbin/l10n/ru.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Удалено навсегда", "Name" => "Имя", "Deleted" => "Удалён", -"1 folder" => "1 папка", -"{count} folders" => "{count} папок", -"1 file" => "1 файл", -"{count} files" => "{count} файлов", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "restored" => "восстановлен", "Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!", "Restore" => "Восстановить", diff --git a/apps/files_trashbin/l10n/ru_RU.php b/apps/files_trashbin/l10n/ru_RU.php deleted file mode 100644 index 3fda38c66b..0000000000 --- a/apps/files_trashbin/l10n/ru_RU.php +++ /dev/null @@ -1,7 +0,0 @@ - "Ошибка", -"Name" => "Имя", -"Delete" => "Удалить" -); -$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_trashbin/l10n/si_LK.php b/apps/files_trashbin/l10n/si_LK.php index 9de1c00989..6dad84437c 100644 --- a/apps/files_trashbin/l10n/si_LK.php +++ b/apps/files_trashbin/l10n/si_LK.php @@ -2,8 +2,8 @@ $TRANSLATIONS = array( "Error" => "දෝෂයක්", "Name" => "නම", -"1 folder" => "1 ෆොල්ඩරයක්", -"1 file" => "1 ගොනුවක්", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "මකා දමන්න" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/sk_SK.php b/apps/files_trashbin/l10n/sk_SK.php index 552a69f4fc..0f78da5fc3 100644 --- a/apps/files_trashbin/l10n/sk_SK.php +++ b/apps/files_trashbin/l10n/sk_SK.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Zmazať trvalo", "Name" => "Názov", "Deleted" => "Zmazané", -"1 folder" => "1 priečinok", -"{count} folders" => "{count} priečinkov", -"1 file" => "1 súbor", -"{count} files" => "{count} súborov", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "restored" => "obnovené", "Nothing in here. Your trash bin is empty!" => "Žiadny obsah. Kôš je prázdny!", "Restore" => "Obnoviť", diff --git a/apps/files_trashbin/l10n/sl.php b/apps/files_trashbin/l10n/sl.php index 4140bb8d59..eb2d42a18f 100644 --- a/apps/files_trashbin/l10n/sl.php +++ b/apps/files_trashbin/l10n/sl.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Izbriši dokončno", "Name" => "Ime", "Deleted" => "Izbrisano", -"1 folder" => "1 mapa", -"{count} folders" => "{count} map", -"1 file" => "1 datoteka", -"{count} files" => "{count} datotek", +"_%n folder_::_%n folders_" => array("","","",""), +"_%n file_::_%n files_" => array("","","",""), "Nothing in here. Your trash bin is empty!" => "Mapa smeti je prazna.", "Restore" => "Obnovi", "Delete" => "Izbriši", diff --git a/apps/files_trashbin/l10n/sq.php b/apps/files_trashbin/l10n/sq.php index a0dae065b7..1b7b5b828c 100644 --- a/apps/files_trashbin/l10n/sq.php +++ b/apps/files_trashbin/l10n/sq.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Elimino përfundimisht", "Name" => "Emri", "Deleted" => "Eliminuar", -"1 folder" => "1 dosje", -"{count} folders" => "{count} dosje", -"1 file" => "1 skedar", -"{count} files" => "{count} skedarë", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Nothing in here. Your trash bin is empty!" => "Këtu nuk ka asgjë. Koshi juaj është bosh!", "Restore" => "Rivendos", "Delete" => "Elimino", diff --git a/apps/files_trashbin/l10n/sr.php b/apps/files_trashbin/l10n/sr.php index 8302df5f26..7311e759f9 100644 --- a/apps/files_trashbin/l10n/sr.php +++ b/apps/files_trashbin/l10n/sr.php @@ -5,10 +5,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Обриши за стално", "Name" => "Име", "Deleted" => "Обрисано", -"1 folder" => "1 фасцикла", -"{count} folders" => "{count} фасцикле/и", -"1 file" => "1 датотека", -"{count} files" => "{count} датотеке/а", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "Nothing in here. Your trash bin is empty!" => "Овде нема ништа. Корпа за отпатке је празна.", "Restore" => "Врати", "Delete" => "Обриши" diff --git a/apps/files_trashbin/l10n/sr@latin.php b/apps/files_trashbin/l10n/sr@latin.php index 0511d9f609..483d1e3ca2 100644 --- a/apps/files_trashbin/l10n/sr@latin.php +++ b/apps/files_trashbin/l10n/sr@latin.php @@ -1,6 +1,8 @@ "Ime", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "Delete" => "Obriši" ); $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_trashbin/l10n/sv.php b/apps/files_trashbin/l10n/sv.php index 9eb83734b4..b0752cbbe8 100644 --- a/apps/files_trashbin/l10n/sv.php +++ b/apps/files_trashbin/l10n/sv.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Radera permanent", "Name" => "Namn", "Deleted" => "Raderad", -"1 folder" => "1 mapp", -"{count} folders" => "{count} mappar", -"1 file" => "1 fil", -"{count} files" => "{count} filer", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "restored" => "återställd", "Nothing in here. Your trash bin is empty!" => "Ingenting här. Din papperskorg är tom!", "Restore" => "Återskapa", diff --git a/apps/files_trashbin/l10n/ta_LK.php b/apps/files_trashbin/l10n/ta_LK.php index 35253900b1..ed93b459c7 100644 --- a/apps/files_trashbin/l10n/ta_LK.php +++ b/apps/files_trashbin/l10n/ta_LK.php @@ -2,10 +2,8 @@ $TRANSLATIONS = array( "Error" => "வழு", "Name" => "பெயர்", -"1 folder" => "1 கோப்புறை", -"{count} folders" => "{எண்ணிக்கை} கோப்புறைகள்", -"1 file" => "1 கோப்பு", -"{count} files" => "{எண்ணிக்கை} கோப்புகள்", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "நீக்குக" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/te.php b/apps/files_trashbin/l10n/te.php index f89a9fda5f..0d803a8e64 100644 --- a/apps/files_trashbin/l10n/te.php +++ b/apps/files_trashbin/l10n/te.php @@ -3,6 +3,8 @@ $TRANSLATIONS = array( "Error" => "పొరపాటు", "Delete permanently" => "శాశ్వతంగా తొలగించు", "Name" => "పేరు", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("",""), "Delete" => "తొలగించు" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/th_TH.php b/apps/files_trashbin/l10n/th_TH.php index dc49155b9b..31caa11aac 100644 --- a/apps/files_trashbin/l10n/th_TH.php +++ b/apps/files_trashbin/l10n/th_TH.php @@ -4,10 +4,8 @@ $TRANSLATIONS = array( "Error" => "ข้อผิดพลาด", "Name" => "ชื่อ", "Deleted" => "ลบแล้ว", -"1 folder" => "1 โฟลเดอร์", -"{count} folders" => "{count} โฟลเดอร์", -"1 file" => "1 ไฟล์", -"{count} files" => "{count} ไฟล์", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "ไม่มีอะไรอยู่ในนี้ ถังขยะของคุณยังว่างอยู่", "Restore" => "คืนค่า", "Delete" => "ลบ", diff --git a/apps/files_trashbin/l10n/tr.php b/apps/files_trashbin/l10n/tr.php index df1b692af5..f25b179bc1 100644 --- a/apps/files_trashbin/l10n/tr.php +++ b/apps/files_trashbin/l10n/tr.php @@ -8,10 +8,9 @@ $TRANSLATIONS = array( "Delete permanently" => "Kalıcı olarak sil", "Name" => "İsim", "Deleted" => "Silindi", -"1 folder" => "1 dizin", -"{count} folders" => "{count} dizin", -"1 file" => "1 dosya", -"{count} files" => "{count} dosya", +"_%n folder_::_%n folders_" => array("","%n dizin"), +"_%n file_::_%n files_" => array("","%n dosya"), +"restored" => "geri yüklendi", "Nothing in here. Your trash bin is empty!" => "Burası boş. Çöp kutun tamamen boş.", "Restore" => "Geri yükle", "Delete" => "Sil", diff --git a/apps/files_trashbin/l10n/ug.php b/apps/files_trashbin/l10n/ug.php index 6546668597..ad983aee18 100644 --- a/apps/files_trashbin/l10n/ug.php +++ b/apps/files_trashbin/l10n/ug.php @@ -4,9 +4,8 @@ $TRANSLATIONS = array( "Delete permanently" => "مەڭگۈلۈك ئۆچۈر", "Name" => "ئاتى", "Deleted" => "ئۆچۈرۈلدى", -"1 folder" => "1 قىسقۇچ", -"1 file" => "1 ھۆججەت", -"{count} files" => "{count} ھۆججەت", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "بۇ جايدا ھېچنېمە يوق. Your trash bin is empty!", "Delete" => "ئۆچۈر" ); diff --git a/apps/files_trashbin/l10n/uk.php b/apps/files_trashbin/l10n/uk.php index 93e9b6aa7b..aa4b659503 100644 --- a/apps/files_trashbin/l10n/uk.php +++ b/apps/files_trashbin/l10n/uk.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Видалити назавжди", "Name" => "Ім'я", "Deleted" => "Видалено", -"1 folder" => "1 папка", -"{count} folders" => "{count} папок", -"1 file" => "1 файл", -"{count} files" => "{count} файлів", +"_%n folder_::_%n folders_" => array("","",""), +"_%n file_::_%n files_" => array("","",""), "restored" => "відновлено", "Nothing in here. Your trash bin is empty!" => "Нічого немає. Ваший кошик для сміття пустий!", "Restore" => "Відновити", diff --git a/apps/files_trashbin/l10n/ur_PK.php b/apps/files_trashbin/l10n/ur_PK.php index 49c82f5387..f6c6a3da3c 100644 --- a/apps/files_trashbin/l10n/ur_PK.php +++ b/apps/files_trashbin/l10n/ur_PK.php @@ -1,5 +1,7 @@ "ایرر" +"Error" => "ایرر", +"_%n folder_::_%n folders_" => array("",""), +"_%n file_::_%n files_" => array("","") ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/apps/files_trashbin/l10n/vi.php b/apps/files_trashbin/l10n/vi.php index 5e16a8392d..072d799fa6 100644 --- a/apps/files_trashbin/l10n/vi.php +++ b/apps/files_trashbin/l10n/vi.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "Xóa vĩnh vễn", "Name" => "Tên", "Deleted" => "Đã xóa", -"1 folder" => "1 thư mục", -"{count} folders" => "{count} thư mục", -"1 file" => "1 tập tin", -"{count} files" => "{count} tập tin", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "Không có gì ở đây. Thùng rác của bạn rỗng!", "Restore" => "Khôi phục", "Delete" => "Xóa", diff --git a/apps/files_trashbin/l10n/zh_CN.GB2312.php b/apps/files_trashbin/l10n/zh_CN.GB2312.php index 768a9616d7..eaa97bb1b6 100644 --- a/apps/files_trashbin/l10n/zh_CN.GB2312.php +++ b/apps/files_trashbin/l10n/zh_CN.GB2312.php @@ -3,10 +3,10 @@ $TRANSLATIONS = array( "Error" => "出错", "Delete permanently" => "永久删除", "Name" => "名称", -"1 folder" => "1 个文件夹", -"{count} folders" => "{count} 个文件夹", -"1 file" => "1 个文件", -"{count} files" => "{count} 个文件", -"Delete" => "删除" +"_%n folder_::_%n folders_" => array("%n 个文件夹"), +"_%n file_::_%n files_" => array("%n 个文件"), +"Restore" => "恢复", +"Delete" => "删除", +"Deleted Files" => "删除的文件" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/zh_CN.php b/apps/files_trashbin/l10n/zh_CN.php index c149c6c966..6609f57d9c 100644 --- a/apps/files_trashbin/l10n/zh_CN.php +++ b/apps/files_trashbin/l10n/zh_CN.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "永久删除", "Name" => "名称", "Deleted" => "已删除", -"1 folder" => "1个文件夹", -"{count} folders" => "{count} 个文件夹", -"1 file" => "1 个文件", -"{count} files" => "{count} 个文件", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "这里没有东西. 你的回收站是空的!", "Restore" => "恢复", "Delete" => "删除", diff --git a/apps/files_trashbin/l10n/zh_HK.php b/apps/files_trashbin/l10n/zh_HK.php index 6b9f650687..3f0d663bae 100644 --- a/apps/files_trashbin/l10n/zh_HK.php +++ b/apps/files_trashbin/l10n/zh_HK.php @@ -2,7 +2,8 @@ $TRANSLATIONS = array( "Error" => "錯誤", "Name" => "名稱", -"{count} folders" => "{}文件夾", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Delete" => "刪除" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_trashbin/l10n/zh_TW.php b/apps/files_trashbin/l10n/zh_TW.php index 39fe4ce988..ab6b75c578 100644 --- a/apps/files_trashbin/l10n/zh_TW.php +++ b/apps/files_trashbin/l10n/zh_TW.php @@ -8,10 +8,8 @@ $TRANSLATIONS = array( "Delete permanently" => "永久刪除", "Name" => "名稱", "Deleted" => "已刪除", -"1 folder" => "1 個資料夾", -"{count} folders" => "{count} 個資料夾", -"1 file" => "1 個檔案", -"{count} files" => "{count} 個檔案", +"_%n folder_::_%n folders_" => array(""), +"_%n file_::_%n files_" => array(""), "Nothing in here. Your trash bin is empty!" => "您的垃圾桶是空的!", "Restore" => "復原", "Delete" => "刪除", diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 615eafee61..fe2b8e5cd7 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -717,7 +717,7 @@ class Trashbin { \OC_Log::write('files_trashbin', 'remove "' . $filename . '" fom trash bin because it is older than ' . $retention_obligation, \OC_log::INFO); } } - $availableSpace = $availableSpace + $size; + $availableSpace += $size; // if size limit for trash bin reached, delete oldest files in trash bin if ($availableSpace < 0) { $query = \OC_DB::prepare('SELECT `location`,`type`,`id`,`timestamp` FROM `*PREFIX*files_trash`' diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php index 8cef57c9e4..38c288adf9 100644 --- a/apps/files_versions/appinfo/routes.php +++ b/apps/files_versions/appinfo/routes.php @@ -6,4 +6,4 @@ */ // Register with the capabilities API -OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH); \ No newline at end of file +OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH); diff --git a/apps/files_versions/css/versions.css b/apps/files_versions/css/versions.css index 6146eda337..6a9b3a9569 100644 --- a/apps/files_versions/css/versions.css +++ b/apps/files_versions/css/versions.css @@ -1,3 +1,7 @@ +#dropdown.drop-versions { + width:22em; +} + #found_versions li { width: 100%; cursor: default; @@ -39,6 +43,3 @@ float: right; } -.drop-versions #makelink { - float: left; -} diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index ca479507d4..a14de7dbee 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -104,9 +104,9 @@ function createVersionsDropdown(filename, files) { success: function(result) { var versions = result.data.versions; if (result.data.endReached === true) { - document.getElementById("show-more-versions").style.display="none"; + $("#show-more-versions").css("display", "none"); } else { - document.getElementById("show-more-versions").style.display="block"; + $("#show-more-versions").css("display", "block"); } if (versions) { $.each(versions, function(index, row) { @@ -132,8 +132,6 @@ function createVersionsDropdown(filename, files) { download =''; download+=''; download+=name; download+=''; @@ -143,8 +141,6 @@ function createVersionsDropdown(filename, files) { revert+=' value="' + files + '">'; revert+=''+t('files_versions', 'Restore')+''; diff --git a/apps/files_versions/l10n/cs_CZ.php b/apps/files_versions/l10n/cs_CZ.php index a2fc76d443..45ce297eae 100644 --- a/apps/files_versions/l10n/cs_CZ.php +++ b/apps/files_versions/l10n/cs_CZ.php @@ -1,8 +1,8 @@ "Nelze navrátit: %s", +"Could not revert: %s" => "Nelze vrátit: %s", "Versions" => "Verze", -"Failed to revert {file} to revision {timestamp}." => "Selhalo navrácení souboru {file} na verzi {timestamp}.", +"Failed to revert {file} to revision {timestamp}." => "Selhalo vrácení souboru {file} na verzi {timestamp}.", "More versions..." => "Více verzí...", "No other versions available" => "Žádné další verze nejsou dostupné", "Restore" => "Obnovit" diff --git a/apps/files_versions/l10n/ru_RU.php b/apps/files_versions/l10n/ru_RU.php deleted file mode 100644 index 8656e346eb..0000000000 --- a/apps/files_versions/l10n/ru_RU.php +++ /dev/null @@ -1,5 +0,0 @@ - "История", -"Files Versioning" => "Файлы управления версиями", -"Enable" => "Включить" -); diff --git a/apps/files_versions/l10n/zh_CN.GB2312.php b/apps/files_versions/l10n/zh_CN.GB2312.php index aa0a59b71a..de340d6dc9 100644 --- a/apps/files_versions/l10n/zh_CN.GB2312.php +++ b/apps/files_versions/l10n/zh_CN.GB2312.php @@ -1,6 +1,10 @@ "无法恢复:%s", -"Versions" => "版本" +"Versions" => "版本", +"Failed to revert {file} to revision {timestamp}." => "无法恢复文件 {file} 到 版本 {timestamp}。", +"More versions..." => "更多版本", +"No other versions available" => "没有其他可用版本", +"Restore" => "恢复" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/apps/files_versions/lib/capabilities.php b/apps/files_versions/lib/capabilities.php index 3251a07b6a..45d7dd3fb0 100644 --- a/apps/files_versions/lib/capabilities.php +++ b/apps/files_versions/lib/capabilities.php @@ -20,4 +20,4 @@ class Capabilities { )); } -} \ No newline at end of file +} diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index f0082b301a..81ee3c8b3c 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -19,7 +19,7 @@ class Hooks { */ public static function write_hook( $params ) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + if (\OCP\App::isEnabled('files_versions')) { $path = $params[\OC\Files\Filesystem::signal_param_path]; if($path<>'') { Storage::store($path); @@ -36,12 +36,12 @@ class Hooks { * cleanup the versions directory if the actual file gets deleted */ public static function remove_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + if (\OCP\App::isEnabled('files_versions')) { $path = $params[\OC\Files\Filesystem::signal_param_path]; if($path<>'') { Storage::delete($path); } - } } @@ -53,13 +53,13 @@ class Hooks { * of the stored versions along the actual file */ public static function rename_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + if (\OCP\App::isEnabled('files_versions')) { $oldpath = $params['oldpath']; $newpath = $params['newpath']; if($oldpath<>'' && $newpath<>'') { Storage::rename( $oldpath, $newpath ); } - } } @@ -71,10 +71,11 @@ class Hooks { * to remove the used space for versions stored in the database */ public static function deleteUser_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + if (\OCP\App::isEnabled('files_versions')) { $uid = $params['uid']; Storage::deleteUser($uid); - } + } } } diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 70b8f30be5..0b4699dc5c 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -48,14 +48,14 @@ class Storage { /** * get current size of all versions from a given user - * + * * @param $user user who owns the versions * @return mixed versions size or false if no versions size is stored */ private static function getVersionsSize($user) { $query = \OC_DB::prepare('SELECT `size` FROM `*PREFIX*files_versions` WHERE `user`=?'); $result = $query->execute(array($user))->fetchAll(); - + if ($result) { return $result[0]['size']; } @@ -64,7 +64,7 @@ class Storage { /** * write to the database how much space is in use for versions - * + * * @param $user owner of the versions * @param $size size of the versions */ @@ -76,20 +76,20 @@ class Storage { } $query->execute(array($size, $user)); } - + /** * store a new version of a file. */ public static function store($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - + // if the file gets streamed we need to remove the .part extension // to get the right target $ext = pathinfo($filename, PATHINFO_EXTENSION); if ($ext === 'part') { $filename = substr($filename, 0, strlen($filename)-5); } - + list($uid, $filename) = self::getUidAndFilename($filename); $files_view = new \OC\Files\View('/'.$uid .'/files'); @@ -104,17 +104,12 @@ class Storage { // we should have a source file to work with, and the file shouldn't // be empty $fileExists = $files_view->file_exists($filename); - $fileSize = $files_view->filesize($filename); - if ($fileExists === false || $fileSize === 0) { + if (!($fileExists && $files_view->filesize($filename) > 0)) { return false; } // create all parent folders - $info=pathinfo($filename); - $versionsFolderName=$versions_view->getLocalFolder(''); - if(!file_exists($versionsFolderName.'/'.$info['dirname'])) { - mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true); - } + self::createMissingDirectories($filename, $users_view); $versionsSize = self::getVersionsSize($uid); if ( $versionsSize === false || $versionsSize < 0 ) { @@ -174,7 +169,7 @@ class Storage { list($uidn, $newpath) = self::getUidAndFilename($new_path); $versions_view = new \OC\Files\View('/'.$uid .'/files_versions'); $files_view = new \OC\Files\View('/'.$uid .'/files'); - + // if the file already exists than it was a upload of a existing file // over the web interface -> store() is the right function we need here if ($files_view->file_exists($newpath)) { @@ -183,13 +178,12 @@ class Storage { self::expire($newpath); - $abs_newpath = $versions_view->getLocalFile($newpath); - if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) { $versions_view->rename($oldpath, $newpath); } else if ( ($versions = Storage::getVersions($uid, $oldpath)) ) { - $info=pathinfo($abs_newpath); - if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true); + // create missing dirs if necessary + self::createMissingDirectories($newpath, new \OC\Files\View('/'. $uidn)); + foreach ($versions as $v) { $versions_view->rename($oldpath.'.v'.$v['version'], $newpath.'.v'.$v['version']); } @@ -435,7 +429,7 @@ class Storage { } else { $quota = \OCP\Util::computerFileSize($quota); } - + // make sure that we have the current size of the version history if ( $versionsSize === null ) { $versionsSize = self::getVersionsSize($uid); @@ -568,4 +562,21 @@ class Storage { return $size; } + /** + * @brief create recursively missing directories + * @param string $filename $path to a file + * @param \OC\Files\View $view view on data/user/ + */ + private static function createMissingDirectories($filename, $view) { + $dirname = \OC_Filesystem::normalizePath(dirname($filename)); + $dirParts = explode('/', $dirname); + $dir = "/files_versions"; + foreach ($dirParts as $part) { + $dir = $dir . '/' . $part; + if (!$view->file_exists($dir)) { + $view->mkdir($dir); + } + } + } + } diff --git a/apps/user_ldap/ajax/clearMappings.php b/apps/user_ldap/ajax/clearMappings.php index 5dab39839b..9118d58c5c 100644 --- a/apps/user_ldap/ajax/clearMappings.php +++ b/apps/user_ldap/ajax/clearMappings.php @@ -32,4 +32,4 @@ if(\OCA\user_ldap\lib\Helper::clearMapping($subject)) { } else { $l=OC_L10N::get('user_ldap'); OCP\JSON::error(array('message' => $l->t('Failed to clear the mappings.'))); -} \ No newline at end of file +} diff --git a/apps/user_ldap/ajax/getConfiguration.php b/apps/user_ldap/ajax/getConfiguration.php index dfae68d2dc..baca588976 100644 --- a/apps/user_ldap/ajax/getConfiguration.php +++ b/apps/user_ldap/ajax/getConfiguration.php @@ -28,4 +28,4 @@ OCP\JSON::callCheck(); $prefix = $_POST['ldap_serverconfig_chooser']; $connection = new \OCA\user_ldap\lib\Connection($prefix); -OCP\JSON::success(array('configuration' => $connection->getConfiguration())); \ No newline at end of file +OCP\JSON::success(array('configuration' => $connection->getConfiguration())); diff --git a/apps/user_ldap/ajax/getNewServerConfigPrefix.php b/apps/user_ldap/ajax/getNewServerConfigPrefix.php index 17e78f8707..1c68b2e9a7 100644 --- a/apps/user_ldap/ajax/getNewServerConfigPrefix.php +++ b/apps/user_ldap/ajax/getNewServerConfigPrefix.php @@ -31,4 +31,4 @@ sort($serverConnections); $lk = array_pop($serverConnections); $ln = intval(str_replace('s', '', $lk)); $nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT); -OCP\JSON::success(array('configPrefix' => $nk)); \ No newline at end of file +OCP\JSON::success(array('configPrefix' => $nk)); diff --git a/apps/user_ldap/ajax/setConfiguration.php b/apps/user_ldap/ajax/setConfiguration.php index 206487c7e0..d850bda247 100644 --- a/apps/user_ldap/ajax/setConfiguration.php +++ b/apps/user_ldap/ajax/setConfiguration.php @@ -30,4 +30,4 @@ $prefix = $_POST['ldap_serverconfig_chooser']; $connection = new \OCA\user_ldap\lib\Connection($prefix); $connection->setConfiguration($_POST); $connection->saveConfiguration(); -OCP\JSON::success(); \ No newline at end of file +OCP\JSON::success(); diff --git a/apps/user_ldap/css/settings.css b/apps/user_ldap/css/settings.css index 185952e14b..6086c7b74e 100644 --- a/apps/user_ldap/css/settings.css +++ b/apps/user_ldap/css/settings.css @@ -3,14 +3,20 @@ max-width: 200px; display: inline-block; vertical-align: top; + text-align: right; padding-top: 9px; + padding-right: 5px; } #ldap fieldset input, #ldap fieldset textarea { - width: 70%; + width: 60%; display: inline-block; } +#ldap fieldset p input[type=checkbox] { + vertical-align: bottom; +} + .ldapIndent { margin-left: 50px; } @@ -18,4 +24,4 @@ .ldapwarning { margin-left: 1.4em; color: #FF3B3B; -} \ No newline at end of file +} diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/group_proxy.php index 75e7cd4633..eb6f176c58 100644 --- a/apps/user_ldap/group_proxy.php +++ b/apps/user_ldap/group_proxy.php @@ -198,4 +198,4 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { //it's the same across all our user backends obviously return $this->refBackend->implementsActions($actions); } -} \ No newline at end of file +} diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js index 52d5dbc48d..78ec71b70a 100644 --- a/apps/user_ldap/js/settings.js +++ b/apps/user_ldap/js/settings.js @@ -176,6 +176,13 @@ $(document).ready(function() { $('#ldap_submit').effect('highlight', {'color':'#A8FA87'}, 5000, function() { $('#ldap_submit').css('background', bgcolor); }); + //update the Label in the config chooser + caption = $('#ldap_serverconfig_chooser option:selected:first').text(); + pretext = '. Server: '; + caption = caption.slice(0, caption.indexOf(pretext) + pretext.length); + caption = caption + $('#ldap_host').val(); + $('#ldap_serverconfig_chooser option:selected:first').text(caption); + } else { $('#ldap_submit').css('background', '#fff'); $('#ldap_submit').effect('highlight', {'color':'#E97'}, 5000, function() { @@ -204,4 +211,4 @@ $(document).ready(function() { LdapConfiguration.refreshConfig(); } }); -}); \ No newline at end of file +}); diff --git a/apps/user_ldap/l10n/ru_RU.php b/apps/user_ldap/l10n/ru_RU.php deleted file mode 100644 index 623d8f2d8e..0000000000 --- a/apps/user_ldap/l10n/ru_RU.php +++ /dev/null @@ -1,6 +0,0 @@ - "Успех", -"Error" => "Ошибка" -); -$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/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 36c8e648b1..e5d9b4d5b4 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -29,6 +29,9 @@ class Connection { private $configID; private $configured = false; + //whether connection should be kept on __destruct + private $dontDestruct = false; + //cache handler protected $cache; @@ -77,17 +80,31 @@ class Connection { public function __construct($configPrefix = '', $configID = 'user_ldap') { $this->configPrefix = $configPrefix; $this->configID = $configID; - $this->cache = \OC_Cache::getGlobalCache(); + $memcache = new \OC\Memcache\Factory(); + if($memcache->isAvailable()) { + $this->cache = $memcache->create(); + } else { + $this->cache = \OC_Cache::getGlobalCache(); + } $this->config['hasPagedResultSupport'] = (function_exists('ldap_control_paged_result') && function_exists('ldap_control_paged_result_response')); } public function __destruct() { - if(is_resource($this->ldapConnectionRes)) { + if(!$this->dontDestruct && is_resource($this->ldapConnectionRes)) { @ldap_unbind($this->ldapConnectionRes); }; } + /** + * @brief defines behaviour when the instance is cloned + */ + public function __clone() { + //a cloned instance inherits the connection resource. It may use it, + //but it may not disconnect it + $this->dontDestruct = true; + } + public function __get($name) { if(!$this->configured) { $this->readConfiguration(); diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php index f65f466789..4c9dd07a12 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/helper.php @@ -70,6 +70,34 @@ class Helper { return $prefixes; } + /** + * + * @brief determines the host for every configured connection + * @return an array with configprefix as keys + * + */ + static public function getServerConfigurationHosts() { + $referenceConfigkey = 'ldap_host'; + + $query = ' + SELECT DISTINCT `configkey`, `configvalue` + FROM `*PREFIX*appconfig` + WHERE `appid` = \'user_ldap\' + AND `configkey` LIKE ? + '; + $query = \OCP\DB::prepare($query); + $configHosts = $query->execute(array('%'.$referenceConfigkey))->fetchAll(); + $result = array(); + + foreach($configHosts as $configHost) { + $len = strlen($configHost['configkey']) - strlen($referenceConfigkey); + $prefix = substr($configHost['configkey'], 0, $len); + $result[$prefix] = $configHost['configvalue']; + } + + return $result; + } + /** * @brief deletes a given saved LDAP/AD server configuration. * @param string the configuration prefix of the config to delete diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php index c80e216347..ae3e3be736 100644 --- a/apps/user_ldap/lib/proxy.php +++ b/apps/user_ldap/lib/proxy.php @@ -101,4 +101,4 @@ abstract class Proxy { public function clearCache() { $this->cache->clear($this->getCacheKey(null)); } -} \ No newline at end of file +} diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index 22e2dac6d2..7169192a18 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -44,7 +44,9 @@ OCP\Util::addstyle('user_ldap', 'settings'); $tmpl = new OCP\Template('user_ldap', 'settings'); $prefixes = \OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes(); +$hosts = \OCA\user_ldap\lib\Helper::getServerConfigurationHosts(); $tmpl->assign('serverConfigurationPrefixes', $prefixes); +$tmpl->assign('serverConfigurationHosts', $hosts); // assign default values if(!isset($ldap)) { diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 95aa592594..e214d57fb1 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -24,7 +24,7 @@ $sel = ' selected'; foreach($_['serverConfigurationPrefixes'] as $prefix) { ?> - + -
-
t('without any placeholder, e.g. "objectClass=person".'));?>
-
t('without any placeholder, e.g. "objectClass=posixGroup".'));?>