tripal_views_search.module 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. require_once 'includes/tripal_views_search.admin.inc';
  3. function tripal_views_search_menu(){
  4. $items = array();
  5. //parents admin page TODO: figure out what to do here: add / remove searches
  6. $items['admin/tripal/tripal_views_search'] = array(
  7. 'title' => t('Tripal Views Search settings'),
  8. 'description' => t('Tripal Views Search settings page, allows you to select and create materialized views and chado tables to use for searches.'),
  9. 'page callback' => 'tripal_views_search_admin',
  10. // 'page arguments' => array('tripal_views_search_admin'),
  11. 'access arguments' => array('access administration pages'),
  12. 'type' => MENU_NORMAL_ITEM,
  13. );
  14. /////////////////////////////////
  15. // managing relationship aggregates
  16. // $items['admin/tripal/tripal_feature/aggregate'] = array(
  17. // 'title' => 'Feature Relationship Aggegators',
  18. // 'description' => t('Features have relationships with other features and it may be desirable to aggregate the content from one ore more child or parent feature.'),
  19. // 'page callback' => 'tripal_feature_aggregator_page',
  20. // 'access arguments' => array('manage chado_feature aggregator'),
  21. // 'type' => MENU_NORMAL_ITEM,
  22. // );
  23. //////////////////////////
  24. //page to actually create searche->mview->chado table relationships
  25. $items['admin/tripal/tripal_views_search/new'] = array(
  26. 'title' => 'Create New Search',
  27. 'page callback' => 'drupal_get_form',
  28. 'page arguments' => array('tripal_views_search_new_search_form'),
  29. 'access arguments' => array('access administration pages'), //TODO: figure out the proper permissions arguments
  30. 'type' => MENU_NORMAL_ITEM,
  31. );
  32. return $items;
  33. }
  34. /* this needs to go into the function tripal_views_search_block()
  35. $limitnum = variable_get("onthisdate_maxdisp", 3);
  36. $query = "SELECT nid, title, created FROM " .
  37. "{node} WHERE created >= %d " .
  38. "AND created <= %d";
  39. $query_result = db_query_range($query, $start_time, $end_time, 0, $limitnum);
  40. */
  41. //TODO: validation for the admin pages