You are here

function ds_shared_form_validate in Display Suite 7.2

Same name and namespace in other branches
  1. 7 ds.fields.inc \ds_shared_form_validate()

Shared field form validation.

1 string reference to 'ds_shared_form_validate'
ds_shared_form in modules/ds_ui/includes/ds.fields.inc
Shared form for all fields.

File

modules/ds_ui/includes/ds.fields.inc, line 275
Administrative functions for managing custom fields for every entity.

Code

function ds_shared_form_validate($form, &$form_state) {
  $field = new stdClass();
  $field->properties = array();
  $field->field = $form_state['values']['field'];
  $field->label = $form_state['values']['name'];
  $field->ui_limit = $form_state['values']['ui_limit'];
  $entities = $form_state['values']['entities'];
  foreach ($entities as $key => $value) {
    if ($key !== $value) {
      unset($entities[$key]);
    }
  }
  $field->entities = $entities;
  $form_state['field'] = $field;
}