You are here

function _easychart_render_node in Easychart 7

Same name and namespace in other branches
  1. 7.2 easychart.module \_easychart_render_node()

Provides the replacement html to be rendered in place of the embed code.

Does not handle nested embeds.

Parameters

array $matches: numeric node id that has been captured by preg_replace_callback

Return value

string The rendered HTML replacing the embed code

1 string reference to '_easychart_render_node'
easychart_filter_easychart_process in ./easychart.module
Process callback for hook_filter

File

./easychart.module, line 578
Easy Chart module file.

Code

function _easychart_render_node($matches) {
  $node = node_load($matches[1]);
  if ($node == FALSE || !node_access('view', $node) || !$node->status) {
    return "[[chart-nid:{$matches[1]}]]";
  }
  else {
    $view = node_view($node);
    $render = drupal_render($view);
    return $render;
  }
}