You are here

function mailhandler_add_edit_mailbox_submit in Mailhandler 6

Same name and namespace in other branches
  1. 7 mailhandler.admin.inc \mailhandler_add_edit_mailbox_submit()

Submit handler for mailhandler_add_edit_mailbox() form.

Add or update a mailbox.

File

./mailhandler.admin.inc, line 237
Administrator pages for the Mailhandler module.

Code

function mailhandler_add_edit_mailbox_submit($form, &$form_state) {
  $mailbox = $form_state['values'];
  if (isset($mailbox['mid'])) {
    drupal_set_message(t('Mailbox %mailbox updated.', array(
      '%mailbox' => $mailbox['mail'],
    )));
  }
  else {
    drupal_set_message(t('Mailbox %mailbox added.', array(
      '%mailbox' => $mailbox['mail'],
    )));
  }
  $form_state['redirect'] = 'admin/content/mailhandler';
  mailhandler_mailbox_save($mailbox);
}