You are here

function field_group_delete_form_submit in Field Group 7.2

Same name and namespace in other branches
  1. 7 field_group.field_ui.inc \field_group_delete_form_submit()

Remove group from bundle.

@todo we'll have to reset all view mode settings - that will be fun :)

File

./field_group.field_ui.inc, line 709
Field_group.field_ui.inc is a file that contains most functions needed on the Fields UI Manage forms (display and fields).

Code

function field_group_delete_form_submit($form, &$form_state) {
  $group = $form['#group'];
  $bundle = $group->bundle;
  $entity_type = $group->entity_type;
  $group->mode = $form_state['build_info']['args'][1];
  $bundles = field_info_bundles();
  $bundle_label = $bundles[$entity_type][$bundle]['label'];
  ctools_include('export');
  field_group_group_export_delete($group, FALSE);
  drupal_set_message(t('The group %group has been deleted from the %type content type.', array(
    '%group' => t($group->label),
    '%type' => $bundle_label,
  )));

  // Redirect.
  $form_state['redirect'] = $form['#redirect'];
}