tripal_natural_diversity.module 1.7 KB

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