diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 150b6e5a096..f695b65a842 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -95,37 +95,22 @@ if($_POST['catname']) { /* * Catégories principales */ -$cats = $c->get_main_categories (); - -if ($cats != -1) -{ - print ''; - print ''; +print '
'.$langs->trans("MainCats").'
'; + print ''; - foreach ($cats as $cat) - { - $i = !$i; - print "\t\n"; - print "\t\t\n"; - print "\t\t\n"; - - if ($cat->visible == 1) - { - print "\t\t\n"; - } - else - { - print "\t\t\n"; - } - - print "\t\n"; - } + $c->get_categories_arbo(); + $cate_arbo = $c->get_arbo_each_cate(); + + foreach($cate_arbo as $key => $value) + { + $i = !$i; + print "\t\n"; + print ''; + print "\t\n"; + } + + print "
'.$langs->trans("AllCats").'
".$cat->label."".$cat->description."".$langs->trans("ContentsVisibleByAllShort")."".$langs->trans("ContentsNotVisibleByAllShort")."
'.$value[0].'
"; -} -else -{ - dolibarr_print_error(); -} print '';