tripal_views.module 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. require_once "tripal_views_integration_port.inc";
  6. /**
  7. * Implements hook_menu()
  8. *
  9. * Purpose: this hook provides details about new menu items added by this module
  10. *
  11. * @ingroup tripal_views
  12. */
  13. function tripal_views_menu() {
  14. $items = array();
  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. $items['admin/tripal/views/import'] = array(
  51. 'title' => 'Import Views Integration',
  52. 'page callback' => 'drupal_get_form',
  53. 'page arguments' => array('tripal_views_integration_import_form'),
  54. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  55. 'type' => MENU_NORMAL_ITEM,
  56. );
  57. $items['admin/tripal/views/integration/export/%'] = array(
  58. 'title' => 'Import Views Integration',
  59. 'page callback' => 'drupal_get_form',
  60. 'page arguments' => array('tripal_views_integration_export_form', 5),
  61. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  62. 'type' => MENU_CALLBACK,
  63. );
  64. return $items;
  65. }
  66. /**
  67. * Implements hook_views_api()
  68. *
  69. * Purpose: Set the permission types that the chado module uses.
  70. *
  71. * @ingroup tripal_views
  72. */
  73. function tripal_views_perm() {
  74. return array(
  75. 'manage tripal_views_integration',
  76. );
  77. }
  78. /**
  79. * Implements hook_views_api()
  80. *
  81. * Purpose: Essentially this hook tells drupal that there is views support for
  82. * for this module which then includes tripal_views.views.inc where all the
  83. * views integration code is
  84. *
  85. * @ingroup tripal_views
  86. */
  87. function tripal_views_views_api() {
  88. return array(
  89. 'api' => 2.0,
  90. );
  91. }
  92. /**
  93. * Implements hook_theme()
  94. *
  95. * Purpose: this hook provides details about themable objects added by
  96. * this module
  97. *
  98. * @ingroup tripal_views
  99. */
  100. function tripal_views_theme() {
  101. return array(
  102. 'tripal_views_integration_form' => array(
  103. 'arguments' => array('form' => NULL),
  104. 'template' => 'tripal_views_integration_fields_form',
  105. ),
  106. 'tripal_views_data_export_download_form' => array(
  107. 'arguments' => array('form' => NULL),
  108. 'template' => 'tripal_views_data_export_download_form',
  109. ),
  110. 'file_upload_combo' => array(
  111. 'arguments' => array('element' => NULL)
  112. ),
  113. );
  114. }
  115. /**
  116. * Implements hook_coder_ignore().
  117. * Defines the path to the file (tripal_views.coder_ignores.txt) where ignore rules for coder are stored
  118. */
  119. function tripal_views_coder_ignore() {
  120. return array(
  121. 'path' => drupal_get_path('module', 'tripal_views'),
  122. 'line prefix' => drupal_get_path('module', 'tripal_views'),
  123. );
  124. }