You are here

function oa_core_node_token_render in Open Atrium Core 7.2

Render callback for the node token pane.

1 string reference to 'oa_core_node_token_render'
oa_core_node_token.inc in plugins/content_types/oa_core_node_token.inc

File

plugins/content_types/oa_core_node_token.inc, line 26

Code

function oa_core_node_token_render($subtype, $conf, $args, $context = NULL) {
  if (empty($context->data->nid) || !node_access('view', $context->data)) {
    return;
  }
  $node = $context->data;
  $block = new stdClass();
  $block->title = token_replace($conf['token_title'], array(
    'node' => $node,
  ));
  $body = isset($conf['token_body']['value']) ? $conf['token_body']['value'] : '';
  $vars['body'] = token_replace($body, array(
    'node' => $node,
  ));
  $block->content = theme('oa_core_node_token', $vars);
  return $block;
}