You are here

function heartbeat_delete_log_confirm in Heartbeat 7

Same name and namespace in other branches
  1. 6.4 heartbeat.pages.inc \heartbeat_delete_log_confirm()

Menu callback: confirm deleting of logs.

1 string reference to 'heartbeat_delete_log_confirm'
heartbeat_activity_modal_delete in ./heartbeat.pages.inc
CTools modal wrapper function to delete activity.

File

./heartbeat.pages.inc, line 265
Separate codefile for page displays

Code

function heartbeat_delete_log_confirm($form, &$form_state, $uaid = NULL) {
  if (isset($uaid)) {
    $form_state['uaid'] = $uaid;
  }
  $path = isset($_GET['destination']) ? $_GET['destination'] : (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '<front>');

  // Prepare the form.
  $form = array(
    'redirect_path' => array(
      '#type' => 'hidden',
      '#value' => $path,
    ),
  );
  $form_state['redirect'] = $path;

  // Bail out if this is accessed unfortenate.
  if (!isset($form_state['uaid'])) {
    drupal_access_denied();
  }
  $form['#uaid'] = $form_state['uaid'];
  if (!empty($form_state['uaid'])) {
    $form['#uaid'] = $form_state['uaid'];
  }
  $output = confirm_form($form, t('Are you sure you want to delete this message?'), $path, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  return $output;
}