12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- /**
- * @file
- * This file contains the basic functions needed for this drupal module.
- * The drupal tripal_genetic 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_genetic Genetic Module
- * @ingroup tripal_modules
- */
- require('api/tripal_genetic.api.inc');
- require('includes/tripal_genetic.schema.inc');
- /*************************************************************************
- * 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' => 2.0,
- );
- }
- /**
- * Implements hook_theme().
- *
- * @ingroup tripal_genetic
- */
- function tripal_genetic_theme() {
- return array(
- 'tripal_feature_genotypes' => array(
- 'arguments' => array('node' => NULL),
- 'template' => 'tripal_feature_genotypes',
- ),
- 'tripal_stock_genotypes' => array(
- 'arguments' => array('node' => NULL),
- 'template' => 'tripal_stock_genotypes',
- ),
- );
- }
- /**
- * Implements hook_nodeapi().
- *
- * @ingroup tripal_genetic
- */
- function tripal_genetic_nodeapi(&$node, $op, $teaser, $page) {
- switch ($op) {
- case 'view':
- 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 this 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 (!array_key_exists('tripal_feature_nd_genotypes', $node->content)) {
- $node->content['tripal_feature_genotypes'] = array(
- '#value' => theme('tripal_feature_genotypes', $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 this 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 (!array_key_exists('tripal_stock_nd_genotypes', $node->content)) {
- $node->content['tripal_stock_genotypes'] = array(
- '#value' => theme('tripal_stock_genotypes', $node),
- );
- }
- }
- break;
- }
- }
|