tripal_views_setup.module 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. require_once 'includes/tripal_views_setup.admin.inc';
  3. function tripal_views_setup_menu(){
  4. $items = array();
  5. //parents admin page TODO: figure out what to do here: add / remove searches
  6. $items['admin/tripal/tripal_views_setup'] = array(
  7. 'title' => t('Tripal Views Setups'),
  8. 'description' => t('Tripal Views Setups settings page, allows you to select and create materialized views and chado tables to use for searches.'),
  9. 'page callback' => 'drupal_get_form',
  10. 'page arguments' => array('tripal_views_setup_admin_form'),
  11. 'access arguments' => array('access administration pages'),
  12. 'type' => MENU_NORMAL_ITEM,
  13. );
  14. //page to actually create searche->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_search_form'),
  19. 'access arguments' => array('access administration pages'), //TODO: figure out the proper permissions arguments
  20. 'type' => MENU_NORMAL_ITEM,
  21. );
  22. return $items;
  23. }
  24. /* this needs to go into the function tripal_views_setup_block()
  25. $limitnum = variable_get("onthisdate_maxdisp", 3);
  26. $query = "SELECT nid, title, created FROM " .
  27. "{node} WHERE created >= %d " .
  28. "AND created <= %d";
  29. $query_result = db_query_range($query, $start_time, $end_time, 0, $limitnum);
  30. */
  31. //TODO: validation for the admin pages
  32. function tripal_views_setup_theme(){
  33. $theme = array();
  34. $theme['tripal_views_setup_form'] = array(
  35. 'arguments' => array('form' => NULL,),
  36. );
  37. return $theme;
  38. }
  39. function theme_tripal_views_setup_form($form){
  40. // return tripal_helper_form_themeform($form, array('name', 'setup_id', 'mview_id', 'base_table_name', 'description'));
  41. }