diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index b4536901da3..f0ba051450c 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -318,7 +318,23 @@ if ($conf->use_javascript_ajax)
{
if (! empty($menu['langs'])) $langs->load($menu['langs']);
$titre = $langs->trans($menu['titre']);
- $data[] = array('rowid'=>$menu['rowid'],'fk_menu'=>$menu['fk_menu'],'title'=>$titre,'mainmenu'=>$menu['mainmenu'],'leftmenu'=>$menu['leftmenu'],'fk_mainmenu'=>$menu['fk_mainmenu'],'fk_leftmenu'=>$menu['fk_leftmenu']);
+ $data[] = array(
+ 'rowid'=>$menu['rowid'],
+ 'fk_menu'=>$menu['fk_menu'],
+ 'title'=>$titre,
+ 'mainmenu'=>$menu['mainmenu'],
+ 'leftmenu'=>$menu['leftmenu'],
+ 'fk_mainmenu'=>$menu['fk_mainmenu'],
+ 'fk_leftmenu'=>$menu['fk_leftmenu'],
+ 'entry'=>'
'
+ );
$i++;
}
}
diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php
index 2e6671f4550..65b2ca5d502 100644
--- a/htdocs/core/lib/treeview.lib.php
+++ b/htdocs/core/lib/treeview.lib.php
@@ -145,56 +145,30 @@ function tree_showpad(&$fulltree,$key,$silent=0)
// ------------------------------- Used by menu editor -----------------
/**
- * Show an element with correct offset
- *
- * @param array $tab Array of element
- * @param int $rang Level of offset
- * @return void
- */
-function tree_showline($tab,$rang)
-{
- global $conf, $rangLast, $idLast, $menu_handler;
-
- // Content of line
- print '';
-
- $rangLast = $rang;
- $idLast = $tab['rowid'];
-}
-
-
-/**
- * Recursive function to output menu tree
+ * Recursive function to output menu tree.
*
* @param array $tab Array of all elements
* @param int $pere Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>)
* @param int $rang Level of element
* @return void
*/
-function tree_recur($tab,$pere,$rang)
+function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree')
{
if (empty($pere['rowid']))
{
// Test also done with jstree and dynatree (not able to have inside label)
print '';
- print '';
+ print '';
}
if ($rang > 10) return; // Protection contre boucle infinie
@@ -210,9 +184,7 @@ function tree_recur($tab,$pere,$rang)
{
if (empty($ulprinted) && ! empty($pere['rowid'])) { print ''; $ulprinted++; }
print "\n".'- ';
- // We shot it with an offset
- tree_showline($tab[$x],$rang);
-
+ print $tab[$x]['entry'];
// And now we search all its sons of lower level
tree_recur($tab,$tab[$x],$rang+1);
print '
';
@@ -221,9 +193,7 @@ function tree_recur($tab,$pere,$rang)
{
if (empty($ulprinted) && ! empty($pere['rowid'])) { print ''; $ulprinted++; }
print "\n".'- ';
- // We shot it with an offset
- tree_showline($tab[$x],$rang);
-
+ print $tab[$x]['entry'];
// And now we search all its sons of lower level
tree_recur($tab,$tab[$x],$rang+1);
print '
';