*/
function node($id,$key=array("id","pid","text","link")) {
$ar = $this->filter($id,$key);
if(($n = count($ar)) == 0) return "";
$块 = "";
foreach($ar as $value) {
$n--;
$p = sign($value[node_childs]);
$可见 = "none";//"block";
$标识 = $p==0 ? $p : $p+$n;
$主图标 = "<img src=../../\"{$this->images[$p][sign($n)]}\">";
$副图标 = empty($this->images[$p][2]) ? "" : "<img src=../../\"{$this->images[$p][2]}\">";
$文字 = empty($value[$key[3]]) ? $value[$key[2]] : "<a href=../../\"{$value[$key[3]]}\">{$value[$key[2]]}</a>";
$连线 = $this->images[3][sign($n)];
$编号 = $value[id];
$子树 = $this->all ? $this->node($value[$key[0]],$key) : $this->bond[$p];
$块 .= eval("return \"".AddSlashes($this->block)."\";");
}
return eval("return \"\n".AddSlashes($this->tpl)."\";");
}
/**
* build方法
* 功能 计算各节点的一级子节点数,用附加的node_childs表示
*/
function build($key=array("id","pid"
function node($id,$key=array("id","pid","text","link")) {
$ar = $this->filter($id,$key);
if(($n = count($ar)) == 0) return "";
$块 = "";
foreach($ar as $value) {
$n--;
$p = sign($value[node_childs]);
$可见 = "none";//"block";
$标识 = $p==0 ? $p : $p+$n;
$主图标 = "<img src=../../\"{$this->images[$p][sign($n)]}\">";
$副图标 = empty($this->images[$p][2]) ? "" : "<img src=../../\"{$this->images[$p][2]}\">";
$文字 = empty($value[$key[3]]) ? $value[$key[2]] : "<a href=../../\"{$value[$key[3]]}\">{$value[$key[2]]}</a>";
$连线 = $this->images[3][sign($n)];
$编号 = $value[id];
$子树 = $this->all ? $this->node($value[$key[0]],$key) : $this->bond[$p];
$块 .= eval("return \"".AddSlashes($this->block)."\";");
}
return eval("return \"\n".AddSlashes($this->tpl)."\";");
}
/**
* build方法
* 功能 计算各节点的一级子节点数,用附加的node_childs表示
*/
function build($key=array("id","pid"
| 对此文章发表了评论 |
