diff options
Diffstat (limited to 'template/default/htmlfunctions.inc.php')
-rw-r--r-- | template/default/htmlfunctions.inc.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/template/default/htmlfunctions.inc.php b/template/default/htmlfunctions.inc.php index cd4df188a..170defc46 100644 --- a/template/default/htmlfunctions.inc.php +++ b/template/default/htmlfunctions.inc.php @@ -232,4 +232,34 @@ function display_category( $category, $indent ) } } } + +function make_jumpbox($value, $selected, $usekeys=false) +{ + $boxstring = ''; + $nb = sizeof( $value); + $keys = ($usekeys?array_keys($value):$value); + $value = ($usekeys?array_values($value):$value); + for ( $i = 0; $i < $nb; $i++ ) + { + $boxstring .= '<option value="'.$keys[$i].'"'; + if ($selected == $keys[$i]) $boxstring .=' selected="selected"'; + $boxstring .='>'.$value[$i].'</option>'; + } + return $boxstring; +} + +function make_radio($name, $value, $selected, $usekeys=false) +{ + $boxstring = ''; + $nb = sizeof( $value); + $keys = ($usekeys?array_keys($value):$value); + $value = ($usekeys?array_values($value):$value); + for ( $i = 0; $i < $nb; $i++ ) + { + $boxstring .= '<input type="radio" name="'.$name.'" value="'.$keys[$i].'"'; + if ($selected == $keys[$i]) $boxstring .=' checked'; + $boxstring .='/>'.$value[$i]; + } + return $boxstring; +} ?> |