diff --git a/css/cwd.css b/css/cwd.css index d9bcb5e96..992f294cf 100644 --- a/css/cwd.css +++ b/css/cwd.css @@ -32,7 +32,7 @@ /* file container */ .elfinder-cwd-view-icons .elfinder-cwd-file { - width:80px; + width:120px; height:80px; padding-bottom:2px; cursor:default; @@ -40,8 +40,8 @@ } /* ltr/rtl enviroment */ -.elfinder-ltr .elfinder-cwd-view-icons .elfinder-cwd-file { float:left; margin:0 3px 3px 0; } -.elfinder-rtl .elfinder-cwd-view-icons .elfinder-cwd-file { float:right; margin:0 0 3px 3px; } +.elfinder-ltr .elfinder-cwd-view-icons .elfinder-cwd-file { float:left; margin:0 3px 12px 0; } +.elfinder-rtl .elfinder-cwd-view-icons .elfinder-cwd-file { float:right; margin:0 0 5px 3px; } /* remove ui hover class border */ .elfinder-cwd-view-icons .elfinder-cwd-file .ui-state-hover { border:0 solid; } diff --git a/js/elFinder.js b/js/elFinder.js index e21ccf32f..3fbc3043b 100644 --- a/js/elFinder.js +++ b/js/elFinder.js @@ -2504,17 +2504,21 @@ elFinder.prototype = { * @return String */ formatSize : function(s) { - var n = 1, u = 'bytes'; + var n = 1, u = 'b'; + + if (s == 'unknown') { + return this.i18n('unknown'); + } if (s > 1073741824) { n = 1073741824; - u = 'Gb'; + u = 'GB'; } else if (s > 1048576) { n = 1048576; - u = 'Mb'; + u = 'MB'; } else if (s > 1024) { n = 1024; - u = 'Kb'; + u = 'KB'; } return (s > 0 ? Math.round(s/n) : 0) +' '+u; }, diff --git a/js/ui/stat.js b/js/ui/stat.js index cca268349..cbf40eae7 100644 --- a/js/ui/stat.js +++ b/js/ui/stat.js @@ -36,9 +36,17 @@ $.fn.elfinderstat = function(fm) { }) .select(function() { var s = 0, - c = 0; + c = 0, + files = fm.selectedFiles(); - $.each(fm.selectedFiles(), function(i, file) { + if (files.length == 1) { + s = files[0].size; + sel.html(fm.escape(files[0].name)+(s > 0 ? ', '+fm.formatSize(s) : '')); + + return; + } + + $.each(files, function(i, file) { c++; s += parseInt(file.size)||0; }); diff --git a/php/connector.php b/php/connector.php index f1c526259..1dc6139e5 100644 --- a/php/connector.php +++ b/php/connector.php @@ -207,7 +207,11 @@ $opts = array( 'utf8fix' => false, 'acceptedName' => '/[a-z0-9_\-]+/i', 'attributes' => array( - + array( + 'pattern' => '/1\.tiff$/', + 'read' => false, + 'write' => false + ) ), ), array( diff --git a/php/elFinderVolumeDriver.class.php b/php/elFinderVolumeDriver.class.php index 402cdbffe..0022072cc 100644 --- a/php/elFinderVolumeDriver.class.php +++ b/php/elFinderVolumeDriver.class.php @@ -1796,29 +1796,34 @@ abstract class elFinderVolumeDriver { if ($link) { $stat = $this->_lstat($path); - $file['size'] = $stat['size']; - $file['date'] = $this->formatDate($stat['mtime']); - } else { - $file['size'] = $dir ? 0 : $this->_filesize($path); - $file['date'] = $this->formatDate($this->_filemtime($path)); - } - - if ($link) { + $file['date'] = $this->formatDate($stat['mtime']); + if (($target = $this->_readlink($path)) != false) { $file['mime'] = $this->mimetype($target); $file['alias'] = $this->_path($target); $file['read'] = (int)$this->attr($path, 'read'); $file['write'] = (int)$this->attr($path, 'write'); + $file['size'] = $stat['size']; } else { $file['mime'] = 'symlink-broken'; $file['read'] = 0; $file['write'] = 0; } + } else { $file['mime'] = $dir ? 'directory' : $this->mimetype($path); + // $file['size'] = $dir ? 0 : $this->_filesize($path); + $file['date'] = $this->formatDate($this->_filemtime($path)); $file['read'] = (int)$this->attr($path, 'read'); $file['write'] = (int)$this->attr($path, 'write'); + if (!$file['read']) { + $file['size'] = 'unknown'; + } elseif ($dir) { + $file['size'] = 0; + } else { + $file['size'] = $this->_filesize($path); + } } if ($this->attr($path, 'locked')) {