You are here

function shoutbox_delete_form_submit in Shoutbox 7

Same name and namespace in other branches
  1. 5 shoutbox.module \shoutbox_delete_form_submit()
  2. 6.2 shoutbox.pages.inc \shoutbox_delete_form_submit()
  3. 6 shoutbox.module \shoutbox_delete_form_submit()
  4. 7.2 shoutbox.pages.inc \shoutbox_delete_form_submit()

Handle the delete form submission.

File

./shoutbox.pages.inc, line 338
Page callbacks for the shoutbox module.

Code

function shoutbox_delete_form_submit($form, &$form_state) {
  if ($form_state['clicked_button']['#value'] == t('Confirm')) {
    if (is_numeric($form_state['values']['shout_id'])) {

      // Load the shout.
      $shout = shoutbox_shout_load($form_state['values']['shout_id']);

      // Delete the shout.
      shoutbox_delete_shout($shout);
      drupal_set_message(t('Your ' . DEFAULTSHOUTSINGULAR . ' was deleted.'));
      $form_state['redirect'] = '';
    }
    else {
      return drupal_not_found();
    }
  }
}