tripal_natural_diversity.module

  1. 2.x tripal_natural_diversity/tripal_natural_diversity.module
  2. 3.x legacy/tripal_natural_diversity/tripal_natural_diversity.module
  3. 1.x tripal_natural_diversity/tripal_natural_diversity.module

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:

tripal_natural_diversity Natural Diversity Module

See also

http://gmod.org/wiki/Chado_General_Module

File

tripal_natural_diversity/tripal_natural_diversity.module
View source
  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. * @defgroup tripal_natural_diversity Natural Diversity Module
  13. * @ingroup tripal_modules
  14. */
  15. /*************************************************************************
  16. * Implements hook_views_api()
  17. * Purpose: Essentially this hook tells drupal that there is views support for
  18. * for this module which then includes tripal_natural_diversity.views.inc where all the
  19. * views integration code is
  20. *
  21. * @ingroup tripal_natural_diversity
  22. */
  23. function tripal_natural_diversity_views_api() {
  24. return array(
  25. 'api' => 2.0,
  26. );
  27. }
  28. /**
  29. * Implements hook_theme
  30. *
  31. * @ingroup tripal_natural_diversity
  32. */
  33. function tripal_natural_diversity_theme() {
  34. return array(
  35. 'tripal_feature_nd_genotypes' => array(
  36. 'arguments' => array('node' => NULL),
  37. 'template' => 'tripal_feature_nd_genotypes',
  38. ),
  39. 'tripal_stock_nd_genotypes' => array(
  40. 'arguments' => array('node' => NULL),
  41. 'template' => 'tripal_stock_nd_genotypes',
  42. ),
  43. 'tripal_stock_nd_phenotypes' => array(
  44. 'arguments' => array('node' => NULL),
  45. 'template' => 'tripal_stock_nd_phenotypes',
  46. ),
  47. );
  48. }
  49. /**
  50. * Implements hook_nodeapi().
  51. *
  52. * @ingroup tripal_natural_diversity
  53. */
  54. function tripal_natural_diversity_nodeapi(&$node, $op, $teaser, $page){
  55. switch ($op) {
  56. case 'view':
  57. if ($node->type == 'chado_feature') {
  58. // the tripal_genetic module provides a tripal_feature_genotype
  59. // template. The only difference between them is the addition of
  60. // project information by this module's template. Therefore,
  61. // if the tripal_genetic content is present get rid of as this
  62. // module superceeds it.
  63. if (array_key_exists('tripal_feature_genotypes', $node->content)) {
  64. unset($node->content['tripal_feature_genotypes']);
  65. }
  66. $node->content['tripal_feature_nd_genotypes'] = array(
  67. '#value' => theme('tripal_feature_nd_genotypes', $node),
  68. );
  69. }
  70. if ($node->type == 'chado_stock') {
  71. $node->content['tripal_stock_nd_genotypes'] = array(
  72. '#value' => theme('tripal_stock_nd_genotypes', $node),
  73. );
  74. $node->content['tripal_stock_nd_phenotypes'] = array(
  75. '#value' => theme('tripal_stock_nd_phenotypes', $node),
  76. );
  77. }
  78. break;
  79. }
  80. }
  81. /**
  82. *
  83. *
  84. * @ingroup tripal_natural_diversity
  85. */
  86. function tripal_natural_diversity_preprocess_tripal_stock_nd_genotypes(&$variables){
  87. }

Related topics