You are here

function pmpapi_config_form_submit in Public Media Platform API Integration 7

Form submission handler for pmpapi_push_admin_config().

File

./pmpapi.admin.inc, line 97
Basic admin forms, validators, and submit handlers for the PMPAPI module.

Code

function pmpapi_config_form_submit($form, &$form_state) {
  variable_set('pmpapi_base_url', trim($form_state['values']['pmpapi_base_url']));
  variable_set('pmpapi_user_id', trim($form_state['values']['pmpapi_user_id']));
  variable_set('pmpapi_auth_client_id', trim($form_state['values']['pmpapi_auth_client_id']));
  variable_set('pmpapi_auth_client_secret', trim($form_state['values']['pmpapi_auth_client_secret']));
  if (isset($form_state['values']['pmpapi_cache_bin'])) {
    variable_set('pmpapi_cache_bin', $form_state['values']['pmpapi_cache_bin']);
  }

  // If (PMP) cache isn't cleared, it can cause issues when creds change
  pmpapi_clear_pmp_cache();
  drupal_set_message(t('The configuration options have been saved.'));
}