You are here

function hook_views_autorefresh_nodejs_message_alter in Views Auto-Refresh 7.2

Same name and namespace in other branches
  1. 7 views_autorefresh.api.php \hook_views_autorefresh_nodejs_message_alter()

Alter the node.js message that gets sent to a view.

Parameters

Object message: A node.js message consisting of:

  • channel: the channel name
  • callback: the JavaScript node.js callback
  • view_name: the name of the view being notified

Mixed $context: Any additional context that the caller cares to send to allow the message altering hook to perform its logic.

1 invocation of hook_views_autorefresh_nodejs_message_alter()
views_autorefresh_nodejs_refresh in ./views_autorefresh.module
Refreshes a view through nodejs.

File

./views_autorefresh.api.php, line 36
API documentation for the Views Auto-Refresh module.

Code

function hook_views_autorefresh_nodejs_message_alter(&$message, $context) {
  if ($message->view_name == 'story_activity-page_1' && is_object($context) && !empty($context->nid)) {
    $message->channel .= '-' . $context->nid;
  }
}