function tripal_feature_node_view

2.x tripal_feature.chado_node.inc tripal_feature_node_view($node, $view_mode, $langcode)
3.x tripal_feature.chado_node.inc tripal_feature_node_view($node, $view_mode, $langcode)

Implements hook_node_view(). Acts on all content types.

Related topics

File

tripal_feature/includes/tripal_feature.chado_node.inc, line 840
Implementation of hooks to create a feature content type

Code

function tripal_feature_node_view($node, $view_mode, $langcode) {
  switch ($node->type) {
    case 'chado_feature':
      // Show feature browser and counts
      if ($view_mode == 'full') {
        $node->content['tripal_feature_alignments'] = array(
          '#theme' => 'tripal_feature_alignments',
          '#node' => $node,
          '#tripal_toc_id' => 'alignments',
          '#tripal_toc_title' => 'Alignments',
        );
        $node->content['tripal_feature_analyses'] = array(
          '#theme' => 'tripal_feature_analyses',
          '#node' => $node,
          '#tripal_toc_id' => 'analyses',
          '#tripal_toc_title' => 'Analyses',
        );
        $node->content['tripal_feature_base'] = array(
          '#theme' => 'tripal_feature_base',
          '#node' => $node,
          '#tripal_toc_id' => 'base',
          '#tripal_toc_title' => 'Overview',
          '#weight' => -100,
        );
        $node->content['tripal_feature_properties'] = array(
          '#theme' => 'tripal_feature_properties',
          '#node' => $node,
          '#tripal_toc_id' => 'properties',
          '#tripal_toc_title' => 'Properties',
        );
        $node->content['tripal_feature_publications'] = array(
          '#theme' => 'tripal_feature_publications',
          '#node' => $node,
          '#tripal_toc_id' => 'publications',
          '#tripal_toc_title' => 'Publications',
        );
        $node->content['tripal_feature_references'] = array(
          '#theme' => 'tripal_feature_references',
          '#node' => $node,
          '#tripal_toc_id' => 'references',
          '#tripal_toc_title' => 'Cross References',
        );
        $node->content['tripal_feature_relationships'] = array(
          '#theme' => 'tripal_feature_relationships',
          '#node' => $node,
          '#tripal_toc_id' => 'relationships',
          '#tripal_toc_title' => 'Relationships',
        );
        $node->content['tripal_feature_seqence'] = array(
          '#theme' => 'tripal_feature_sequence',
          '#node' => $node,
          '#tripal_toc_id' => 'sequences',
          '#tripal_toc_title' => 'Sequences',
        );
        $node->content['tripal_feature_synonyms'] = array(
          '#theme' => 'tripal_feature_synonyms',
          '#node' => $node,
          '#tripal_toc_id' => 'synonyms',
          '#tripal_toc_title' => 'Synonyms',
        );
        $node->content['tripal_feature_terms'] = array(
          '#theme' => 'tripal_feature_terms',
          '#node' => $node,
          '#tripal_toc_id' => 'terms',
          '#tripal_toc_title' => 'Annotated Terms',
        );
      }
      if ($view_mode == 'teaser') {
        $node->content['tripal_feature_teaser'] = array(
          '#theme' => 'tripal_feature_teaser',
          '#node' => $node,
        );
      }
      break;
    case 'chado_organism':
      // Show feature browser and counts
      if ($view_mode == 'full') {
        $node->content['tripal_organism_feature_counts'] = array(
          '#theme' => 'tripal_organism_feature_counts',
          '#node' => $node,
          '#tripal_toc_id' => 'feature_counts',
          '#tripal_toc_title' => 'Feature Summary',
        );
        $node->content['tripal_organism_feature_browser'] = array(
          '#theme' => 'tripal_organism_feature_browser',
          '#node' => $node,
          '#tripal_toc_id' => 'feature_browser',
          '#tripal_toc_title' => 'Feature Browser',
        );
      }
      break;
      // TODO: handle these node types. Should we also have a feature browser?
    case 'chado_library':
      break;
    case 'chado_stock':
      break;
    case 'chado_analysis':
      break;
  }
}