| @@ 1540-1560 (lines=21) @@ | ||
| 1537 | <input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" ', $field['input_attr'], '>'; |
|
| 1538 | ||
| 1539 | // Always fun - select boxes! |
|
| 1540 | elseif ($field['type'] == 'select') |
|
| 1541 | { |
|
| 1542 | echo ' |
|
| 1543 | <select name="', $key, '" id="', $key, '">'; |
|
| 1544 | ||
| 1545 | if (isset($field['options'])) |
|
| 1546 | { |
|
| 1547 | // Is this some code to generate the options? |
|
| 1548 | if (!is_array($field['options'])) |
|
| 1549 | $field['options'] = $field['options'](); |
|
| 1550 | ||
| 1551 | // Assuming we now have some! |
|
| 1552 | if (is_array($field['options'])) |
|
| 1553 | foreach ($field['options'] as $value => $name) |
|
| 1554 | echo ' |
|
| 1555 | <option', is_numeric($value) ? ' value="" disabled' : ' value="' . $value . '"', $value === $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
|
| 1556 | } |
|
| 1557 | ||
| 1558 | echo ' |
|
| 1559 | </select>'; |
|
| 1560 | } |
|
| 1561 | ||
| 1562 | // Something to end with? |
|
| 1563 | if (!empty($field['postinput'])) |
|
| @@ 228-248 (lines=21) @@ | ||
| 225 | <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>'; |
|
| 226 | ||
| 227 | // Always fun - select boxes! |
|
| 228 | elseif ($field['type'] == 'select') |
|
| 229 | { |
|
| 230 | echo ' |
|
| 231 | <select name="', $key, '" id="', $key, '" tabindex="', $context['tabindex']++, '">'; |
|
| 232 | ||
| 233 | if (isset($field['options'])) |
|
| 234 | { |
|
| 235 | // Is this some code to generate the options? |
|
| 236 | if (!is_array($field['options'])) |
|
| 237 | $field['options'] = eval($field['options']); |
|
| 238 | ||
| 239 | // Assuming we now have some! |
|
| 240 | if (is_array($field['options'])) |
|
| 241 | foreach ($field['options'] as $value => $name) |
|
| 242 | echo ' |
|
| 243 | <option', is_numeric($value) ? ' value="" disabled' : ' value="' . $value . '"', $value === $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
|
| 244 | } |
|
| 245 | ||
| 246 | echo ' |
|
| 247 | </select>'; |
|
| 248 | } |
|
| 249 | ||
| 250 | // Something to end with? |
|
| 251 | if (!empty($field['postinput'])) |
|