diff options
author | imoore76 <imoore76@users.noreply.github.com> | 2015-12-07 08:49:21 -0500 |
---|---|---|
committer | imoore76 <imoore76@users.noreply.github.com> | 2015-12-07 08:49:21 -0500 |
commit | b2711b1bccc38d52214288c2a40232ddb67efb24 (patch) | |
tree | f8f34e40932b5bcc0de78d4a1a3b31d38b6b0ebe /endpoints/jqueryFileTree.php | |
parent | 148f49edf5e2c2877826e383f531a92de99e96e4 (diff) | |
parent | 95a7c068d1e71ea62cb35210f4c205158ca71109 (diff) | |
download | phpvirtualbox-b2711b1bccc38d52214288c2a40232ddb67efb24.zip phpvirtualbox-b2711b1bccc38d52214288c2a40232ddb67efb24.tar.gz phpvirtualbox-b2711b1bccc38d52214288c2a40232ddb67efb24.tar.bz2 |
Merge pull request #11 from imoore76/develop
5.0-4 from develop
Diffstat (limited to 'endpoints/jqueryFileTree.php')
-rw-r--r-- | endpoints/jqueryFileTree.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/endpoints/jqueryFileTree.php b/endpoints/jqueryFileTree.php index 016a29d..7c88428 100644 --- a/endpoints/jqueryFileTree.php +++ b/endpoints/jqueryFileTree.php @@ -172,17 +172,24 @@ if($request['dir'] == DSEP && count($allowed_folders)) { */
if((strtoupper($request['dir']) != strtoupper($f)) && strpos(strtoupper($request['dir']),strtoupper($f)) === 0) {
-
// List entries in this folder
- $path = explode(DSEP,substr($request['dir'],strlen($f)));
+ $path = explode(DSEP, substr($request['dir'],strlen($f)));
- // Folder entry
- array_push($returnData, getdir($f, $request['dirsOnly'], $path));
+ if($path[0] == '') {
+ array_shift($path);
+ }
- } else {
+ $folder_entry = folder_entry($f, true);
+
+ $folder_entry['children'] = getdir($f, $request['dirsOnly'], $path);
+ $folder_entry['expanded'] = true;
+ array_push($returnData, $folder_entry);
+
+ } else {
array_push($returnData, folder_entry($f,true));
}
+
}
/* Just get full path */
|