You are here

function ajax_comments_remove_status in AJAX Comments 7

Removes "Your comment has been posted." or "Your comment has been queued.." from the status message.

2 calls to ajax_comments_remove_status()
ajax_comments_delete_js in ./ajax_comments.module
Removes the comment.
ajax_comments_submit_js in ./ajax_comments.module
Builds the comment.

File

./ajax_comments.module, line 751
AJAX comments module file.

Code

function ajax_comments_remove_status() {
  if (!empty($_SESSION['messages']['status'])) {
    $deleted = t('The comment and all its replies have been deleted.');
    $published = t('Your comment has been posted.');
    $not_published = t('Your comment has been queued for review by site administrators and will be published after approval.');
    foreach ($_SESSION['messages']['status'] as $key => $value) {
      if ($value == $published || $value == $not_published || ($value = $deleted)) {
        unset($_SESSION['messages']['status'][$key]);
      }
    }
    if (empty($_SESSION['messages']['status'])) {
      unset($_SESSION['messages']['status']);
      if (empty($_SESSION['messages'])) {
        unset($_SESSION['messages']);
      }
    }
  }
}