tripal_views.module 3.5 KB

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