function _value_is_disabled_options_value_callback in Value is 7
Value callback for checkboxes elements.
2 string references to '_value_is_disabled_options_value_callback'
- value_is_element_info_alter in ./
value_is.module - Implements hook_element_info_alter().
- _value_is_disabled_options_passthrough in ./
value_is.module - Helper to determine if there's nothing to do in this element. Depends on:
File
- ./
value_is.module, line 138 - All the element validators for #element_validate.
Code
function _value_is_disabled_options_value_callback($element, $input = FALSE, $form_state = array()) {
$passthrough = _value_is_disabled_options_passthrough($element);
$default = isset($element['#value']) ? $element['#value'] : (isset($element['#default_value']) ? $element['#default_value'] : array());
if ($passthrough && !empty($element['#disabled'])) {
return drupal_map_assoc($default);
}
$state = _value_is_disabled_options_state($element);
$access = !isset($element['#access']) || $element['#access'];
$submitted = $access && $input !== FALSE;
if ($submitted) {
$input_data = is_array($input) ? $input : array();
return drupal_map_assoc(array_filter($state + $input_data));
}
return drupal_map_assoc($default);
}