tripal_genetic.module 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions needed for this drupal module.
  5. * The drupal tripal_genetic module maps directly to the chado X module.
  6. *
  7. * For documentation regarding the Chado X module:
  8. * @see http://gmod.org/wiki/Chado_General_Module
  9. */
  10. require('tripal_genetic.api.inc');
  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_genetic.views.inc where all the
  15. * views integration code is
  16. */
  17. function tripal_genetic_views_api() {
  18. return array(
  19. 'api' => 2.0,
  20. );
  21. }
  22. function tripal_genetic_theme() {
  23. return array(
  24. 'tripal_feature_genotypes' => array (
  25. 'arguments' => array('node'=> null),
  26. 'template' => 'tripal_feature_genotypes',
  27. ),
  28. );
  29. }
  30. /**
  31. *
  32. */
  33. function tripal_genetic_nodeapi (&$node, $op, $teaser, $page) {
  34. switch ($op) {
  35. case 'view':
  36. if ($node->type == 'chado_feature') {
  37. $node->content['tripal_feature_genotypes'] = array(
  38. '#value' => theme('tripal_feature_genotypes', $node),
  39. );
  40. }
  41. }
  42. }
  43. /**
  44. *
  45. */
  46. function tripal_genetic_preprocess_tripal_feature_genotypes(&$variables){
  47. $feature = $variables['node']->feature;
  48. $variables['tripal_feature']['genotypes'] = tripal_genetic_get_genotypes_by_feature_id($feature->feature_id);
  49. }