$nb = array(); if (isset($tree->data['id'])) { foreach ($tree->branchs as &$branch) { if ($branch !== false && fillInfo($branch, $core, $path . $tree->data['id'] . '/')) { $nb[] = $branch; } } } $tree->branchs = $nb; return true; } $newTree = new ttree(); if (!is_dir(CONS_FMANAGER)) { makeDirs(CONS_FMANAGER); } $newTree->getFolderTree(CONS_FMANAGER, false, $dir, "", array("_thumbs", "_undodata")); // thumbs is the fckfinder folder fillInfo($newTree, $core); $core->template->getTreeTemplate("_dirs", "_subdirs", $newTree, "/", "/"); if ($dir == "") { $dir = "/"; } $canEdit = $this->canEdit($dir); if (isset($core->storage['error']) || isset($core->storage['dir'])) { if (!isset($core->storage['dir'])) { $core->storage['dir'] = ""; } $core->template->assign('script', "<script type=\"text/javascript\">alert(\"" . $core->storage['error'] . "\");canChange=" . ($canEdit ? "true" : "false") . ";showFolder(\"" . $core->storage['dir'] . "\");</script>"); } else { $core->template->assign('script', "<script type=\"text/javascript\">canChange=" . ($canEdit ? "true" : "false") . ";showFolder(\"" . $dir . "\");</script>"); }