function privatemsg_delete

1 privatemsg.module privatemsg_delete($form_state, $thread, $message)
7-1 privatemsg.pages.inc privatemsg_delete($form, $form_state, $thread, $message)
7-2 privatemsg.pages.inc privatemsg_delete($form, $form_state, $thread, $message)
6-2 privatemsg.pages.inc privatemsg_delete($form_state, $thread, $message)
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 81
User menu callbacks for Privatemsg.

Code

function privatemsg_delete($form, $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'));
}