Changeset 17666
- Timestamp:
- 2008/10/28 15:44:51 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/module/Smarty/libs/plugins/function.html_options.php
r15532 r17666 31 31 { 32 32 require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); 33 33 34 34 $name = null; 35 35 $values = null; … … 37 37 $selected = array(); 38 38 $output = null; 39 39 40 40 $extra = ''; 41 41 42 42 foreach($params as $_key => $_val) { 43 43 switch($_key) { … … 45 45 $$_key = (string)$_val; 46 46 break; 47 47 48 48 case 'options': 49 49 $$_key = (array)$_val; 50 50 break; 51 51 52 52 case 'values': 53 53 case 'output': … … 58 58 $$_key = array_map('strval', array_values((array)$_val)); 59 59 break; 60 60 61 61 default: 62 62 if(!is_array($_val)) { … … 75 75 76 76 if (isset($options)) { 77 77 78 78 foreach ($options as $_key=>$_val) 79 79 $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); 80 80 81 81 } else { 82 82 83 83 foreach ($values as $_i=>$_key) { 84 84 $_val = isset($output[$_i]) ? $output[$_i] : ''; … … 101 101 smarty_function_escape_special_chars($key) . '"'; 102 102 if (in_array((string)$key, $selected)) 103 $_html_result .= ' selected ="selected"';103 $_html_result .= ' selected'; 104 104 $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; 105 105 } else {
Note: See TracChangeset
for help on using the changeset viewer.