You are here

function ajax_comments_nodejs_process_node in AJAX Comments 7

Implements hook_preprocess_node()

File

ajax_comments_nodejs/ajax_comments_nodejs.module, line 11
AJAX Comments Nodejs Integration module file

Code

function ajax_comments_nodejs_process_node(&$variables) {
  if ($variables['node']->comment == COMMENT_NODE_OPEN && ajax_comments_node_type_active($variables['node']->type)) {

    // Enable channel for current node.
    nodejs_send_content_channel_token('ajax_comments_nodejs_' . $variables['node']->nid);
    drupal_add_js(drupal_get_path('module', 'ajax_comments_nodejs') . '/nodejs.ajaxcomments.js', array(
      'type' => 'file',
    ));
    drupal_add_js(drupal_get_path('module', 'ajax_comments') . '/ajax_comments.js', array(
      'type' => 'file',
    ));
    drupal_add_css(drupal_get_path('module', 'ajax_comments_nodejs') . '/ajax_comments_nodejs.css', array(
      'type' => 'file',
    ));
  }
}