You are here

function flashnode_view in Flash Node 5.2

Same name and namespace in other branches
  1. 5.6 flashnode.module \flashnode_view()
  2. 5.3 flashnode.module \flashnode_view()
  3. 6.3 flashnode.module \flashnode_view()
  4. 6.2 flashnode.module \flashnode_view()

Implementation of hook_view

File

./flashnode.module, line 451

Code

function flashnode_view($node, $teaser, $page = 0) {

  // Run through the filters before adding in code, so that <script> is not intercepted
  $node = node_prepare($node, $teaser);

  // Prepare markup of substitution content by running through node filter
  $node->flashnode['substitution'] = check_markup($node->flashnode['substitution'], $node->format, FALSE);

  // Check if PHP processing of flashvars is needed
  $node->flashnode['flashvars'] = _flashnode_php_flashvars($node->flashnode['flashvars'], $node->format);

  // Call flashnode_display to produce the HTML string
  $flash = flashnode_display($node->flashnode);

  // If we're not in body only mode add flash if a teaser was requested
  if ($node->flashnode['display'] != 2 && $teaser) {
    $node->content['body']['#value'] = $flash . $node->content['body']['#value'];
  }

  // If we're not in teaser only mode add flash if the body was requested
  if ($node->flashnode['display'] != 1 && !$teaser) {
    $node->content['body']['#value'] = $flash . $node->content['body']['#value'];
  }

  // Return the amended node
  return $node;
}