function ds_extras_vd_bundle_form_submit

cis7 ds_extras.vd.inc ds_extras_vd_bundle_form_submit($form, &$form_state)
cle7 ds_extras.vd.inc ds_extras_vd_bundle_form_submit($form, &$form_state)
elmsmedia7 ds_extras.vd.inc ds_extras_vd_bundle_form_submit($form, &$form_state)
icor7 ds_extras.vd.inc ds_extras_vd_bundle_form_submit($form, &$form_state)
meedjum_blog7 ds_extras.vd.inc ds_extras_vd_bundle_form_submit($form, &$form_state)
mooc7 ds_extras.vd.inc ds_extras_vd_bundle_form_submit($form, &$form_state)

Submit callback: save the new bundle.

File

sites/all/modules/ulmus/ds/modules/ds_extras/includes/ds_extras.vd.inc, line 110
Views displays functions.

Code

function ds_extras_vd_bundle_form_submit($form, &$form_state) {

  // Save new bundle.
  $record = new stdClass();
  $record->vd = $form_state['values']['vd'];
  $record->label = $form['vd']['#options'][$record->vd];
  drupal_write_record('ds_vd', $record);

  // Clear entity cache and field info fields cache.
  cache_clear_all('field_info_fields', 'cache_field');
  cache_clear_all('entity_info', 'cache', TRUE);

  // Message and redirect.
  drupal_set_message(t('Bundle @label has been added.', array('@label' => $record->label)));
  $form_state['redirect'] = 'admin/structure/ds/vd';
}