tripal_views.module 3.0 KB

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