Id = $ id; $ this-> text = $ text; $ this-> value = $ value; $ this-> image = $ image ;}} /** tree class * is used to save and output the foldable outline * The foldable outline uses the JavaScript script of FrontPage 2000 ** method ** set () * to set the node, the node number must be 1.2.3.4 or 1-2-4-4. * No hierarchy restriction. The input order is not limited. * @ Param $ id node number * @ param $ text node title * @ param $ value node parameter, which is generally url * @ param $ image node image ** display () * outputs the foldable outline ** attribute * @ public $ node array to the page to save the node * @ 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; $ I Node $ 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 image. ">. ""; 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) = e Ach ($ node) {$ this-> next ($ value, $ level + 1);} echo "" ;}}}?>