From fdf807d6332a1085646c9a51816370234e5dba49 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 23 Jun 2010 11:31:44 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2921 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_html.php | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) 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 {