tripal_views.module 3.1 KB

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