You are here

function _easychart_wysiwyg_render_node in Easychart 7.3

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_wysiwyg_render_node'
easychart_wysiwyg_filter_easychart_process in modules/easychart_wysiwyg/easychart_wysiwyg.module
Process callback for hook_filter

File

modules/easychart_wysiwyg/easychart_wysiwyg.module, line 206
Easychart WYSIWYG integration.

Code

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