You are here

function scheduler_admin_submit in Scheduler 7

Form submission handler for scheduler_admin().

1 string reference to 'scheduler_admin_submit'
scheduler_admin in ./scheduler.admin.inc
Form constructor for the main admin form for configuring Scheduler.

File

./scheduler.admin.inc, line 180
Administration forms for the Scheduler module.

Code

function scheduler_admin_submit($form, &$form_state) {

  // For the minute increment, change a blank value to 1. Date popup does not
  // support blank values.
  if (empty($form_state['values']['scheduler_date_popup_minute_increment'])) {
    $form_state['values']['scheduler_date_popup_minute_increment'] = 1;
  }

  // Extract the date part and time part of the full format, for use with the
  // default time functionality. Assume the date and time time parts begin and
  // end with a letter, but any punctuation between these will be retained.
  $format = $form_state['values']['scheduler_date_format'];
  $time_only_format = scheduler_get_time_only_format($format);
  variable_set('scheduler_time_only_format', $time_only_format);
  $date_only_format = scheduler_get_date_only_format($format);
  variable_set('scheduler_date_only_format', $date_only_format);
  if (empty($time_only_format)) {
    drupal_set_message(t('The date part of the Scheduler format is %date_part. There is no time part', array(
      '%date_part' => $date_only_format,
    )));
  }
  else {
    drupal_set_message(t('The date part of the Scheduler format is %date_part and the time part is %time_part.', array(
      '%date_part' => $date_only_format,
      '%time_part' => $time_only_format,
    )));
  }
}