tripal_natural_diversity.install 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * @file
  4. * Implements hooks from the Schema API
  5. */
  6. /**
  7. * Implementation of hook_requirements().
  8. */
  9. function tripal_natural_diversity_requirements($phase) {
  10. $requirements = array();
  11. if ($phase == 'install') {
  12. // make sure chado is installed
  13. if (!tripal_core_is_chado_installed()) {
  14. $requirements ['tripal_natural_diversity'] = array(
  15. 'title' => "tripal_natural_diversity",
  16. 'value' => "ERROR: Chado most be installed before this module can be enabled",
  17. 'severity' => REQUIREMENT_ERROR,
  18. );
  19. }
  20. }
  21. return $requirements;
  22. }
  23. /**
  24. * Implementation of hook_install().
  25. */
  26. function tripal_natural_diversity_install() {
  27. // create the module's data directory
  28. tripal_create_moddir('tripal_natural_diversity');
  29. // add cvterms
  30. tripal_natural_diversity_add_cvterms();
  31. }
  32. /**
  33. * Implementation of hook_uninstall().
  34. */
  35. function tripal_natural_diversity_uninstall() {
  36. }
  37. /*
  38. *
  39. */
  40. function tripal_natural_diversity_add_cvterms(){
  41. // add cvterms for the nd_experiment_types
  42. tripal_cv_add_cvterm(array('name' => 'Genotyping','def' => 'An experiment where genotypes of individuals are identified.'),
  43. 'nd_experiment_types', 0, 1, 'tripal');
  44. tripal_cv_add_cvterm(array('name' => 'Phenotyping','def' => 'An experiment where phenotypes of individuals are identified.'),
  45. 'nd_experiment_types', 0, 1, 'tripal');
  46. tripal_cv_add_cvterm(array('name' => 'Location','def' => 'The name of the location.'),
  47. 'nd_geolocation_property', 0, 1, 'tripal');
  48. }