You are here

function ds_build_mode_form_submit in Display Suite 6

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

Save new build mode.

1 string reference to 'ds_build_mode_form_submit'
ds_build_mode_form in includes/ds.buildmodes.inc
Build mode form.

File

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

Code

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