FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=9750&edit=1

ID: 9750
Updated by: demon.gene@gmail.com
Reported By: riku dot tuominen at benchmarking dot fi
Summary: Using "kriesing" tree type the "nodeOptions"
paramether is not working.
Status: Open
Type: Bug
Package: HTML_TreeMenu
Operating System: XP
Package Version: 1.2.0
PHP Version: Irrelevant
-Roadmap Versions: 1.2.2
+Roadmap Versions:
New Comment:

-Roadmap Versions: 1.2.2
+Roadmap Versions:



Previous Comments:
------------------------------------------------------------------------

[2008-11-09 03:03:46] doconnor

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.

------------------------------------------------------------------------

[2007-01-05 14:31:07] riku dot tuominen at benchmarking dot fi

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.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 27, '11 at 7:20p
activeSep 27, '11 at 7:20p
posts1
users1
websitepear.php.net

1 user in discussion

Demon Gene: 1 post

People

Translate

site design / logo © 2022 Grokbase