123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
- require_once('api/tripal_natural_diversity.api.inc');
- require_once('includes/tripal_natural_diversity.schema.inc');
- /**
- * @file
- * This file contains the basic functions needed for this drupal module.
- * The drupal tripal_natural_diversity module maps directly to the chado X module.
- *
- * For documentation regarding the Chado X module:
- * @see http://gmod.org/wiki/Chado_General_Module
- *
- * @defgroup tripal_natural_diversity Natural Diversity Module
- * @ingroup tripal_modules
- */
- /*************************************************************************
- * Implements hook_views_api()
- * Purpose: Essentially this hook tells drupal that there is views support for
- * for this module which then includes tripal_natural_diversity.views.inc where all the
- * views integration code is
- *
- * @ingroup tripal_natural_diversity
- */
- function tripal_natural_diversity_views_api() {
- return array(
- 'api' => 2.0,
- );
- }
- /**
- * Implements hook_theme
- *
- * @ingroup tripal_natural_diversity
- */
- function tripal_natural_diversity_theme() {
- return array(
- 'tripal_feature_nd_genotypes' => array(
- 'arguments' => array('node' => NULL),
- 'template' => 'tripal_feature_nd_genotypes',
- ),
- 'tripal_stock_nd_genotypes' => array(
- 'arguments' => array('node' => NULL),
- 'template' => 'tripal_stock_nd_genotypes',
- ),
- 'tripal_stock_nd_phenotypes' => array(
- 'arguments' => array('node' => NULL),
- 'template' => 'tripal_stock_nd_phenotypes',
- ),
- 'tripal_stock_nd_locations' => array(
- 'arguments' => array('node' => NULL),
- 'template' => 'tripal_stock_nd_locations',
- ),
- );
- }
- /**
- * Implements hook_nodeapi().
- *
- * @ingroup tripal_natural_diversity
- */
- function tripal_natural_diversity_nodeapi(&$node, $op, $teaser, $page){
- switch ($op) {
- case 'view':
- if ($node->type == 'chado_feature') {
- // the tripal_genetic module provides a tripal_feature_genotype
- // template. The only difference between them is the addition of
- // project information by this module's template. Therefore,
- // if the tripal_genetic content is present get rid of as this
- // module superceeds it.
- if (array_key_exists('tripal_feature_genotypes', $node->content)) {
- unset($node->content['tripal_feature_genotypes']);
- }
- $node->content['tripal_feature_nd_genotypes'] = array(
- '#value' => theme('tripal_feature_nd_genotypes', $node),
- );
- }
- if ($node->type == 'chado_stock') {
- $node->content['tripal_stock_nd_genotypes'] = array(
- '#value' => theme('tripal_stock_nd_genotypes', $node),
- );
- $node->content['tripal_stock_nd_phenotypes'] = array(
- '#value' => theme('tripal_stock_nd_phenotypes', $node),
- );
- $node->content['tripal_stock_nd_locations'] = array(
- '#value' => theme('tripal_stock_nd_locations', $node),
- );
- }
- break;
- }
- }
- /**
- *
- *
- * @ingroup tripal_natural_diversity
- */
- function tripal_natural_diversity_preprocess_tripal_stock_nd_genotypes(&$variables){
- }
|