Home >Backend Development >PHP Tutorial >xzn_html_tree1.0 collapsible outline_PHP tutorial

xzn_html_tree1.0 collapsible outline_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 17:24:36874browse

/** 可折叠大纲 * 类名 Tree * 存放位置 xzn/html/tree.php */ /** 节点类 * 用于在树中保存相关参数 * * @param $id 节点号 * @param $text 节点标题 * @param $value 节点参数,一般为url * @param $image 节点图片 */ class TreeNode { var $id; var $text; var $value; var $image; function TreeNode($id,$text,$value,$image) { $this->id = $id; $this->text = $text; $this->value = $value; $this->image = $image; } } /**Tree class * Used to save and output the collapsible outline * The collapsible outline uses JavaScript script of FrontPage 2000 * * Method * set() * Set the node, the node number is in the form of 1.2.3.4 or 1-2-3-4. * No level restrictions. The input order is not limited. * @param $id Node number* @param $text Node title* @param $value Node parameter, usually url * @param $image Node picture* * display() * Output collapsible outline to the page* * Attributes* @public $node array, used to save nodes* @public $jspath script outline.js storage location*/ class Tree { var $node; var $jspath; function set($id,$text,$value="",$image="plus.gif") { $d = split("[.-]",$id); $e = ""; for($i=0;$inode$e;"); $p[node] = $n; } function display() { echo ." "; echo ." "; echo ." "; echo ." "; ksort($this->node); reset($this->node); while(list($key,$value) = each($this->node)) { $this->next($value,0); } echo " "; } function next($node,$level) { if(! is_array($node)) return; if(isset($node[node])) { // echo $level.",".$node[node]->id.",".$node[node]->text.",".$node[node]->value.",".$node[node]->image." "; echo ." "; echo xzn_html_tree1.0 collapsible outline_PHP tutorialimage.">." "; echo ; if(empty($node[node]->value)) echo $node[node]->text." "; else echo value.">.$node[node]->text." "; echo ." "; } if(count($node) == 1) { echo " "; return; } ksort($node); reset($node); while(list($key,$value) = each($node)) { $this->next($value,$level+1); } echo " "; } } ?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/532135.htmlTechArticleid = $id; $this->text = $text; $this->value = $value; $this->image = $image; } } /** 树类 * 用于保存和输出可折叠大纲 * 可折叠大纲使用FrontPage 2000的JavaScrip...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn