You are here

function uc_ups_admin_settings_submit in Ubercart 7.3

Submit handler for uc_ups_admin_settings().

Emulates system_settings_form_submit(), but only on a subset of the form values.

See also

uc_ups_admin_settings()

uc_ups_admin_settings_validate()

File

shipping/uc_ups/uc_ups.admin.inc, line 314
UPS administration menu items.

Code

function uc_ups_admin_settings_submit($form, &$form_state) {
  $fields = array(
    'uc_ups_access_license',
    'uc_ups_shipper_number',
    'uc_ups_user_id',
    'uc_ups_password',
    'uc_ups_connection_address',
    'uc_ups_services',
    'uc_ups_pickup_type',
    'uc_ups_pkg_type',
    'uc_ups_classification',
    'uc_ups_negotiated_rates',
    'uc_ups_residential_quotes',
    'uc_ups_rate_markup_type',
    'uc_ups_rate_markup',
    'uc_ups_weight_markup_type',
    'uc_ups_weight_markup',
    'uc_ups_label_lifetime',
    'uc_ups_all_in_one',
    'uc_ups_unit_system',
    'uc_ups_insurance',
  );
  foreach ($fields as $key) {
    $value = $form_state['values'][$key];
    if (is_array($value) && isset($form_state['values']['array_filter'])) {
      $value = array_keys(array_filter($value));
    }
    variable_set($key, $value);
  }
  drupal_set_message(t('The configuration options have been saved.'));
  cache_clear_all();
  drupal_theme_rebuild();
}