type = $type;
$this->content = $content;
$this->id = $id;
$this->icons = $icons;
}
function buildTree($class = NULL, $includeul = TRUE) {
$ret = '';
if ($includeul)
$ret .= '
id != NULL ? 'id="'. $this->id .'"' : '') . ($class != NULL ? 'class="'. $class .'"' : '') .'>';
$ret .= '- ';
if ($this->type != NULL) {
$ret .='';
}
$ret .= $this->content;
if ($this->type != NULL) {
$ret .= '';
}
$ret .= $this->icons;
if (count($this->children) > 0) {
if ($includeul)
$ret .= '
';
else
$ret .= 'id != NULL ? 'id="' . $this->id .'"' : '') .'>';
foreach ($this->children as $tree) {
$ret .= $tree->buildTree(NULL, FALSE);
}
$ret .= '
';
}
$ret .= '
';
if ($includeul)
$ret .= '
';
return $ret;
}
function addChild($content, $type = 'file', $icons = NULL, $id = NULL) {
$tree = (is_object($content) && get_class($content) == 'treeview') ? $content : new treeview($content, $type, $icons, $id);
$this->children[] = $tree;
return $tree;
}
}