tripal_natural_diversity.module 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. require_once('api/tripal_natural_diversity.api.inc');
  3. require_once('includes/tripal_natural_diversity.schema.inc');
  4. /**
  5. * @file
  6. * This file contains the basic functions needed for this drupal module.
  7. * The drupal tripal_natural_diversity module maps directly to the chado X module.
  8. *
  9. * For documentation regarding the Chado X module:
  10. * @see http://gmod.org/wiki/Chado_General_Module
  11. */
  12. /*************************************************************************
  13. * Implements hook_views_api()
  14. * Purpose: Essentially this hook tells drupal that there is views support for
  15. * for this module which then includes tripal_natural_diversity.views.inc where all the
  16. * views integration code is
  17. */
  18. function tripal_natural_diversity_views_api() {
  19. return array(
  20. 'api' => 2.0,
  21. );
  22. }
  23. /**
  24. * Implements hook_theme
  25. */
  26. function tripal_natural_diversity_theme() {
  27. return array(
  28. 'tripal_feature_genotype_experiments' => array(
  29. 'arguments' => array('node' => NULL),
  30. 'template' => 'tripal_feature-genotype_experiments',
  31. ),
  32. 'tripal_stock_genotype_experiments' => array(
  33. 'arguments' => array('node' => NULL),
  34. 'template' => 'tripal_feature-stock_experiments',
  35. ),
  36. );
  37. }
  38. /**
  39. *
  40. */
  41. function tripal_natural_diversity_nodeapi(&$node, $op, $teaser, $page) {
  42. switch ($op) {
  43. case 'view':
  44. if ($node->type == 'chado_feature') {
  45. $node->content['tripal_feature_genotype_experiments'] = array(
  46. '#value' => theme('tripal_feature_genotype_experiments', $node),
  47. );
  48. }
  49. elseif ($node->type == 'chado_stock') {
  50. $node->content['tripal_stock_genotype_experiments'] = array(
  51. '#value' => theme('tripal_stock_genotype_experiments', $node),
  52. );
  53. }
  54. }
  55. }