You are here

function privatemsg_contacts_form_submit in Privatemsg 5

Same name and namespace in other branches
  1. 5.3 privatemsg.module \privatemsg_contacts_form_submit()

File

./privatemsg.module, line 1761

Code

function privatemsg_contacts_form_submit($form_id, $form_values) {
  if ($form_values['op'] == t('Write private message')) {
    foreach ($form_values['contacts'] as $uid => $contact) {
      if ($contact['selected']) {
        $recipients[] = $contact['name'];
      }
    }
    if (count($recipients) > 0) {
      $_SESSION['recipients'] = $recipients;
      drupal_goto('privatemsg/new');
    }
  }
}