You are here

function comment_goodness_confirm_delete_submit in Comment goodness 7

Form submit function copied from comment_confirm_delete_submit().

The user-visible and watchdog messages are different from core.

File

./comment_goodness.module, line 379
Comment goodness provides newest to oldest comment sorting

Code

function comment_goodness_confirm_delete_submit($form, &$form_state) {
  global $user;
  $comment = $form['#comment'];

  // Delete the comment and its replies.
  comment_delete($comment->cid);
  drupal_set_message(t('The comment has been deleted.'));
  watchdog('content', 'User %name (@uid) deleted own comment @cid.', array(
    '%name' => $user->name,
    '@uid' => $user->uid,
    '@cid' => $comment->cid,
  ));

  // Clear the cache so an anonymous user sees that his comment was deleted.
  cache_clear_all();
  $form_state['redirect'] = "node/{$comment->nid}";
}