You are here

function christmas_lights_settings_submit in Christmas Lights 7

Process christmas_lights_settings submissions.

File

./christmas_lights.module, line 83
Main file for the christmas_lights module.

Code

function christmas_lights_settings_submit($form, $form_state) {
  $settings = variable_get('christmas_lights_settings');
  $settings['enabled'] = $form_state['values']['enabled'];
  $start = $form_state['values']['start'];
  $end = $form_state['values']['end'];
  $start = mktime(0, 0, 0, $start['month'], $start['day'], $start['year']);
  $end = mktime(0, 0, 0, $end['month'], $end['day'], $end['year']);
  $settings['start'] = $start;
  $settings['end'] = $end;
  variable_set('christmas_lights_settings', $settings);
  drupal_set_message(t('Configuration saved.'));
}