tripal_db.install 1.2 KB

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