You are here

function sms_track_settings_form_submit in SMS Framework 7

Same name and namespace in other branches
  1. 6.2 modules/sms_track/sms_track.admin.inc \sms_track_settings_form_submit()
  2. 6 modules/sms_track/sms_track.admin.inc \sms_track_settings_form_submit()

Submit handler for sms_track_settings_form.

See also

sms_track_settings_form

File

modules/sms_track/sms_track.admin.inc, line 64
Message tracking module: Admin settings form functions.

Code

function sms_track_settings_form_submit($form, &$form_state) {
  $archive_dir_old = variable_get('sms_track_archive_dir', SMS_DIR_NONE);
  $archive_dir = $form_state['values']['archive_dir'];
  variable_set('sms_track_archive_dir', $archive_dir);
  $archive_max_age_days = $form_state['values']['archive_max_age_days'];
  variable_set('sms_track_archive_max_age_days', $archive_max_age_days);

  // Trigger watchdog messages.
  if ($archive_dir_old && !$archive_dir) {
    watchdog('sms_track', 'SMS Tracking archive collector DISABLED');
  }
  if (!$archive_dir_old && $archive_dir) {
    watchdog('sms_track', 'SMS Tracking archive collector enabled');
  }
  drupal_set_message(t('Settings saved.'));
}