You are here

function supersized_node_settings_form_submit in Supersized 8

Same name and namespace in other branches
  1. 7 supersized.module \supersized_node_settings_form_submit()

Submit handler for node supersized settings form.

File

./supersized.module, line 764
Supersized module file.

Code

function supersized_node_settings_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  $settings['mobile_disabled'] = isset($values['mobile_disabled']) ? $values['mobile_disabled'] : FALSE;
  $settings['functionalities']['autoplay'] = $values['autoplay'];
  $settings['functionalities']['start_slide'] = $values['start_slide'];
  $settings['functionalities']['stop_loop'] = $values['stop_loop'];
  $settings['functionalities']['random'] = $values['random'];
  $settings['functionalities']['slide_interval'] = $values['slide_interval'];
  $settings['functionalities']['transition'] = $values['transition'];
  $settings['functionalities']['transition_speed'] = $values['transition_speed'];
  $settings['functionalities']['new_window'] = $values['new_window'];
  $settings['functionalities']['pause_hover'] = $values['pause_hover'];
  $settings['functionalities']['keyboard_nav'] = $values['keyboard_nav'];
  $settings['functionalities']['performance'] = $values['performance'];
  $settings['functionalities']['image_protect'] = $values['image_protect'];
  $settings['functionalities']['on_new_slide'] = $values['on_new_slide'];
  $settings['functionalities']['overlay'] = $values['overlay'];
  $settings['dimension']['min_width'] = $values['min_width'];
  $settings['dimension']['min_height'] = $values['min_height'];
  $settings['dimension']['vertical_center'] = $values['vertical_center'];
  $settings['dimension']['horizontal_center'] = $values['horizontal_center'];
  $settings['dimension']['fit_always'] = $values['fit_always'];
  $settings['dimension']['fit_portrait'] = $values['fit_portrait'];
  $settings['dimension']['fit_landscape'] = $values['fit_landscape'];
  $settings['components']['arrow_nav'] = $values['arrow_nav'];
  $settings['components']['slide_links'] = $values['slide_links'];
  $settings['components']['thumb_links'] = $values['thumb_links'];
  $settings['components']['thumbnail_navigation'] = $values['thumbnail_navigation'];
  $settings['components']['progress_bar'] = $values['progress_bar'];
  $settings['components']['control_bar'] = $values['control_bar'];
  $settings['components']['mouse_scrub'] = $values['mouse_scrub'];
  $record = array(
    'nid' => $values['nid'],
    'settings' => serialize($settings),
  );
  $previous_settings = supersized_get_node_settings($values['nid']);
  if (empty($previous_settings)) {
    $result = drupal_write_record('supersized', $record);
  }
  else {
    $result = drupal_write_record('supersized', $record, array(
      'nid',
    ));
  }
  drupal_set_message(t('Supersized settings saved successfully.'));
}