You are here

function monolog_handler_delete_form in Monolog 7

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

Removes a handler from the logging profile.

Parameters

stdClass $profile: The logging profile configuration.

array $handler: The configuration options specific to the handler being edited.

See also

monolog_handler_delete_form_submit()

1 string reference to 'monolog_handler_delete_form'
monolog_menu in ./monolog.module
Implements hook_menu().

File

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

Code

function monolog_handler_delete_form($form, &$form_state, stdClass $profile, array $handler = null) {
  $form['#monolog'] = array(
    'profile' => $profile,
    'handler' => $handler,
    'handler_name' => arg(7),
  );
  $args = array(
    '%label' => $handler['label'],
  );
  $prompt = t('Are you sure you want to remove the %label handler?', $args);
  $cancel_path = 'admin/config/development/monolog/profile/' . $profile->name;
  $warning = t('This action cannot be undone.');

  // Pop "Add Hander" link off, add profile link.
  $breadcrumb = drupal_get_breadcrumb();
  array_pop($breadcrumb);
  $breadcrumb[] = l($profile->options['label'], $cancel_path);
  drupal_set_breadcrumb($breadcrumb);
  return confirm_form($form, $prompt, $cancel_path, $warning, t('Delete'), t('Cancel'));
}