Xzn_html_tree1.0 foldable outline

Source: Internet
Author: User

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 "" ;}}}?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.