You are here

function ds_disable_layout_field_settings_form in Display Suite 7.2

Menu callback: Disable layout and field settings form.

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

File

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

Code

function ds_disable_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->disable)) {
    $form['#layout'] = $layout;
    $form['#export_id'] = $id;
    return confirm_form($form, t('Are you sure you want to disable the layout and field settings for %layout?', array(
      '%layout' => implode(', ', explode('|', $layout->id)),
    )), drupal_get_destination(), t('This action cannot be undone.'), t('Disable'), t('Cancel'));
  }
  else {
    drupal_set_message(t('This operation is not possible.'));
  }
}