tripal_views.module 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. require_once "tripal_views.views.inc";
  3. require_once "includes/tripal_views_integration.inc";
  4. require_once "includes/tripal_views_form_elements.inc";
  5. require_once "includes/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/list'] = array(
  23. 'title' => 'List of 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. 'weight' => 0,
  29. );
  30. $items['admin/tripal/views/integration/new'] = array(
  31. 'title' => 'Integrate A Table',
  32. 'page callback' => 'drupal_get_form',
  33. 'page arguments' => array('tripal_views_integration_form'),
  34. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  35. 'type' => MENU_NORMAL_ITEM,
  36. );
  37. $items['admin/tripal/views/integration/edit/%'] = array(
  38. 'title' => 'Edit Views Integration',
  39. 'page callback' => 'drupal_get_form',
  40. 'page arguments' => array('tripal_views_integration_form', 5),
  41. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  42. 'type' => MENU_CALLBACK,
  43. );
  44. $items['admin/tripal/views/integration/delete/%'] = array(
  45. 'title' => 'Delete Views Integration',
  46. 'page callback' => 'tripal_views_integration_delete',
  47. 'page arguments' => array(5),
  48. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  49. 'type' => MENU_CALLBACK,
  50. );
  51. $items['admin/tripal/views/import'] = array(
  52. 'title' => 'Import Views Integration',
  53. 'page callback' => 'drupal_get_form',
  54. 'page arguments' => array('tripal_views_integration_import_form'),
  55. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  56. 'type' => MENU_NORMAL_ITEM,
  57. );
  58. $items['admin/tripal/views/integration/export/%'] = array(
  59. 'title' => 'Import Views Integration',
  60. 'page callback' => 'drupal_get_form',
  61. 'page arguments' => array('tripal_views_integration_export_form', 5),
  62. 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
  63. 'type' => MENU_CALLBACK,
  64. );
  65. return $items;
  66. }
  67. /**
  68. * Implements hook_views_api()
  69. *
  70. * Purpose: Set the permission types that the chado module uses.
  71. *
  72. * @ingroup tripal_views
  73. */
  74. function tripal_views_perm() {
  75. return array(
  76. 'manage tripal_views_integration',
  77. );
  78. }
  79. /**
  80. * Implements hook_views_api()
  81. *
  82. * Purpose: Essentially this hook tells drupal that there is views support for
  83. * for this module which then includes tripal_views.views.inc where all the
  84. * views integration code is
  85. *
  86. * @ingroup tripal_views
  87. */
  88. function tripal_views_views_api() {
  89. return array(
  90. 'api' => 2.0,
  91. );
  92. }
  93. /**
  94. * Implements hook_theme()
  95. *
  96. * Purpose: this hook provides details about themable objects added by
  97. * this module
  98. *
  99. * @ingroup tripal_views
  100. */
  101. function tripal_views_theme() {
  102. return array(
  103. 'tripal_views_integration_form' => array(
  104. 'arguments' => array('form' => NULL),
  105. 'template' => 'tripal_views_integration_fields_form',
  106. ),
  107. 'tripal_views_data_export_download_form' => array(
  108. 'arguments' => array('form' => NULL),
  109. 'template' => 'tripal_views_data_export_download_form',
  110. ),
  111. 'file_upload_combo' => array(
  112. 'arguments' => array('element' => NULL)
  113. ),
  114. 'sequence_combo' => array(
  115. 'arguments' => array('element' => NULL)
  116. ),
  117. );
  118. }
  119. /**
  120. * Implements hook_coder_ignore().
  121. * Defines the path to the file (tripal_views.coder_ignores.txt) where ignore rules for coder are stored
  122. */
  123. function tripal_views_coder_ignore() {
  124. return array(
  125. 'path' => drupal_get_path('module', 'tripal_views'),
  126. 'line prefix' => drupal_get_path('module', 'tripal_views'),
  127. );
  128. }