tripal_views_setup.module 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. require_once 'includes/tripal_views_setup.admin.inc';
  3. function tripal_views_setup_menu(){
  4. $items = array();
  5. $items['admin/tripal/tripal_views_setup'] = array(
  6. 'title' => t('Tripal Views Setups'),
  7. 'description' => t('Tripal Views Setups settings page, allows you to select and create materialized views and chado tables to use for searches.'),
  8. 'page callback' => 'drupal_get_form',
  9. 'page arguments' => array('tripal_views_setup_admin_form'),
  10. // 'page callback' => 'tripal_views_setup_admin_form_page',
  11. 'access arguments' => array('access administration pages'),
  12. 'type' => MENU_NORMAL_ITEM,
  13. );
  14. //page to actually create setup->mview->chado table relationships
  15. $items['admin/tripal/tripal_views_setup_new'] = array(
  16. 'title' => 'Create New Views Setup',
  17. 'page callback' => 'drupal_get_form',
  18. 'page arguments' => array('tripal_views_setup_new_setup_form'),
  19. 'access arguments' => array('access administration pages'), //TODO: figure out the proper permissions arguments
  20. 'type' => MENU_NORMAL_ITEM,
  21. );
  22. $items['admin/tripal/tripal_views_setup/ajax/mview_cols'] = array(
  23. 'title' => 'Get MView Columns',
  24. 'page callback' => 'tripal_view_setup_ajax_mview_cols',
  25. 'access arguments' => array('access administration pages'),
  26. 'type' => MENU_CALLBACK,
  27. );
  28. $items['admin/tripal/tripal_views_setup/ajax/field_col_join'] = array(
  29. 'title' => 'Get Join Columns',
  30. 'page callback' => 'tripal_view_setup_ajax_field_col_join',
  31. 'access arguments' => array('access administration pages'),
  32. 'type' => MENU_CALLBACK,
  33. );
  34. return $items;
  35. }
  36. function tripal_views_setup_theme(){
  37. $theme = array();
  38. // $theme['tripal_views_setup_fields_form'] = array(
  39. $theme['tripal_views_setup_new_setup_form'] = array(
  40. 'arguments' => array('form' => NULL),
  41. 'template' => 'tripal_views_setup_fields_form',
  42. );
  43. return $theme;
  44. }