Révision 8c72e82a
Ajouté par Assos Assos il y a environ 7 ans
drupal7/sites/all/modules/webform/components/select.inc | ||
---|---|---|
395 | 395 |
$option_value = reset($value); |
396 | 396 |
$element['#default_value'] = $option_value === '' ? NULL : $option_value; |
397 | 397 |
} |
398 |
|
|
398 |
|
|
399 | 399 |
if ($component['extra']['other_option'] && module_exists('select_or_other')) { |
400 | 400 |
// Set display as a select_or_other element: |
401 | 401 |
$element['#type'] = 'select_or_other'; |
... | ... | |
762 | 762 |
// Set the value as an array for multiple select or single value otherwise. |
763 | 763 |
if ($element['#type'] == 'checkboxes') { |
764 | 764 |
$checkbox_values = $element['#options']; |
765 |
array_walk($checkbox_values, function(&$value, $key) use($value) { |
|
766 |
$value = (int)(strval($key) === $value); |
|
765 |
array_walk($checkbox_values, function(&$option_value, $key) use($value) {
|
|
766 |
$option_value = (int)(strval($key) === $value);
|
|
767 | 767 |
}); |
768 | 768 |
} |
769 | 769 |
else { |
... | ... | |
1023 | 1023 |
$group = NULL; |
1024 | 1024 |
foreach ($rows as $option) { |
1025 | 1025 |
$option = trim($option); |
1026 |
/**
|
|
1026 |
/* |
|
1027 | 1027 |
* If the Key of the option is within < >, treat as an optgroup |
1028 | 1028 |
* |
1029 | 1029 |
* <Group 1> |
Formats disponibles : Unified diff
Weekly update of contrib modules