You are here

function bootstrap_tour_configure_form_submit in Bootstrap Tour 7

Save the contents of the configuration form

_state

Parameters

array $form:

File

./bootstrap_tour.admin.inc, line 397

Code

function bootstrap_tour_configure_form_submit($form, &$form_state) {
  $tour_record = array(
    'title' => $form_state['values']['title'],
    'description' => $form_state['values']['description'],
    'visible' => $form_state['values']['visible'],
    'configuration' => $form_state['values']['configuration'],
  );
  if (is_object(_bootstrap_tour_get_data(arg(5)))) {

    // Update the data of the tour
    $tour_record['tour_id'] = arg(5);
    drupal_write_record('bootstrap_tour', $tour_record, array(
      'tour_id',
    ));
    drupal_set_message('Tour data was updated successfully!');
  }
  else {

    // Create a new tour
    drupal_write_record('bootstrap_tour', $tour_record);
    drupal_set_message('Tour has been created!');
  }
  drupal_goto('admin/config/content/bootstrap_tour/configure_tour/' . $tour_record['tour_id']);
}