You are here

function data_entity_admin_entity_form_submit in Data 7

File

data_entity/data_entity.admin.inc, line 181
Admin UI functions.

Code

function data_entity_admin_entity_form_submit($form, &$form_state) {
  $table = $form_state['values']['table'];

  // Update meta data.
  $meta = $table
    ->get('meta');
  foreach ($form_state['values']['fields'] as $field_name => $values) {
    foreach ($values as $key => $value) {
      $meta['fields'][$field_name][$key] = $value;
    }
  }
  if (!empty($form_state['values']['label_field'])) {
    $meta['label_field'] = $form_state['values']['label_field'];
  }
  $table
    ->update(array(
    'meta' => $meta,
  ));
  drupal_set_message(t('Saved changes'));
}