Re: HTML_TreeMenu-1.1.3 (stable) Released question

From: Date: Thu, 20 Feb 2003 17:06:45 +0000
Subject: Re: HTML_TreeMenu-1.1.3 (stable) Released question
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13507@lists.php.net to get a copy of this message
Hi Richard (apologies for the long post in advance), Great work on this latest version of HTML_TreeMenu. I've tried to generate the dhtml menu, however and found the docs a bit confusing. In your docs (word and inline code) you mention how to instantiate the class statically:
    * $treeMenu = &HTML_TreeMenu::import($myTreeStructureObj);
however HTML_TreeMenu does not contain a method import(). I'm guessing you were referring to your createFromStructure($params) method however this method takes a hash as argument, not the object '$myTreeStructureObj' you mention. I used the code below and it seems the class half-worked, however I'm unclear about the 3rd element of the assoc. array argument to createFromStructure($params) . Is it because I'm missing $nodeOptions I get a blank page, what do you mean by 'Default options for each node' in the description. In the example below all the paths are right and the $tree object is successfully loaded from the database, any ideas where the problem might be? cheers, Demian <?php include './Tree.php';
$tree = &Tree::createFromMySQL(array('host'     => 'localhost',
                                     'user'     => 'root',
                                     'pass'     => '',
                                     'database' => 'parcelnumber',
                                     'query'    => 'SELECT id, parent, name FROM cattest ORDER BY parent, id'));
include './TreeMenu.php'; $options = array( 'structure' => $tree, 'type' => 'heyes'); $menu = &HTML_TreeMenu::createFromStructure($options); $treeMenu = &new HTML_TreeMenu_DHTML($menu, array('images' => './imagesAlt2', 'defaultClass' => 'treeMenuDefault')); ?> <html> <head> <style type="text/css"> .treeMenuDefault { font-style: italic; } </style> <script src="TreeMenu.js" language="JavaScript" type="text/javascript"></script> </head> <body> <?$treeMenu->printMenu()?> </body> </html> PEAR Announce wrote:
The new PEAR package HTML_TreeMenu-1.1.3 (stable) has been released at http://pear.php.net/. Release notes ------------- Added expanded icon support. Added documentation in Word and PDF formats. Moved structure import code to its own static method createFromStructure(), and added support for my own Tree class (http://phpguru.org/tree.html) as well as Wolfram Kriesings Tree class. Package Info ------------- PHP Based api creates a tree structure using a couple of small PHP classes. This can then be converted to javascript using the printMenu() method. The tree is dynamic in IE 4 or higher and NN6/Mozilla, and maintains state (the collapsed/expanded status of the branches) by using cookies. Other browsers display the tree fully expanded. Each node can have an optional link and icon. New API in 1.1 with many changes (see CVS for changelog) and new features, of which most came from Chip Chapin (http://www.chipchapin.com). Related Links ------------- Package home: http://pear.php.net/package-info.php?package=HTML_TreeMenu Changelog: http://pear.php.net/package-changelog.php?package=HTML_TreeMenu
    Download: http://pear.php.net/get/HTML_TreeMenu-1.1.3.tgz
Authors ------------- Richard Heyes <richard@phpguru.org> (lead)


« previous php.pear.dev (#13507) next »