mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2009-03-17 Esteban Sanchez <estebans@artica.es>
* 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
This commit is contained in:
parent
a1546eaf9f
commit
9433df0195
@ -1,3 +1,10 @@
|
|||||||
|
2009-03-17 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
|
* 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 <jorgegonz@svn.gnome.org>
|
2009-03-17 Jorge Gonzalez <jorgegonz@svn.gnome.org>
|
||||||
|
|
||||||
* include/languages/es.po, include/languages/es.mo: Updated Spanish
|
* include/languages/es.po, include/languages/es.mo: Updated Spanish
|
||||||
|
@ -48,7 +48,7 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing =
|
|||||||
$idcounter[$name] = 0;
|
$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 = "";
|
$attributes = "";
|
||||||
if (!empty ($script)) {
|
if (!empty ($script)) {
|
||||||
@ -74,7 +74,6 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing =
|
|||||||
if ($nothing_value == $selected) {
|
if ($nothing_value == $selected) {
|
||||||
$output .= ' selected="selected"';
|
$output .= ' selected="selected"';
|
||||||
}
|
}
|
||||||
//You should pass a translated string already
|
|
||||||
$output .= '>'.$nothing.'</option>';
|
$output .= '>'.$nothing.'</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,9 +85,11 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing =
|
|||||||
$output .= '<option value="'.$value.'"';
|
$output .= '<option value="'.$value.'"';
|
||||||
if (is_array ($selected) && in_array ($value, $selected)) {
|
if (is_array ($selected) && in_array ($value, $selected)) {
|
||||||
$output .= ' selected="selected"';
|
$output .= ' selected="selected"';
|
||||||
} elseif (is_numeric ($value) && is_numeric ($selected) && $value == $selected) { //This fixes string ($value) to int ($selected) comparisons
|
} elseif (is_numeric ($value) && is_numeric ($selected) && $value == $selected) {
|
||||||
|
//This fixes string ($value) to int ($selected) comparisons
|
||||||
$output .= ' selected="selected"';
|
$output .= ' selected="selected"';
|
||||||
} elseif ($value === $selected) { //Needs type comparison otherwise if $selected = 0 and $value = "string" this would evaluate to true
|
} elseif ($value === $selected) {
|
||||||
|
//Needs type comparison otherwise if $selected = 0 and $value = "string" this would evaluate to true
|
||||||
$output .= ' selected="selected"';
|
$output .= ' selected="selected"';
|
||||||
}
|
}
|
||||||
if ($label === '') {
|
if ($label === '') {
|
||||||
@ -191,7 +192,9 @@ function print_input_text_extended ($name, $value, $id, $alt, $size, $maxlength,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Attributes specified by function call
|
//Attributes specified by function call
|
||||||
$attrs = array ("name" => "unnamed", "value" => "", "id" => "text-".sprintf ('%04d', $idcounter), "size" => "", "maxlength" => "");
|
$attrs = array ("name" => "unnamed", "value" => "",
|
||||||
|
"id" => "text-".sprintf ('%04d', $idcounter),
|
||||||
|
"size" => "", "maxlength" => "");
|
||||||
|
|
||||||
foreach ($attrs as $attribute => $default) {
|
foreach ($attrs as $attribute => $default) {
|
||||||
if (array_key_exists ($attribute, $attributes)) {
|
if (array_key_exists ($attribute, $attributes)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user