You are here

function sheetnode_view in Sheetnode 5

Same name and namespace in other branches
  1. 6 sheetnode.module \sheetnode_view()
  2. 7.2 sheetnode.module \sheetnode_view()
  3. 7 sheetnode.module \sheetnode_view()

Implementation of hook_view().

File

./sheetnode.module, line 184

Code

function sheetnode_view($node, $teaser = FALSE, $page = FALSE) {
  $node = node_prepare($node, $teaser);

  // SocialCalc sheet.
  if (!$teaser) {
    $value = _sheetnode_load($node->nid, $node->vid);
    $output = _sheetnode_inject($value, FALSE, array(
      'entity-name' => 'node',
      'oid' => $node->nid,
    ));
    $node->content['sheet'] = array(
      '#value' => $output,
      '#weight' => -1,
    );
  }
  return $node;
}