function tripal_stock_node_view

2.x tripal_stock.chado_node.inc tripal_stock_node_view($node, $view_mode, $langcode)
3.x tripal_stock.chado_node.inc tripal_stock_node_view($node, $view_mode, $langcode)

Implements hook_node_view(). Acts on all content types.

Related topics

File

tripal_stock/includes/tripal_stock.chado_node.inc, line 788
Stock Node Functionality

Code

function tripal_stock_node_view($node, $view_mode, $langcode) {

  switch ($node->type) {
    case 'chado_stock':
      if ($view_mode == 'full') {
        $node->content['tripal_stock_base'] = array(
          '#theme' => 'tripal_stock_base',
          '#node' => $node,
          '#tripal_toc_id' => 'base',
          '#tripal_toc_title' => 'Overview',
          '#weight' => -100,
        );
        $node->content['tripal_stock_collections'] = array(
          '#theme' => 'tripal_stock_collections',
          '#node' => $node,
          '#tripal_toc_id' => 'collections',
          '#tripal_toc_title' => 'Stock Collections',
        );
        $node->content['tripal_stock_properties'] = array(
          '#theme' => 'tripal_stock_properties',
          '#node' => $node,
          '#tripal_toc_id' => 'properties',
          '#tripal_toc_title' => 'Properties',
        );
        $node->content['tripal_stock_references'] = array(
          '#theme' => 'tripal_stock_references',
          '#node' => $node,
          '#tripal_toc_id' => 'references',
          '#tripal_toc_title' => 'Cross References',
        );
        $node->content['tripal_stock_relationships'] = array(
          '#theme' => 'tripal_stock_relationships',
          '#node' => $node,
          '#tripal_toc_id' => 'relationships',
          '#tripal_toc_title' => 'Relationships',
        );
        $node->content['tripal_stock_synonyms'] = array(
          '#theme' => 'tripal_stock_synonyms',
          '#node' => $node,
          '#tripal_toc_id' => 'synonyms',
          '#tripal_toc_title' => 'Synonyms',
        );
        $node->content['tripal_stock_publications'] = array(
          '#theme' => 'tripal_stock_publications',
          '#node' => $node,
          '#tripal_toc_id' => 'publications',
          '#tripal_toc_title' => 'Publications',
        );
      }
      if ($view_mode == 'teaser') {
        $node->content['tripal_stock_teaser'] = array(
          '#theme' => 'tripal_stock_teaser',
          '#node' => $node,
        );
      }
      break;
    case 'chado_organism':
      if ($view_mode == 'full') {
        $node->content['tripal_organism_stocks'] = array(
          '#theme' => 'tripal_organism_stocks',
          '#node' => $node,
          '#tripal_toc_id' => 'stocks',
          '#tripal_toc_title' => 'Stocks',
        );
      }
      break;
  }
}