123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <?php
- require_once 'theme/tripal_natural_diversity.theme.inc';
- require_once 'includes/tripal_natural_diversity.admin.inc';
- function tripal_natural_diversity_permission() {
- return array(
-
- );
- }
- function tripal_natural_diversity_menu() {
- $items = array();
-
-
- return $items;
- }
- function tripal_natural_diversity_views_api() {
- return array(
- 'api' => 3.0,
- );
- }
- function tripal_natural_diversity_theme($existing, $type, $theme, $path) {
- $core_path = drupal_get_path('module', 'tripal_core');
- $items = array(
-
- 'tripal_feature_nd_genotypes' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_feature_nd_genotypes',
- 'path' => "$path/theme/templates",
- ),
-
- 'tripal_stock_nd_genotypes' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_stock_nd_genotypes',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_stock_nd_phenotypes' => array(
- 'variables' => array('node' => NULL),
- 'template' => 'tripal_stock_nd_phenotypes',
- 'path' => "$path/theme/templates",
- ),
- 'tripal_natural_diversity_help' => array(
- 'template' => 'tripal_natural_diversity_help',
- 'variables' => array(NULL),
- 'path' => "$path/theme/templates",
- ),
- );
- return $items;
- }
- function tripal_natural_diversity_node_view($node, $view_mode, $langcode) {
- switch ($node->type) {
- case 'chado_feature':
- if ($view_mode == 'full') {
-
-
-
- if (array_key_exists('tripal_feature_genotypes', $node->content)) {
- unset($node->content['tripal_feature_genotypes']);
- }
- $node->content['tripal_feature_nd_genotypes'] = array(
- '#theme' => 'tripal_feature_nd_genotypes',
- '#node' => $node,
- '#tripal_toc_id' => 'genotypes',
- '#tripal_toc_title' => 'Genotypes',
- );
- }
- break;
- case 'chado_stock':
- if ($view_mode == 'full') {
-
-
-
- if (array_key_exists('tripal_stock_genotypes', $node->content)) {
- unset($node->content['tripal_stock_genotypes']);
- }
- $node->content['tripal_stock_nd_genotypes'] = array(
- '#theme' => 'tripal_stock_nd_genotypes',
- '#node' => $node,
- '#tripal_toc_id' => 'genotypes',
- '#tripal_toc_title' => 'Genotypes',
- );
- $node->content['tripal_stock_nd_phenotypes'] = array(
- '#theme' => 'tripal_stock_nd_phenotypes',
- '#node' => $node,
- '#tripal_toc_id' => 'phenotypes',
- '#tripal_toc_title' => 'Phenotypes',
- );
- }
- break;
- }
- }
|