tripal_db.install 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * @file
  4. * Contains functions related to the installation of this module
  5. */
  6. /**
  7. * Disable default views when module is disabled
  8. */
  9. function tripal_db_disable() {
  10. // Disable all default views provided by this module
  11. require_once("tripal_db.views_default.inc");
  12. $views = tripal_db_views_default_views();
  13. foreach (array_keys($views) as $view_name) {
  14. tripal_views_admin_disable_view($view_name,FALSE,array('suppress_error' => TRUE));
  15. }
  16. }
  17. /**
  18. * Implementation of hook_requirements().
  19. */
  20. function tripal_db_requirements($phase) {
  21. $requirements = array();
  22. if ($phase == 'install') {
  23. // make sure chado is installed
  24. if (!$GLOBALS["chado_is_installed"]) {
  25. $requirements ['tripal_db'] = array(
  26. 'title' => "tripal_db",
  27. 'value' => "ERROR: Chado must be installed before this module can be enabled",
  28. 'severity' => REQUIREMENT_ERROR,
  29. );
  30. }
  31. }
  32. return $requirements;
  33. }
  34. /**
  35. * Implementation of hook_install().
  36. *
  37. * @ingroup tripal_db
  38. */
  39. function tripal_db_install() {
  40. // create the module's data directory
  41. tripal_create_moddir('tripal_db');
  42. }
  43. /**
  44. * Implementation of hook_uninstall().
  45. *
  46. * @ingroup tripal_db
  47. */
  48. function tripal_db_uninstall() {
  49. }