function conditional_fields_states_handlers in Conditional Fields 7.3
Builds a list of special fields handlers to be executed when building the #states array. The keys are handler function names and the key/value pairs are field properties and their values that trigger the execution of the handler.
The handlers themselves must accept the parameters $field, $field_info, $options and $state.
See also
conditional_fields_field_attach_form()
1 call to conditional_fields_states_handlers()
- conditional_fields_form_after_build in ./
conditional_fields.module - after_build callback for forms with dependencies.
File
- ./
conditional_fields.module, line 1680 - Define dependencies between fields based on their states and values.
Code
function conditional_fields_states_handlers() {
$handlers = array(
'conditional_fields_states_handler_select_multiple' => array(
'#type' => 'select',
'#multiple' => TRUE,
),
'conditional_fields_states_handler_checkbox' => array(
'#type' => 'checkbox',
),
'conditional_fields_states_handler_checkboxes' => array(
'#type' => 'checkboxes',
),
'conditional_fields_states_handler_text' => array(
'#type' => 'textfield',
),
'conditional_fields_states_handler_textarea' => array(
'#type' => 'textarea',
),
'conditional_fields_states_handler_date_combo' => array(
'#type' => 'date_combo',
),
'conditional_fields_states_handler_link_field' => array(
'#type' => 'link_field',
),
'conditional_fields_states_handler_link_addressfield' => array(
'#addressfield' => 1,
),
);
// Allow other modules to modify the handlers
drupal_alter('conditional_fields_states_handlers', $handlers);
return $handlers;
}