Tripal v1.0 (6.x-1.0)
|
00001 <?php 00002 00003 require_once('api/tripal_natural_diversity.api.inc'); 00004 require_once('includes/tripal_natural_diversity.schema.inc'); 00005 00015 /************************************************************************* 00016 * Implements hook_views_api() 00017 * Purpose: Essentially this hook tells drupal that there is views support for 00018 * for this module which then includes tripal_natural_diversity.views.inc where all the 00019 * views integration code is 00020 */ 00021 function tripal_natural_diversity_views_api() { 00022 return array( 00023 'api' => 2.0, 00024 ); 00025 } 00026 00030 function tripal_natural_diversity_theme() { 00031 return array( 00032 'tripal_feature_nd_genotypes' => array( 00033 'arguments' => array('node' => NULL), 00034 'template' => 'tripal_feature_nd_genotypes', 00035 ), 00036 'tripal_stock_nd_genotypes' => array( 00037 'arguments' => array('node' => NULL), 00038 'template' => 'tripal_stock_nd_genotypes', 00039 ), 00040 'tripal_stock_nd_phenotypes' => array( 00041 'arguments' => array('node' => NULL), 00042 'template' => 'tripal_stock_nd_phenotypes', 00043 ), 00044 'tripal_stock_nd_locations' => array( 00045 'arguments' => array('node' => NULL), 00046 'template' => 'tripal_stock_nd_locations', 00047 ), 00048 ); 00049 } 00050 00051 /* 00052 * 00053 */ 00054 function tripal_natural_diversity_nodeapi(&$node, $op, $teaser, $page){ 00055 switch ($op) { 00056 case 'view': 00057 if ($node->type == 'chado_feature') { 00058 // the tripal_genetic module provides a tripal_feature_genotype 00059 // template. The only difference between them is the addition of 00060 // project information by this module's template. Therefore, 00061 // if the tripal_genetic content is present get rid of as this 00062 // module superceeds it. 00063 if (array_key_exists('tripal_feature_genotypes', $node->content)) { 00064 unset($node->content['tripal_feature_genotypes']); 00065 } 00066 $node->content['tripal_feature_nd_genotypes'] = array( 00067 '#value' => theme('tripal_feature_nd_genotypes', $node), 00068 ); 00069 } 00070 if ($node->type == 'chado_stock') { 00071 $node->content['tripal_stock_nd_genotypes'] = array( 00072 '#value' => theme('tripal_stock_nd_genotypes', $node), 00073 ); 00074 $node->content['tripal_stock_nd_phenotypes'] = array( 00075 '#value' => theme('tripal_stock_nd_phenotypes', $node), 00076 ); 00077 $node->content['tripal_stock_nd_locations'] = array( 00078 '#value' => theme('tripal_stock_nd_locations', $node), 00079 ); 00080 } 00081 break; 00082 } 00083 } 00084 00085 /* 00086 * 00087 */ 00088 function tripal_natural_diversity_preprocess_tripal_stock_nd_genotypes(&$variables){ 00089 00090 }