You are here

function boolean_field_instance_settings_form_after_build in Boolean Field 7

Form handler for after_build.

Rebuild the element form items as vertical tabs. Retain form items added by other modules.

See also

boolean_field_instance_settings_form()

1 string reference to 'boolean_field_instance_settings_form_after_build'
boolean_field_instance_settings_form in ./boolean.module
Implements hook_field_instance_settings_form().

File

./boolean.module, line 133
Defines boolean field type.

Code

function boolean_field_instance_settings_form_after_build($element, $form_state) {
  $string = 'The display value of this field is equal to its "delta" value surrounded by the prefix and suffix strings defined below.' . ' The "delta" value is only displayed if the "number of values" for this field is greater than one.' . ' For example, if there are five values of this field, then the delta values are numbered zero through four.' . ' The corresponding display values are "prefix delta suffix."';
  $element['state'] = array(
    '#type' => 'fieldset',
    '#title' => 'Display strings',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#tree' => FALSE,
    '#weight' => 5,
    '#description' => t($string),
  );
  $element['state']['tabs'] = array(
    '#type' => 'vertical_tabs',
    '#default_tab' => 'edit-true',
  );
  foreach (boolean_value_info() as $state) {
    $element['state']['tabs'][$state] = $element[$state];
    unset($element[$state]);
  }
  return $element;
}