<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>ApPHP TreeMenu :: Code Template</title>
</head>
<body>
This is a code template (it's commented out now).<br />
To run it you have to uncomment appropriate lines of code and define some important settings.<br /><br />
<a href="docs/GettingStarted.html">Learn here</a> how to do it.
<?php
    /***
     * Uncomment all needed lines of the code
     * ---------------------
     * NOTE: We use
     *   ## as comments
     *   // as lines, that must be uncommented
     *   /// as lines, that may be uncommented (optional)
    */

    /***
     * Common notes
     * ---------------------
     *  1. Please, use a $treeMenu->Debug(true); before you say 'Why Nothing Works ?!'
     *  2. Do not put TreeMenu code into another HTML form: <form>...</form>
     *  3. Be careful when using the names of fields they may be case sensitive!
    */

    ## +---------------------------------------------------------------------------+
    ## | 1. Creating & Calling:                                                    |
    ## +---------------------------------------------------------------------------+
    ## *** define a relative (virtual) path to treemenu.class.php file
    // define ('TREEMENU_DIR', '');                  /* Ex.: 'treemenu/' */
    ## *** 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
    /// $treeMenu->Debug(false);
    ## *** set postback method: "get", "post" or "ajax"
    // $treeMenu->SetPostBackMethod('ajax');
    ## *** set variables that used to get access to the page (like: my_page.php?act=34&id=56 etc.)
    /// $treeMenu->SetHttpVars(array('id'));
    ## *** show number of subnodes to the left of every node - false|true
    /// $treeMenu->ShowNumSubNodes(false);
    ## *** show 'expand all' and 'collapse all' buttons - false|true
    /// $treeMenu->ShowExpandCollapseAllButtons(false);
    ## *** set effect for expanding/collapsing nodes - none|slow|normal|fast|integer number - delay in ms
    /// $treeMenu->SetAnimationEffect("normal");
    ## *** use an anchor to navigate to treemenu object after a node is clicked - true|false
    /// $treeMenu->UseAnchor(false);
    ## *** create the anchor automatically - true|false
    /// $treeMenu->CreateAnchorAuto(false);
    ## *** if the CreateAnchorAuto is set to true you have to create the anchor manually - place at the top of your page
    /// <a name='treemenu'></a> 	
    ## *** set TreeMenu direction: ltr - left-to-right or rtl - right-to-left
    /// $treeMenu->SetDirection('ltr');

    ## +---------------------------------------------------------------------------+
    ## | 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');

    ## *** associate a tab with HTML code snippet:
    /// $son->SetInnerHTML('<b><i><span onclick="alert(\'How do you do?\')">HTML</span></i> code snippet</b>');
    ## *** open a node in a new window
    /// $second->OpenNewWindow(true);
    ## *** set a tooltip for a node
    /// $son->SetTooltip('Son tab\'s tooltip');
    ## *** sort node's subnodes by name (recursively - true|false)
    /// $root->SortByName(true);
    ## *** set sub-node which will be selected by default when you click on a node
    /// $root->SetDefaultNode($son);

    ## +---------------------------------------------------------------------------+
    ## | 4. Building tree menu from contents of a folder:                                                          |
    ## +---------------------------------------------------------------------------+
    ## *** build a tree menu from contents of a folder
    /// $treeMenu->BuildFromFolder('styles');
    ## *** use default icons for folder nodes - false|true
    /// $treeMenu->UseDefaultFolderIcons(false);
    ## *** use default icons for file nodes - false|true
    /// $treeMenu->UseDefaultFileIcons(false);

    ## +---------------------------------------------------------------------------+
    ## | 5. Draw TreeMenu:                                                      |
    ## +---------------------------------------------------------------------------+
    // $treeMenu->ShowTree();
    // $treeMenu->ShowContent();
?>
</body>
</html>