tripal_natural_diversity.module 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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_nd_genotypes' => array(
  29. 'arguments' => array('node' => NULL),
  30. 'template' => 'tripal_feature_nd_genotypes',
  31. ),
  32. 'tripal_stock_nd_genotypes' => array(
  33. 'arguments' => array('node' => NULL),
  34. 'template' => 'tripal_stock_nd_genotypes',
  35. ),
  36. 'tripal_stock_nd_phenotypes' => array(
  37. 'arguments' => array('node' => NULL),
  38. 'template' => 'tripal_stock_nd_phenotypes',
  39. ),
  40. 'tripal_stock_nd_locations' => array(
  41. 'arguments' => array('node' => NULL),
  42. 'template' => 'tripal_stock_nd_locations',
  43. ),
  44. );
  45. }
  46. /*
  47. *
  48. */
  49. function tripal_natural_diversity_nodeapi(&$node, $op, $teaser, $page){
  50. switch ($op) {
  51. case 'view':
  52. if ($node->type == 'chado_feature') {
  53. $node->content['tripal_feature_nd_genotypes'] = array(
  54. '#value' => theme('tripal_feature_nd_genotypes', $node),
  55. );
  56. }
  57. if ($node->type == 'chado_stock') {
  58. $node->content['tripal_stock_nd_genotypes'] = array(
  59. '#value' => theme('tripal_stock_nd_genotypes', $node),
  60. );
  61. $node->content['tripal_stock_nd_phenotypes'] = array(
  62. '#value' => theme('tripal_stock_nd_phenotypes', $node),
  63. );
  64. $node->content['tripal_stock_nd_locations'] = array(
  65. '#value' => theme('tripal_stock_nd_locations', $node),
  66. );
  67. }
  68. break;
  69. }
  70. }
  71. /*
  72. *
  73. */
  74. function tripal_natural_diversity_preprocess_tripal_stock_nd_genotypes(&$variables){
  75. }