You are here

function bat_type_bundle_form_submit in Booking and Availability Management Tools for Drupal 7

Form API submit callback for the unit bundle form.

1 string reference to 'bat_type_bundle_form_submit'
bat_type_bundle_form in modules/bat_unit/bat_type_bundle.admin.inc
Generates the unit bundle editing form.

File

modules/bat_unit/bat_type_bundle.admin.inc, line 149
BatTypeBundle editing UI.

Code

function bat_type_bundle_form_submit($form, &$form_state) {
  $type_bundle = entity_ui_form_submit_build_entity($form, $form_state);
  if ($type_bundle->data === '') {
    $type_bundle->data = array();
  }
  $type_bundle->data['revision'] = $form_state['values']['revision'];
  if (isset($form_state['values']['revision_moderation'])) {
    $type_bundle->data['revision_moderation'] = $form_state['values']['revision_moderation'];
  }
  if (isset($form_state['values']['new_revisions'])) {
    $type_bundle->data['new_revisions'] = $form_state['values']['new_revisions'];
  }

  // Save and go back.
  $type_bundle
    ->save();
  $form_state['type_bundle'] = $type_bundle;
  $form_state['redirect'] = 'admin/bat/config/type-bundles';
}