You are here

function globallink_adaptor_settings_submit in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink_settings.inc \globallink_adaptor_settings_submit()
  2. 7.6 globallink_settings.inc \globallink_adaptor_settings_submit()

Submits adaptor settings.

File

./globallink_settings.inc, line 430

Code

function globallink_adaptor_settings_submit($form, &$form_state) {
  $old_preview = variable_get('globallink_enable_preview', 1);
  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
  if ($op == t('Save Adaptor Settings')) {
    foreach ($form_state['values'] as $key => $value) {
      if (is_array($value) && isset($form_state['values']['array_filter'])) {
        $value = array_keys(array_filter($value));
      }
      variable_set($key, $value);
    }
    $pvalue = $form_state['values']['globallink_enable_preview'];
    if ($pvalue != $old_preview) {
      $_SESSION['globallink_globalLink_arr'] = array();
      unset($_SESSION['globallink_globalLink_arr_last_refreshed']);
    }
  }
  drupal_set_message(t('The configuration options have been saved.'));
}