Project

General

Profile

« Previous | Next » 

Revision 24797d7f

Added by Andreas Kohlbecker almost 6 years ago

removing unused code and harmonizing search method names

View differences:

modules/cdm_dataportal/cdm_dataportal.module
1832 1832
 */
1833 1833
function cdm_dataportal_view_search_results_taxon() {
1834 1834

  
1835
  $taxonPager = cdm_dataportal_search_execute();
1835
  $taxonPager = cdm_dataportal_search_taxon_execute();
1836 1836

  
1837 1837
  $showThumbnails = do_showThumbnails();
1838 1838

  
......
1886 1886

  
1887 1887
  drupal_set_title(t('Search registrations'), PASS_THROUGH);
1888 1888

  
1889
  $registrations_pager_array = compose_registrations_pager($registration_pager);
1889
  $registrations_pager_array = compose_registrations_search_results($registration_pager);
1890 1890

  
1891 1891
  $render_array = array_merge($render_array, $registrations_pager_array);
1892 1892

  
modules/cdm_dataportal/cdm_dataportal.search.php
48 48
 *   A default text for the query field
49 49
 * @param string $query_field_description
50 50
 *   The description text for the query field
51
 * @param string $process
52
 *   The value for #process, if NULL (default), 'cdm_dataportal_search_process'
53
 *   is used. - TODO not used, remove?
54 51
 *
55 52
 * @return array
56 53
 *   The prepared form array.
57 54
 */
58
function cdm_dataportal_search_form_prepare($action_path, $search_webservice, $query_field_default_value, $query_field_description, $process = NULL) {
55
function cdm_dataportal_search_form_prepare($action_path, $search_webservice, $query_field_default_value, $query_field_description) {
59 56

  
60
  //if ($process == NULL) {
61
  //  $process = 'cdm_dataportal_search_process';
62
  //}
63 57

  
64 58
  $form['#method'] = 'get';
65
  //
66
  //  $form['#process'] = array(
67
  //  $process => array(),
68
  //  );
69
  //
70 59
  $form['#action'] = url($action_path, array(
71 60
    'absolute' => TRUE,
72 61
  ));
......
590 579
/**
591 580
 * Provides the classification to which the last search has been limited to..
592 581
 *
593
 * This function should only be used after the cdm_dataportal_search_execute()
582
 * This function should only be used after the cdm_dataportal_search_taxon_execute()
594 583
 * handler has been run, otherwise it will return the information from the last
595 584
 * search executed. The information is retrieved from
596 585
 * the $_SESSION variable:  $_SESSION['cdm']['search']['tree']
......
616 605
  return $classification !== FALSE ? $classification : NULL;
617 606
}
618 607

  
619
/**
620
 * Removes Drupal internal form elements from query.
621
 * FIXME remove since unused?
622
 */
623
function cdm_dataportal_search_process($form, &$form_state) {
624
  unset($form['form_id']);
625
  unset($form['form_token']);
626
  return $form;
627
}
628

  
629 608
/**
630 609
 * Removed the drupal internal form parameters 'form_id', 'form_token', 'form_build_id' from the request array.
631 610
 *
......
656 635
 *
657 636
 * @see cdm_dataportal_search_request()
658 637
 */
659
function cdm_dataportal_search_execute() {
638
function cdm_dataportal_search_taxon_execute() {
660 639

  
661 640
  // Store as last search in session.
662 641
  $_SESSION['cdm']['last_search'] = $_SERVER['REQUEST_URI'];
......
844 823
 *
845 824
 * TODO compose function into search.inc ?
846 825
 */
847
function compose_registrations_pager($registration_pager){
826
function compose_registrations_search_results($registration_pager){
848 827

  
849 828
  $render_array = array();
850 829
  $render_array['pre'] = markup_to_render_array("<div class=\"pager_records\">");

Also available in: Unified diff