diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 94089d3724..d9e1028e12 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-06-23 Sergio Martin + + * include/functions_html.php: Added a parameter into + print_select function to set style a selective + options into the select form control + 2010-06-23 Sergio Martin * include/auth/mysql.php diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 4a55127998..225ef92b49 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -160,10 +160,10 @@ function print_select_style ($fields, $name, $selected = '', $style='', $script * @return string HTML code if return parameter is true. */ function print_select ($fields, $name, $selected = '', $script = '', $nothing = '', $nothing_value = 0, $return = false, - $multiple = false, $sort = true, $class = '', $disabled = false, $style = false) { + $multiple = false, $sort = true, $class = '', $disabled = false, $style = false, $option_style = false) { $output = "\n"; - + static $idcounter = array (); //If duplicate names exist, it will start numbering. Otherwise it won't @@ -224,6 +224,9 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing = //Needs type comparison otherwise if $selected = 0 and $value = "string" this would evaluate to true $output .= ' selected="selected"'; } + if (is_array ($option_style) && in_array ($value, array_keys($option_style))) { + $output .= ' style="'.$option_style[$value].'"'; + } if ($label === '') { $output .= '>'.$value.""; } else {