From af3584c3909deb2be4df7b4bf8577c6e5aecf93b Mon Sep 17 00:00:00 2001 From: "Dmitry (dio) Levashov" Date: Tue, 5 Jul 2011 18:12:09 +0400 Subject: [PATCH] fix some issues with symlinks --- js/ui/tree.js | 2 +- php/elFinder.class.php | 16 ++++++++-------- php/elFinderVolumeDriver.class.php | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/js/ui/tree.js b/js/ui/tree.js index 984e6286e..bb1ae040e 100644 --- a/js/ui/tree.js +++ b/js/ui/tree.js @@ -157,7 +157,7 @@ $.fn.elfindertree = function(fm, opts) { */ replace = { id : function(dir) { return fm.navHash2Id(dir.hash) }, - cssclass : function(dir) { return (dir.phash ? '' : root)+' '+navdir+' '+fm.perms2class(dir)+' '+(dir.dirs ? collapsed : ''); }, + cssclass : function(dir) { return (dir.phash ? '' : root)+' '+navdir+' '+fm.perms2class(dir)+' '+(dir.dirs && !dir.link ? collapsed : ''); }, permissions : function(dir) { return !dir.read || !dir.write ? ptpl : ''; }, symlink : function(dir) { return dir.link ? stpl : ''; } }, diff --git a/php/elFinder.class.php b/php/elFinder.class.php index 1f91beb00..0cef602f9 100644 --- a/php/elFinder.class.php +++ b/php/elFinder.class.php @@ -403,7 +403,6 @@ class elFinder { $init = !empty($args['init']); $tree = !empty($args['tree']); $volume = $this->volume($target); - // echo 'cwd
'; $cwd = $volume ? $volume->dir($target, false, true) : false; $hash = $init ? 'default folder' : '#'.$target; @@ -423,7 +422,7 @@ class elFinder { } $files = array(); - // echo 'tree
'; + // get folders trees if ($args['tree']) { foreach ($this->volumes as $id => $v) { @@ -432,7 +431,7 @@ class elFinder { } } } - // echo 'scandir
'; + // get current working directory files list and add to $files if not exists in it if (($ls = $volume->scandir($cwd['hash'], $args['mimes'])) === false) { return array('error' => $this->error(self::ERROR_OPEN, $cwd['name'], $volume->error())); @@ -637,7 +636,7 @@ class elFinder { $error = array(self::ERROR_MKDIR, $name); if (($volume = $this->volume($target)) == false - || ($dir = $volume->dir($target)) == false) { + || ($dir = $volume->dir($target, false, true)) == false) { return array('error' => $this->error($error, self::ERROR_TRGDIR_NOT_FOUND, '#'.$target)); } @@ -665,7 +664,7 @@ class elFinder { $error = array(self::ERROR_MKFILE, $name); if (($volume = $this->volume($target)) == false - || ($dir = $volume->dir($target)) == false) { + || ($dir = $volume->dir($target, false, true)) == false) { return array('error' => $this->error($error, self::ERROR_TRGDIR_NOT_FOUND, '#'.$target)); } @@ -913,10 +912,11 @@ class elFinder { } /** - * undocumented function + * Return file content * - * @return void - * @author Dmitry Levashov + * @param array $args command arguments + * @return array + * @author Dmitry (dio) Levashov **/ protected function get($args) { $target = $args['target']; diff --git a/php/elFinderVolumeDriver.class.php b/php/elFinderVolumeDriver.class.php index 9031ba370..d305595af 100644 --- a/php/elFinderVolumeDriver.class.php +++ b/php/elFinderVolumeDriver.class.php @@ -1377,7 +1377,7 @@ abstract class elFinderVolumeDriver { * @author Dmitry (dio) Levashov **/ public function save($fp, $dst, $name, $cmd='upload') { - if (($dir = $this->dir($dst, true)) == false) { + if (($dir = $this->dir($dst, true, true)) == false) { return $this->setError(elFinder::ERROR_TRGDIR_NOT_FOUND, '#'.$dst); } @@ -1825,7 +1825,7 @@ abstract class elFinderVolumeDriver { if ($file['read']) { if ($dir) { - if ($this->_subdirs($path)) { + if (!$link && $this->_subdirs($path)) { $file['dirs'] = 1; } } else {