diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 5779558e722..041226a8131 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -218,16 +218,27 @@ foreach ($fulltree as $key => $val) { } -//print_barre_liste('', 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, 0, '', 0, $newcardbutton, '', 0, 1, 1); +$nbofentries = (count($data) - 1); -print ''; +$morethan1level = 0; +foreach($data as $record) { + if (!empty($record['fk_menu'])) { + $morethan1level = 1; + } +} + + +print '
'; print ''; -$nbofentries = (count($data) - 1); if ($nbofentries > 0) { print '
'.$langs->trans("Categories").''; -if (!empty($conf->use_javascript_ajax)) { - print ''; +if ($morethan1level && !empty($conf->use_javascript_ajax)) { + print ''; } print '
'; tree_recur($data, $data[0], 0);