You are here

function ds_field_ui_fields_validate in Display Suite 7.2

Same name and namespace in other branches
  1. 8.4 includes/field_ui.inc \ds_field_ui_fields_validate()
  2. 8.2 includes/field_ui.inc \ds_field_ui_fields_validate()
  3. 8.3 includes/field_ui.inc \ds_field_ui_fields_validate()

Form validation handler for _ds_field_ui_fields().

1 string reference to 'ds_field_ui_fields_validate'
ds_field_row_form_format_construct in includes/ds.field_ui.inc
Helper function for building the formatter settings.

File

includes/ds.field_ui.inc, line 802
Field UI functions for Display Suite.

Code

function ds_field_ui_fields_validate($form, &$form_state) {
  foreach (element_children($form['fields']) as $key) {
    if (isset($form_state['values']['fields'][$key]['settings_edit_form'])) {
      $settings = isset($form_state['values']['fields'][$key]['settings_edit_form']['settings']['ft']) ? $form_state['values']['fields'][$key]['settings_edit_form']['settings']['ft'] : array();
      if (!empty($settings)) {
        $merge = isset($form_state['formatter_settings'][$key]['ft']) ? $form_state['formatter_settings'][$key]['ft'] : array();
        $form_state['formatter_settings'][$key]['ft'] = array_merge($merge, $settings);
      }
    }
  }
}