'Genetics', 'description' => 'Genetic data including Genotypes.', 'page callback' => 'tripal_genetic_admin_genetics_listing', 'access arguments' => array('adminster tripal genetic'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/chado/tripal_genetic/help'] = array( 'title' => 'Help', 'description' => "A description of the Tripal genetic module including a short description of it's usage.", 'page callback' => 'theme', 'page arguments' => array('tripal_genetic_help'), 'access arguments' => array('adminster tripal genetic'), 'type' => MENU_LOCAL_TASK, ); $items['admin/tripal/chado/tripal_genetic/views/genetics/enable'] = array( 'title' => 'Enable genetic Administrative View', 'page callback' => 'tripal_views_admin_enable_view', 'page arguments' => array('tripal_genetic_admin_genetics', 'admin/tripal/chado/tripal_genetic'), 'access arguments' => array('administer tripal genetic'), 'type' => MENU_CALLBACK, ); return $items; } /** * Implements hook_views_api() * Purpose: Essentially this hook tells drupal that there is views support for * for this module which then includes tripal_genetic.views.inc where all the * views integration code is * * @ingroup tripal_genetic */ function tripal_genetic_views_api() { return array( 'api' => 3.0, ); } /** * Implements hook_theme(). * * @ingroup tripal_genetic */ function tripal_genetic_theme($existing, $type, $theme, $path) { $core_path = drupal_get_path('module', 'tripal_core'); $items = array( 'tripal_feature_genotypes' => array( 'variables' => array('node' => NULL), 'template' => 'tripal_feature.genotypes', 'path' => "$path/theme/tripal_feature", ), 'tripal_stock_genotypes' => array( 'variables' => array('node' => NULL), 'template' => 'tripal_stock.genotypes', 'path' => "$path/theme/tripal_stock", ), 'tripal_genetic_help' => array( 'template' => 'tripal_genetic.help', 'variables' => array(NULL), 'path' => "$path/theme/", ), ); return $items; } /** * Implements hook_nodeapi(). * * @ingroup tripal_genetic */ function tripal_genetic_node_view($node, $view_mode, $langcode) { if ($node->type == 'chado_feature') { // the tripal_natural_diversity module provides a tripal_feature_nd_genotype // template. The only difference between them is the addition of // project information by the ND module's template. Therefore, // if the tripal_natural_diversity content is present then don't add the // template from this module as the ND module would superceed this. if ($view_mode == 'full') { if (!array_key_exists('tripal_feature_nd_genotypes', $node->content)) { $node->content['tripal_feature_genotypes'] = array( '#value' => theme('tripal_feature_genotypes', array('node' => $node)), ); } } } if ($node->type == 'chado_stock') { // the tripal_natural_diversity module provides a tripal_stock_nd_genotype // template. The only difference between them is the addition of // project information by the ND module's template. Therefore, // if the tripal_natural_diversity content is present then don't add the // template from this module as the ND module would superceed this. if ($view_mode == 'full') { if (!array_key_exists('tripal_stock_nd_genotypes', $node->content)) { $node->content['tripal_stock_genotypes'] = array( '#value' => theme('tripal_stock_genotypes', array('node' => $node)), ); } } } }