You are here

function monolog_profile_import_form_submit in Monolog 7

Same name and namespace in other branches
  1. 6 monolog.admin.inc \monolog_profile_import_form_submit()

Form submission handler for monolog_profile_import_form().

1 string reference to 'monolog_profile_import_form_submit'
monolog_profile_import_form in ./monolog.admin.inc
Import form for profile configurations.

File

./monolog.admin.inc, line 619
Administrative settings for the Monolog module.

Code

function monolog_profile_import_form_submit($form, &$form_state) {
  try {
    monolog_profile_delete($form_state['values']['profile']);
    if (!monolog_profile_save($form_state['values']['profile'])) {
      throw new \RuntimeException(t('Error importing profile.'));
    }
    $form_state['redirect'] = 'admin/config/development/monolog/profile';
    drupal_set_message(t('The configuration options have been imported.'));
  } catch (Exception $e) {
    form_set_error('import', $e
      ->getMessage());
    watchdog_exception('monolog', $e);
  }
}