You are here

function ds_build_mode_delete_form_submit in Display Suite 6

Same name and namespace in other branches
  1. 6.3 includes/ds.buildmodes.inc \ds_build_mode_delete_form_submit()
  2. 6.2 includes/ds.buildmodes.inc \ds_build_mode_delete_form_submit()

Delete build mode.

File

includes/ds.buildmodes.inc, line 185
Manage build modes.

Code

function ds_build_mode_delete_form_submit($form, &$form_state) {
  $module = $form['#module'];
  $build_modes = variable_get($module . '_build_modes', array());
  unset($build_modes[$form_state['values']['display']]);
  variable_set($module . '_build_modes', $build_modes);
  drupal_set_message(t('Custom build mode %build_mode has been removed.', array(
    '%build_mode' => $form_state['values']['display'],
  )));
  $form_state['redirect'] = 'admin/build/ds/' . $module . '/buildmodes';
  menu_rebuild();
  drupal_rebuild_theme_registry();
}