Tripal v1.0 (6.x-1.0)
|
00001 <?php 00002 00012 require('api/tripal_genetic.api.inc'); 00013 require('includes/tripal_genetic.schema.inc'); 00014 00015 00016 /************************************************************************* 00017 * Implements hook_views_api() 00018 * Purpose: Essentially this hook tells drupal that there is views support for 00019 * for this module which then includes tripal_genetic.views.inc where all the 00020 * views integration code is 00021 */ 00022 function tripal_genetic_views_api() { 00023 return array( 00024 'api' => 2.0, 00025 ); 00026 } 00027 00028 /* 00029 * 00030 */ 00031 function tripal_genetic_theme() { 00032 return array( 00033 'tripal_feature_genotypes' => array( 00034 'arguments' => array('node' => NULL), 00035 'template' => 'tripal_feature_genotypes', 00036 ), 00037 ); 00038 } 00039 00043 function tripal_genetic_nodeapi(&$node, $op, $teaser, $page) { 00044 switch ($op) { 00045 case 'view': 00046 if ($node->type == 'chado_feature') { 00047 // the tripal_natural_diversity module provides a tripal_feature_nd_genotype 00048 // template. The only difference between them is the addition of 00049 // project information by this ND module's template. Therefore, 00050 // if the tripal_natural_diversity content is present then don't add the 00051 // template from this module as the ND module would superceed this. 00052 if (!array_key_exists('tripal_feature_nd_genotypes', $node->content)) { 00053 $node->content['tripal_feature_genotypes'] = array( 00054 '#value' => theme('tripal_feature_genotypes', $node), 00055 ); 00056 } 00057 } 00058 } 00059 }