From 9433df0195ca9ea42f6c37c8916f58ec2df59cbd Mon Sep 17 00:00:00 2001 From: esanchezm Date: Tue, 17 Mar 2009 11:19:36 +0000 Subject: [PATCH] 2009-03-17 Esteban Sanchez * include/functions_html.php: Do not add id counter if it's 0 on print_select. It's a backwards compatibility workaround until we take a decision on correct HTML elements. Fixed comment styles, please do not add comments in the same line. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++ pandora_console/include/functions_html.php | 33 ++++++++++++---------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f57530ff19..fe22bbf9d8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-03-17 Esteban Sanchez + + * include/functions_html.php: Do not add id counter if it's 0 on + print_select. It's a backwards compatibility workaround until we + take a decision on correct HTML elements. Fixed comment styles, please + do not add comments in the same line. + 2009-03-17 Jorge Gonzalez * include/languages/es.po, include/languages/es.mo: Updated Spanish diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 3dfe945bba..b85a3def4a 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -48,8 +48,8 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing = $idcounter[$name] = 0; } - $id = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.$idcounter[$name]); - + $id = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : '')); + $attributes = ""; if (!empty ($script)) { $attributes .= ' onchange="'.$script.'"'; @@ -74,7 +74,6 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing = if ($nothing_value == $selected) { $output .= ' selected="selected"'; } - //You should pass a translated string already $output .= '>'.$nothing.''; } @@ -86,9 +85,11 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing = $output .= '