You are here

function field_group_enable_form_submit in Field Group 7

Re-enable the group on a bundle.

File

./field_group.field_ui.inc, line 798
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_enable_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');
  ctools_export_crud_enable('field_group', $group->identifier);
  drupal_set_message(t('The group %group has been enabled on the %type content type.', array(
    '%group' => t($group->label),
    '%type' => $bundle_label,
  )));

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