You are here

function responsive_menu_settings_form_submit in Responsive and off-canvas menu 7.2

Same name and namespace in other branches
  1. 7.3 includes/responsive_menu.admin.inc \responsive_menu_settings_form_submit()

Submit handler for the menu settings form.

1 string reference to 'responsive_menu_settings_form_submit'
responsive_menu_form_menu_configure_alter in ./responsive_menu.module
Implements hook_form_FORM_ID_alter().

File

includes/responsive_menu.admin.inc, line 194
The settings form for the responsive menu module.

Code

function responsive_menu_settings_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  variable_set('responsive_menu_menu', $values['responsive_menu_menu']);
  variable_set('responsive_menu_css', $values['css']);
  variable_set('responsive_menu_off_canvas_menus', $values['responsive_menu_off_canvas_menus']);
  variable_set('responsive_menu_position', $values['position']);
  variable_set('responsive_menu_theme', $values['theme']);
  variable_set('responsive_menu_superfish', $values['superfish']);
  variable_set('responsive_menu_superfish_delay', $values['superfish_delay']);
  variable_set('responsive_menu_superfish_speed', $values['superfish_speed']);
  variable_set('responsive_menu_superfish_speed_out', $values['superfish_speed_out']);
  variable_set('responsive_menu_superfish_hoverintent', $values['superfish_hoverintent']);
  if (module_exists('breakpoints')) {
    $breakpoints = breakpoints_breakpoint_load_all();

    // Check if the breakpoint exists.
    if (isset($breakpoints[$values['responsive_menu_breakpoint']])) {

      // Store the breakpoint for using again in the form.
      variable_set('responsive_menu_breakpoint', $values['responsive_menu_breakpoint']);

      // Also store the actual breakpoint string for use in calling the
      // stylesheet.
      variable_set('responsive_menu_media_query', $breakpoints[$values['responsive_menu_breakpoint']]->breakpoint);
    }
  }
  else {
    variable_set('responsive_menu_media_query', $values['responsive_menu_media_query']);
  }

  // Store the boolean value of the hammer option.
  variable_set('responsive_menu_hammer', $values['hammer']);
}