diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 7e8d24db273..890b529d0ff 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -178,10 +178,10 @@ if ($conf->use_javascript) { $newelement['expanded']=false; } -//print 'x'.$cate_arbo[$key]['fullpath'].' level='.$level.' expand='.$newelement['expanded'].'
'; } - $node[$cate_arbo[$key]['fullpath']]=$node[$nodeparent]->addItem(new HTML_TreeNode($newelement)); + //print 'x'.$cate_arbo[$key]['fullpath'].' ' expand='.$newelement['expanded'].'
'; + $node[$cate_arbo[$key]['fullpath']]=&$node[$nodeparent]->addItem(new HTML_TreeNode($newelement)); //print 'Resultat: noeud '.$cate_arbo[$key]['fullpath']." créé
\n"; } @@ -190,7 +190,15 @@ if ($conf->use_javascript) // Affiche arbre print ''; - $treeMenu = new HTML_TreeMenu_DHTML($menu, array('images' => DOL_URL_ROOT.'/includes/treemenu/images', 'defaultClass' => 'treeMenuDefault', false)); + $treeMenu = new HTML_TreeMenu_DHTML($menu, + array( + 'images' => DOL_URL_ROOT.'/includes/treemenu/images', + 'defaultClass' => 'treeMenuDefault', + 'noTopLevelImages' => false, + 'jsObjectName' => 'tree_categories', + 'usePersistence' => false + ), + true); $treeMenu->printMenu(); //$listBox = new HTML_TreeMenu_Listbox($menu, array('linkTarget' => '_self'));