You are here

function nodejs_subscribe_subscribe_node in Node.js integration 7

Same name and namespace in other branches
  1. 6 nodejs_subscribe/nodejs_subscribe.module \nodejs_subscribe_subscribe_node()

Page callback for subscribing/unsubscribing to a node.

1 string reference to 'nodejs_subscribe_subscribe_node'
nodejs_subscribe_menu in nodejs_subscribe/nodejs_subscribe.module
Implements hook_menu().

File

nodejs_subscribe/nodejs_subscribe.module, line 134

Code

function nodejs_subscribe_subscribe_node($node) {
  global $user;
  if (!nodejs_subscribe_is_user_subscribed_to_node($user->uid, $node->nid)) {
    nodejs_subscribe_insert($node, $user->uid);
    drupal_set_message(t("You have subscribed to '%node_title'.", array(
      '%node_title' => $node->title,
    )));
  }
  drupal_goto('node/' . $node->nid);
}