You are here

public function FrxDrupalControls::drupal_node_content in Forena Reports 7.3

Same name and namespace in other branches
  1. 6.2 plugins/FrxDrupalControls.inc \FrxDrupalControls::drupal_node_content()
  2. 7.5 plugins/FrxDrupalControls.inc \FrxDrupalControls::drupal_node_content()
  3. 7.2 plugins/FrxDrupalControls.inc \FrxDrupalControls::drupal_node_content()
  4. 7.4 plugins/FrxDrupalControls.inc \FrxDrupalControls::drupal_node_content()

File

plugins/FrxDrupalControls.inc, line 66
Provides data blocks for native drupal connections using the default drupal connections.

Class

FrxDrupalControls
@file Provides data blocks for native drupal connections using the default drupal connections.

Code

public function drupal_node_content($nid, $format) {
  $nid = @(int) $nid;
  $node = @node_load($nid, NULL, TRUE);
  if (!$node) {
    return '';
  }
  if (strcasecmp($format, 'teaser') === 0 || !$format) {
    $format = 'teaser';
  }
  else {
    $format = 'full';
  }

  //If true, render the teaser

  //else render the body
  $output = theme('node', node_view($node, $format));
  return $output;
}