tripal_views_search.admin.inc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. function tripal_views_search_admin(){
  3. $add_url = url('admin/tripal/tripal_views_search/new');
  4. $output = "<a href=\"$add_url\">Add New Search";
  5. $output .= drupal_get_form(tripal_views_search_admin_form);
  6. return $output;
  7. }
  8. function tripal_views_search_admin_form(){
  9. $form = array();
  10. $form['tripal_views_search_config_mview'] = array(
  11. '#type' => 'select',
  12. '#title' => t('Materialized View'),
  13. '#options' => tripal_views_search_mview_list(),
  14. '#description' => t('Select which materialized view needs to be used for this search'),
  15. '#required' => TRUE,
  16. );
  17. $form['tripal_views_search_config_btable'] = array(
  18. '#type' => 'select',
  19. '#title' => t('Chado base table'),
  20. '#options' => tripal_views_search_btable_list(),
  21. '#description' => t('Select which chado table needs to be used for this earch'),
  22. '#required' => TRUE,
  23. );
  24. dpm($form, 'tripal_views_search_admin form');
  25. return system_settings_form($form);
  26. }
  27. function tripal_views_search_new_search_form(){
  28. $form = array();
  29. $form['tripal_views_search_config_mview'] = array(
  30. '#type' => 'textfield',
  31. '#title' => t('Materialized View'),
  32. '#description' => t('Select which materialized view needs to be used for this search'),
  33. '#required' => TRUE,
  34. );
  35. return $form;
  36. }
  37. function tripal_views_search_mview_list(){
  38. //must return an array of strings ie:
  39. $options = array(
  40. 'dummyoption' => t('dummyoptiontext'),
  41. );
  42. return $options;
  43. }
  44. function tripal_views_search_btable_list(){
  45. //must return an array of strings ie:
  46. $options = array(
  47. 'dummyoption2' => t('dummyoptiontext2'),
  48. );
  49. return $options;
  50. }