You are here

function theme_ajax_comments_notify_text in AJAX Comments 7

Returns text to notify user their comment has been added.

3 theme calls to theme_ajax_comments_notify_text()
ajax_comments_delete_js in ./ajax_comments.module
Removes the comment.
ajax_comments_form_comment_form_alter in ./ajax_comments.module
Implements hook_form_FORM_ID_alter().
ajax_comments_submit_js in ./ajax_comments.module
Builds the comment.

File

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

Code

function theme_ajax_comments_notify_text($vars = array()) {
  $text = t('Your comment has been posted.');
  $status = 'status';

  // If the comment is unapproved, alter the message
  if (isset($vars['comment']) && !$vars['comment']->status) {
    $text = t('Your comment has been queued for review by site administrators and will be published after approval.');
    $status = 'warning';
  }
  if ($vars['type'] == 'delete') {
    $text = t('Your comment has been deleted');
  }
  elseif ($vars['type'] == 'preview') {
    $text = t('This is the preview for your comment. You must click SAVE or your comment will be lost.');
    $status = 'warning';
  }
  drupal_set_message($text, $status);
  return theme('status_messages');
}