Tripal
Functions
tripal_chado.pub_search.inc File Reference

Functions

 tripal_chado_pub_search_admin_form ($form, &$form_state)
 
 tripal_chado_pub_search_admin_form_submit ($form, &$form_state)
 
 tripal_chado_pub_search_page ()
 
 tripal_chado_pub_search_form ($form, &$form_state)
 
 tripal_chado_pub_search_form_ajax_button_submit ()
 
 tripal_chado_pub_search_form_ajax_button_validate ()
 
 tripal_chado_pub_search_form_validate ($form, &$form_state)
 
 tripal_chado_pub_search_form_submit ($form, &$form_state)
 
 tripal_pubs_search_form_ajax_update ($form, $form_state)
 
 theme_tripal_chado_pub_search_setup_form_elements ($variables)
 
 tripal_search_publications ($search_array, $offset, $limit, &$total_records)
 

Detailed Description

Functions responsible for creating the publication search form that allows a user of the site to search for publications that are currently in Chado.

Function Documentation

◆ theme_tripal_chado_pub_search_setup_form_elements()

theme_tripal_chado_pub_search_setup_form_elements (   $variables)

Theme the tripal_chado_pub_search_setup_form form

◆ tripal_chado_pub_search_form()

tripal_chado_pub_search_form (   $form,
$form_state 
)

Provides the form to search pubmed

◆ tripal_chado_pub_search_form_ajax_button_submit()

tripal_chado_pub_search_form_ajax_button_submit ( )

This function is used to rebuild the form if an ajax call is made vai a button. The button causes the form to be submitted. We don't want this so we override the validate and submit routines on the form button. Therefore, this function only needs to tell Drupal to rebuild the form

◆ tripal_chado_pub_search_form_ajax_button_validate()

tripal_chado_pub_search_form_ajax_button_validate ( )

This function is just a dummy to override the default form submit on ajax calls for buttons

◆ tripal_chado_pub_search_form_submit()

tripal_chado_pub_search_form_submit (   $form,
$form_state 
)

Submit the tripal_chado_pub_search_form form

◆ tripal_chado_pub_search_form_validate()

tripal_chado_pub_search_form_validate (   $form,
$form_state 
)

Validate the tripal_chado_pub_search_form form

◆ tripal_chado_pub_search_page()

tripal_chado_pub_search_page ( )

The page that contains the publication search form and the results for the search

◆ tripal_pubs_search_form_ajax_update()

tripal_pubs_search_form_ajax_update (   $form,
  $form_state 
)

Ajax callback to update the form

Parameters
$formThe form array
$form_stateThe form state array

◆ tripal_search_publications()

tripal_search_publications (   $search_array,
  $offset,
  $limit,
$total_records 
)

Builds the SQL statement need to search Chado for the publications that match the user supplied criteria. Tpyically, this function is called by the search form generated by the tripal_chado_pub_search_form() function but this function is included in the API for calling by anyone.

Parameters
$search_arrayAn array of search criteria provided by the user. The search array is an associative array with the following keys: 'num_criteria': an integer indicating the number of search criteria supplied 'from_year': filters records by a start year 'to_year': filters records by an end year 'criteria': an array of criteria. Each criteria is an associative array with the following keys: 'search_terms': The text used for searching 'scope': The cvterm_id of the property used for filtering 'mode': The operation (e.g. AND, OR or NOT)
$offsetThe offset for paging records. The first record returned will be at the offset indicated here, and the next $limit number of records will be returned.
$limitThe number of records to retrieve
total_recordsA value passed by reference. This value will get set to the total number of matching records
Returns
a PDO database object of the query results.