Revision 04a1d647
Added by Patrick Plitzner almost 8 years ago
modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
619 | 619 |
, // Expected callback arguments: taxon_uuid. |
620 | 620 |
); |
621 | 621 |
|
622 |
$items['cdm_dataportal/taxonSearch/autocomplete'] = array(
|
|
623 |
'page callback' => 'cdm_dataportal_taxon_search_autocomplete',
|
|
624 |
'access arguments' => array('access taxon search autocomplete'),
|
|
622 |
$items['cdm_dataportal/taxon/autosuggest'] = array(
|
|
623 |
'page callback' => 'cdm_dataportal_taxon_autosuggest',
|
|
624 |
'access arguments' => array('access taxon autosuggest'),
|
|
625 | 625 |
'type' => MENU_CALLBACK |
626 | 626 |
); |
627 | 627 |
} |
modules/cdm_dataportal/cdm_dataportal.search.php | ||
---|---|---|
92 | 92 |
// '#description' => $query_field_description, |
93 | 93 |
); |
94 | 94 |
if(variable_get('cdm_dataportal_taxon_auto_suggest')){ |
95 |
$form['query']['#autocomplete_path'] = 'cdm_dataportal/taxonSearch/autocomplete';
|
|
95 |
$form['query']['#autocomplete_path'] = 'cdm_dataportal/taxon/autosuggest';
|
|
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
$form['search'] = array( |
... | ... | |
121 | 121 |
return $form; |
122 | 122 |
} |
123 | 123 |
|
124 |
function cdm_dataportal_taxon_search_autocomplete($string) {
|
|
124 |
function cdm_dataportal_taxon_autosuggest($string, $treeUuid = NULL, $areaUuid = NULL, $status = NULL) {
|
|
125 | 125 |
$matches = array(); |
126 | 126 |
|
127 | 127 |
$queryParams = array(); |
128 |
$queryParams['query'] = $string."*"; |
|
128 |
$queryParams['query'] = $string.'*'; |
|
129 |
if($treeUuid){ |
|
130 |
$queryParams['tree'] = $treeUuid; |
|
131 |
} |
|
132 |
if($areaUuid){ |
|
133 |
$queryParams['area'] = $areaUuid; |
|
134 |
} |
|
135 |
if($status){ |
|
136 |
$queryParams['status'] = $status ; |
|
137 |
} |
|
129 | 138 |
$queryParams['pageNumber'] = '0'; |
130 |
$queryParams['pageSize'] = '100';
|
|
139 |
$queryParams['pageSize'] = '10'; |
|
131 | 140 |
$queryParams['doTaxa'] = true; |
132 | 141 |
$queryParams['doSynonyms'] = true; |
133 | 142 |
$queryParams['doMisappliedNames'] = true; |
Also available in: Unified diff
#5890 Rename auto-suggest function and add missing parameter