You are here

function privatemsg_delete in Privatemsg 6.2

Same name and namespace in other branches
  1. 5.3 privatemsg.module \privatemsg_delete()
  2. 5 privatemsg.module \privatemsg_delete()
  3. 6 privatemsg.module \privatemsg_delete()
  4. 7.2 privatemsg.pages.inc \privatemsg_delete()
  5. 7 privatemsg.pages.inc \privatemsg_delete()
2 string references to 'privatemsg_delete'
privatemsg_menu in ./privatemsg.module
Implements hook_menu().
privatemsg_mollom_form_list in ./privatemsg.module
Implements hook_mollom_form_list().

File

./privatemsg.pages.inc, line 593
User menu callbacks for Privatemsg.

Code

function privatemsg_delete($form_state, $thread, $message) {
  $form['mid'] = array(
    '#type' => 'value',
    '#value' => $message['mid'],
  );
  $form['delete_destination'] = array(
    '#type' => 'value',
    '#value' => count($thread['messages']) > 1 ? privatemsg_get_dynamic_url_prefix() . '/view/' . $message['thread_id'] : privatemsg_get_dynamic_url_prefix(),
  );
  if (privatemsg_user_access('read all private messages')) {
    $form['delete_options'] = array(
      '#type' => 'checkbox',
      '#title' => t('Delete this message for all users?'),
      '#description' => t('Tick the box to delete the message for all users.'),
      '#default_value' => FALSE,
    );
  }
  return confirm_form($form, t('Are you sure you want to delete this message?'), isset($_GET['destination']) ? $_GET['destination'] : privatemsg_get_dynamic_url_prefix() . '/view/' . $message['thread_id'], t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}