You are here

function privatemsg_delete in Privatemsg 6

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

File

./privatemsg.module, line 1526
Allows users to send private messages to other users.

Code

function privatemsg_delete($form_state, $thread, $message) {
  $form['pmid'] = array(
    '#type' => 'value',
    '#value' => $message['mid'],
  );
  $form['delete_destination'] = array(
    '#type' => 'value',
    '#value' => count($thread['messages']) > 1 ? 'messages/view/' . $message['thread_id'] : 'messages',
  );
  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'] : 'messages/view/' . $message['thread_id'], t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}