tripal_views.module 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. require_once "tripal_views_integration.inc";
  3. require_once "tripal_views.views.inc";
  4. require_once "tripal_views_form_elements.inc";
  5. /**
  6. * Implements hook_menu()
  7. *
  8. * Purpose: this hook provides details about new menu items added by this module
  9. *
  10. * @ingroup tripal_views
  11. */
  12. function tripal_views_menu() {
  13. $items = array();
  14. /**
  15. $items['admin/tripal/views'] = array(
  16. 'title' => 'Views Integration',
  17. 'description' => 'Integration with Drupal Views',
  18. 'page callback' => 'tripal_views_description_page',
  19. 'access arguments' => array('administer site configuration'),
  20. 'type' => MENU_NORMAL_ITEM,
  21. );
  22. $items['admin/tripal/views/integration'] = array(
  23. 'title' => 'Integrated Tables',
  24. 'description' => 'Provide a list of all integrated tables and allows for adding new tables or editing already integrated tables.',
  25. 'page callback' => 'tripal_views_integration_setup_list',
  26. 'access arguments' => array('manage tripal_views_integration'),
  27. 'type' => MENU_NORMAL_ITEM,
  28. );
  29. $items['admin/tripal/views/integration/new'] = array(
  30. 'title' => 'Integrate Views',
  31. 'page callback' => 'drupal_get_form',
  32. 'page arguments' => array('tripal_views_integration_form'),
  33. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  34. 'type' => MENU_CALLBACK,
  35. );
  36. $items['admin/tripal/views/integration/edit/%'] = array(
  37. 'title' => 'Edit Views Integration',
  38. 'page callback' => 'drupal_get_form',
  39. 'page arguments' => array('tripal_views_integration_form', 5),
  40. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  41. 'type' => MENU_CALLBACK,
  42. );
  43. $items['admin/tripal/views/integration/delete/%'] = array(
  44. 'title' => 'Delete Views Integration',
  45. 'page callback' => 'tripal_views_integration_delete',
  46. 'page arguments' => array(5),
  47. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  48. 'type' => MENU_CALLBACK,
  49. );
  50. */
  51. return $items;
  52. }
  53. /**
  54. * Implements hook_views_api()
  55. *
  56. * Purpose: Set the permission types that the chado module uses.
  57. *
  58. * @ingroup tripal_views
  59. */
  60. function tripal_views_perm() {
  61. return array(
  62. 'manage tripal_views_integration',
  63. );
  64. }
  65. /**
  66. * Implements hook_views_api()
  67. *
  68. * Purpose: Essentially this hook tells drupal that there is views support for
  69. * for this module which then includes tripal_views.views.inc where all the
  70. * views integration code is
  71. *
  72. * @ingroup tripal_views
  73. */
  74. function tripal_views_views_api() {
  75. return array(
  76. 'api' => 2.0,
  77. );
  78. }
  79. /**
  80. * Implements hook_theme()
  81. *
  82. * Purpose: this hook provides details about themable objects added by
  83. * this module
  84. *
  85. * @ingroup tripal_views
  86. */
  87. function tripal_views_theme() {
  88. return array(
  89. 'tripal_views_integration_form' => array(
  90. 'arguments' => array('form' => NULL),
  91. 'template' => 'tripal_views_integration_fields_form',
  92. ),
  93. 'tripal_views_data_export_download_form' => array(
  94. 'arguments' => array('form' => NULL),
  95. 'template' => 'tripal_views_data_export_download_form',
  96. ),
  97. 'file_upload_combo' => array(
  98. 'arguments' => array('element' => NULL)
  99. ),
  100. );
  101. }