You are here

function ds_enable_layout_field_settings_form in Display Suite 7.2

Menu callback: Enable layout and field settings form.

1 string reference to 'ds_enable_layout_field_settings_form'
_ds_menu in includes/ds.registry.inc
Implements hook_menu().

File

includes/ds.field_ui.inc, line 164
Field UI functions for Display Suite.

Code

function ds_enable_layout_field_settings_form($form, &$form_state, $id = '') {
  $layout = new stdClass();
  ctools_include('export');
  $ds_layout_settings = ctools_export_crud_load_all('ds_layout_settings');
  if (isset($ds_layout_settings[$id])) {
    $layout = $ds_layout_settings[$id];
  }
  if (isset($layout) && $layout->export_type != 1 && !empty($layout->disabled)) {
    $form['#layout'] = $layout;
    $form['#export_id'] = $id;
    return confirm_form($form, t('Are you sure you want to enable the layout and field settings for %layout?', array(
      '%layout' => implode(', ', explode('|', $layout->id)),
    )), drupal_get_destination(), t('This action cannot be undone.'), t('Enable'), t('Cancel'));
  }
  else {
    drupal_set_message(t('This operation is not possible.'));
  }
}