function folder_entry($f, $full = false, $expanded = false) { $f = str_replace(DSEP . DSEP, DSEP, $f); $selected = strnatcasecmp(rtrim($f, DSEP), rtrim($GLOBALS['request']['dir'], DSEP)) == 0 && $expanded; return array('expanded' => (bool) $expanded, 'selected' => (bool) $selected, 'path' => htmlentities($f, ENT_QUOTES), 'name' => htmlentities($full ? $f : vbox_basename($f), ENT_QUOTES), 'type' => 'folder', 'children' => array()); }
function folder_folder($f, $full = false, $expanded = false) { $selected = strnatcasecmp(rtrim($f, DSEP), rtrim($GLOBALS['vboxRequest']['dir'], DSEP)) == 0 && $expanded; echo "<li class=\"directory " . ($expanded ? 'expanded' : 'collapsed') . " vboxListItem\"><a href=\"#\" class='" . ($selected ? 'vboxListItemSelected' : '') . "' name='" . htmlentities($f, ENT_QUOTES) . "' rel=\"" . htmlentities($f, ENT_QUOTES) . "\">" . htmlentities($full ? $f : vbox_basename($f), ENT_QUOTES) . "</a>" . ($expanded ? '' : '</li>'); }