Revision 81df545f
Added by Andreas Kohlbecker almost 16 years ago
modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
226 | 226 |
'#attributes' => array('title' => t('Enter the name or part of a name you wish to search for.')), |
227 | 227 |
'#default_value' => (isset($_SESSION['cdm']['search']['queryString']) ? $_SESSION['cdm']['search']['queryString'] : ''), |
228 | 228 |
); |
229 |
$form['onlyAccepted'] = array( |
|
229 |
$form['mode'] = array( |
|
230 |
'#type' => 'select', |
|
231 |
'#title' => t('Search Mode'), |
|
232 |
'#options' => array( |
|
233 |
'EXACT' => t('Exact'), |
|
234 |
'BEGINNING' => t('Beginning'), |
|
235 |
'ANYWHERE' => t('Anywhere') |
|
236 |
), |
|
237 |
'#description' => t('* can always be used as wildcard'), |
|
238 |
'#default_value' => (isset($_SESSION['cdm']['search']['mode']) ? $_SESSION['cdm']['search']['mode'] : 'start'), |
|
239 |
); |
|
240 |
|
|
241 |
/*$form['onlyAccepted'] = array( |
|
230 | 242 |
'#type' => 'checkbox', |
231 | 243 |
'#title' => t('Only Accepted'), |
232 | 244 |
'#attributes' => array('title' => t('Search only for taxa which are accepted by the current treatment.')), |
233 | 245 |
'#default_value' => isset($_SESSION['cdm']['search']['onlyAccepted']) && $_SESSION['cdm']['search']['onlyAccepted'], |
234 | 246 |
); |
247 |
*/ |
|
235 | 248 |
/* |
236 | 249 |
$form['vernacular'] = array( |
237 | 250 |
'#type' => 'checkbox', |
... | ... | |
271 | 284 |
return $form; |
272 | 285 |
} |
273 | 286 |
|
274 |
|
|
287 |
//TODO is this function REACHABLE and thus in use?? |
|
275 | 288 |
function cdm_dataportal_search_process($form) { |
276 | 289 |
unset($form['form_id']); |
277 | 290 |
unset($form['form_token']); |
... | ... | |
284 | 297 |
*/ |
285 | 298 |
function cdm_dataportal_search_form_request(){ |
286 | 299 |
// keys map $REQUEST Keys values are optional default parameters if not null |
287 |
static $search_form_params = array('queryString'=>null, 'onlyAccepted' =>'0', 'page'=>null); |
|
300 |
static $search_form_params = array('queryString'=>null, 'onlyAccepted' =>'0', 'page'=>null, 'pagesize'=>15, 'mode'=>null);
|
|
288 | 301 |
|
289 | 302 |
$form_params = array(); |
290 | 303 |
foreach($search_form_params as $key=>$default ){ |
291 | 304 |
$form_params[$key] = ( isset($_REQUEST[$key]) && $_REQUEST[$key] != '' ? $_REQUEST[$key] : $default); |
292 | 305 |
} |
306 |
$_SESSION['cdm']['search'] = $form_params; |
|
293 | 307 |
return $form_params; |
294 | 308 |
} |
295 | 309 |
|
296 | 310 |
|
297 |
/* |
|
311 |
/* UNREACHABLE since action of form directly links to view
|
|
298 | 312 |
function cdm_dataportal_search_taxon_form_submit($form_id, $form_values) { |
299 | 313 |
|
300 | 314 |
$_SESSION['cdm']['search'] = $form_values; |
... | ... | |
470 | 484 |
|
471 | 485 |
$request_params = cdm_dataportal_search_form_request(); |
472 | 486 |
$sw_params = array_replace_key($request_params, array('queryString'=> 10 )); |
473 |
//FIXME remove debug code: |
|
474 |
$sw_params['page'] = '1'; // DEBUG code |
|
475 | 487 |
$resultPageSTO = cdm_ws_get(CDM_WS_FIND_TAXA, $sw_params); |
476 | 488 |
$resultPageSTO->pageNumber = $request_params['page']; |
477 | 489 |
return theme('cdm_search_results', $resultPageSTO, 'cdm_dataportal/search/taxon', $request_params); |
... | ... | |
576 | 588 |
return $_SESSION['cdm']['currentSecRef']; |
577 | 589 |
} |
578 | 590 |
|
591 |
function _cdm_dataportal_acceptetByCurrentView($taxonTO){ |
|
592 |
$current_secref = _cdm_dataportal_currentSecRef_array(); |
|
593 |
|
|
594 |
return $current_secref->uuid == $taxonTO->secuuid && $taxonTO->accepted; |
|
595 |
} |
|
579 | 596 |
|
580 | 597 |
/** |
581 | 598 |
* @param $str the string to truncate |
Also available in: Unified diff