You are here

function ajax_comments_preprocess_comment_wrapper in AJAX Comments 7

File

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

Code

function ajax_comments_preprocess_comment_wrapper(&$variables) {
  $variables['classes_array'][] = 'comment-wrapper-nid-' . $variables['node']->nid;
  if (empty($variables['content']['comments']) && $variables['node']->comment == COMMENT_NODE_OPEN && ajax_comments_node_type_active($variables['node']->type)) {

    /**
     * A little HACK for adding dummy comment which give us right point to place first comment on the page.
     */
    $variables['content']['comments']['dummyComment'] = array(
      '#prefix' => '<div class="ajax-comment-wrapper ajax-comment-dummy-comment" style="display:none">',
      '#type' => 'item',
      '#markup' => '',
      '#suffix' => '</div>',
    );
  }
}