You are here

function recommender_settings_form_submit in Recommender API 6.2

Same name and namespace in other branches
  1. 6.3 recommender.admin.inc \recommender_settings_form_submit()
  2. 7.3 recommender.admin.inc \recommender_settings_form_submit()
  3. 7.4 recommender.admin.inc \recommender_settings_form_submit()
  4. 7.5 recommender.admin.inc \recommender_settings_form_submit()

File

./recommender.module, line 269

Code

function recommender_settings_form_submit($form, &$form_state) {
  $cron_freq = $form_state['values']['cron_freq'];
  $modules = $form_state['values']['modules'];
  variable_set('recommender_cron_freq', $cron_freq);
  variable_set('recommender_modules', $modules);
  if ($form_state['clicked_button']['#name'] == 'save') {
    drupal_set_message(t("The configuration options have been saved."));
  }
  else {

    // trigger recommender_run()
    $modules = array_values(array_diff($modules, array(
      0,
    )));
    if (empty($modules)) {
      drupal_set_message(t("No module selected to run recommender"));
    }
    else {
      recommender_run($modules);
    }
  }
}