You are here

function privatemsg_delete_multiple_form_submit in Privatemsg 5.3

Same name and namespace in other branches
  1. 5 privatemsg.module \privatemsg_delete_multiple_form_submit()

File

./privatemsg.module, line 2050

Code

function privatemsg_delete_multiple_form_submit($form_id, $form_values) {
  foreach ($_SESSION['privatemsg'] as $mid => $message) {
    if ($message['selected']) {
      _privatemsg_delete($mid);
    }
  }
  if ($_SESSION['fromfolder'] == 0) {
    $path = 'privatemsg';
  }
  else {
    $path = 'privatemsg/list/' . $_SESSION['fromfolder'];
  }
  unset($_SESSION['privatemsg'], $_SESSION['fromfolder']);
  drupal_set_message(t('Messages deleted.'));
  drupal_goto($path);
}