You are here

function flashnode_view in Flash Node 6.3

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

Implementation of hook_view

File

./flashnode.module, line 514

Code

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

  // Run through the filters before adding in code, so that markup for Flash 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);

  // Generate the array to add to the node for display
  $flash_content = array(
    '#value' => theme('flashnode', $node->flashnode, $teaser),
    '#weight' => variable_get('flashnode_weight', FLASHNODE_DEFAULT_WEIGHT),
  );

  // If we're not in body only mode add flash if a teaser was requested

  //if ($node->flashnode['display'] != FLASHNODE_BODY_ONLY && $teaser) {
  if ($node->flashnode['display'] != FLASHNODE_BODY_ONLY && $node->flashnode['display'] != FLASHNODE_DO_NOT_DISPLAY && $teaser) {
    $node->content['flashnode'] = $flash_content;
  }

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

  // Return the amended node
  return $node;
}