tripal_views_setup.module 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 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' => 'drupal_get_form',
  10. 'page arguments' => array('tripal_views_setup_admin'),
  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 Search',
  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_