Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.2

Bug #9750 Using "kriesing" tree type the "nodeOptions" paramether is not working.
Submitted: 2007-01-05 19:31 UTC
From: riku dot tuominen at benchmarking dot fi Assigned:
Status: Open Package: HTML_TreeMenu (version 1.2.0)
PHP Version: Irrelevant OS: XP
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2011-09-28 01:21 UTC
Package:
Bug Type:
Summary:
From: riku dot tuominen at benchmarking dot fi
New email:
PHP Version: Package Version: OS:

 

 [2007-01-05 19:31 UTC] riku dot tuominen at benchmarking dot fi (Riku Tuominen)
Description: ------------ TO FIX THE PROBLEM CHANGE ONE LINE OF CODE IN TreeMenu.php FILE. CHANGE line 168 $thisNode = &$curNode[$aNode['level']]->addItem( new HTML_TreeNode( $data , $events ) ); WITH $thisNode = &$curNode[$aNode['level']]->addItem( new HTML_TreeNode( array_merge($params['nodeOptions'], $data) , $events ) ); Test script: --------------- require_once 'Tree/Tree.php'; require_once 'Tree/Memory.php'; require_once 'HTML/TreeMenu.php'; $dbDsn = 'mysql://XXXX:XXXX@XXXX/testdB'; $options = array ('order' => 'name', 'table' => 'mytree'); $tree = Tree :: setup('Memory_DBnested', $dbDsn, $options); $tree->setup(); $nodeOptions = array( 'text' => '', 'link' => 'editCategory.php?id=', 'icon' => 'folder.gif', 'expandedIcon' => 'folder-expanded.gif', 'class' => '', 'expanded' => false, 'linkTarget' => '_self', 'isDynamic' => 'true', 'ensureVisible' => '', ); $options = array('structure' => $tree, 'type' => 'kriesing', 'nodeOptions' => $nodeOptions); $menu = &HTML_TreeMenu::createFromStructure($options); // Chose a generator. You can generate DHTML or a Listbox $treeMenu = &new HTML_TreeMenu_DHTML($menu, array('images' => 'images', 'defaultClass' => 'treeMenuDefault')); echo $treeMenu->toHTML(); Expected result: ---------------- The nodes should have a folder icon and node name be a link, but that is not hapenning. Non of "nodeOptions" setting is in effect. Actual result: -------------- The nodes should have a folder icon and node name be a link, but that is not hapenning. Non of "nodeOptions" setting is in effect.

Comments

 [2008-11-09 08:03 UTC] doconnor (Daniel O'Connor)
Hey Chuck, with your test in CVS; any chance of making a setup file or avoiding using a database? IE, test_bug9750 does: $dbDsn = 'mysql://USER:PSWD@HOST/DBNAME'; $options = array ('order' => 'name', 'table' => 'mytree'); $tree = Tree::setup('Memory_DBnested', $dbDsn, $options); $tree->setup(); ... which is a pain to set up in unit tests.
 [2011-09-28 01:21 UTC] ashnazg (Chuck Burgess)
-Roadmap Versions: 1.2.2 +Roadmap Versions: