diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 4d333523ea838d9eae8c1c208fefaa6ce8565881..ce31fa22bb0ebd543e7491ce38ab97706f70ab14 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -991,23 +991,24 @@ class Form $cat = new Categorie ($this -> db); $cat->get_categories_arbo(); $cate_arbo = $cat->get_arbo_each_cate(); - $output= '<select name="'.$select_name.'">'; //creation des categories meres + $output = '<select name="'.$select_name.'">'; //creation des categories meres $output.= '<option value="-1" id="choix">'.$langs->trans("NoneCategory").'</option>\n'; - - foreach($cate_arbo as $key => $value) + if ($cate_arbo) { - if($value[1] == $selected) - $add = "selected='true' "; - else - $add = ""; - $output.= '<option '.$add.'value="'.$value[1].'">'.$value[0].'</option>'; + foreach($cate_arbo as $key => $value) + { + if($value[1] == $selected) + $add = "selected='true' "; + else + $add = ""; + $output.= '<option '.$add.'value="'.$value[1].'">'.$value[0].'</option>'; + } } - + $output.= '</select>'; - return $output; - - } + return $output; + }