<?php
## +---------------------------------------------------------------------------+
## | 1. Creating & Calling: |
## +---------------------------------------------------------------------------+
## *** define a relative (virtual) path to treemenu.class.php file
define ('TREEMENU_DIR', '');
## *** include TreeMenu class
require_once(TREEMENU_DIR.'treemenu.class.php');
## *** create TreeMenu object
$treeMenu = new TreeMenu();
## +---------------------------------------------------------------------------+
## | 2. General Settings: |
## +---------------------------------------------------------------------------+
## *** set unique identifier for TreeMenu
## *** (if you want to use several independently configured TreeMenu objects on single page)
$treeMenu->SetId(1);
## *** set style for TreeMenu
## *** "default" or "xp" or "vista" or "paneled" or your own style
$treeMenu->SetStyle('paneled');
## *** set TreeMenu caption
$treeMenu->SetCaption('ApPHP TreeMenu v'.$treeMenu->Version());
## *** show debug info - false|true
## +---------------------------------------------------------------------------+
## | 3. Adding nodes: |
## +---------------------------------------------------------------------------+
## *** add nodes
## arguments:
## arg #1 - node's caption
## arg #2 - file associated with this node (optional)
## arg #3 - icon associated with this node (optional)
## Example 1: $treeMenu->AddNode('Title');
## Example 2: $treeMenu->AddNode('Title', 'text.txt');
## Example 3: $treeMenu->AddNode('Title', 'text.txt', 'icon.gif');
$root = $treeMenu->AddNode('Title');
$son = $root->AddNode("Son's Title");
$second = $root->AddNode("2nd son's Title", "index.html");
## +---------------------------------------------------------------------------+
## | 5. Draw TreeMenu: |
## +---------------------------------------------------------------------------+
$treeMenu->ShowTree();
$treeMenu->ShowContent();
?>