Tripal Plant PopGen Submit
page_3_ajax.php File Reference

Go to the source code of this file.

Functions

 tpps_accession_multi_file (array &$form, array $form_state)
 
 tpps_accession_pop_group (array &$form, array $form_state)
 
 tpps_study_location_map_ajax (array $form, array $form_state)
 
 tpps_update_locations (array $form, array &$form_state)
 

Detailed Description

Defines the ajax functions necessary for the third page of the form.

Definition in file page_3_ajax.php.

Function Documentation

◆ tpps_accession_multi_file()

tpps_accession_multi_file ( array &  $form,
array  $form_state 
)

Ajax callback for the tree-accession fieldset.

This function indicates the element to be updated when changes are made to the tree-accession fieldset.

Parameters
array$formThe form to be updated.
array$form_stateThe state of the form to be updated.
Returns
array The part of the form to be updated.

Definition at line 71 of file page_3_ajax.php.

71  {
72  return $form['tree-accession'];
73 }

◆ tpps_accession_pop_group()

tpps_accession_pop_group ( array &  $form,
array  $form_state 
)

Ajax callback for the population group fieldset.

This function indicates the element to be updated when a population group option is selected for a column in an accession file.

Parameters
array$formThe form to be updated.
array$form_stateThe state of the form to be updated.
Returns
array The part of the form to be updated.

Definition at line 22 of file page_3_ajax.php.

22  {
23  $commands = array();
24  $species_id = $form_state['triggering_element']['#parents'][1];
25  $output = drupal_render($form['tree-accession'][$species_id]['coord-format']);
26  $output .= drupal_render($form['tree-accession'][$species_id]['pop-group']);
27  $output .= drupal_render($form['tree-accession'][$species_id]['exact_coords']);
28  $output .= drupal_render($form['tree-accession'][$species_id]['coord_precision']);
29 
30  $commands[] = ajax_command_replace("#population-mapping-$species_id", $output);
31  $commands[] = ajax_command_invoke('', 'mapButtonsClick', array('.map-button'));
32  return array(
33  '#type' => 'ajax',
34  '#commands' => $commands,
35  );
36 }

◆ tpps_study_location_map_ajax()

tpps_study_location_map_ajax ( array  $form,
array  $form_state 
)

Ajax callback for the map button field.

This function indicates that the map button field needs to be updated. This happens when the user selects a coordinate projection or custom option from the coordinate projection field.

Parameters
array$formThe form to be updated.
array$form_stateThe state of the form to be updated.
Returns
array The element in the form to be updated.

Definition at line 53 of file page_3_ajax.php.

53  {
54  return $form['study_location']['map-button'];
55 }

◆ tpps_update_locations()

tpps_update_locations ( array  $form,
array &  $form_state 
)

Ajax callback for the study locations fieldset.

Indicates the element to be updated when the add or remove location buttons are clicked.

Parameters
array$formThe form to be updated.
array$form_stateThe state of the form to be updated.
Returns
array The element in the form to be updated.

Definition at line 89 of file page_3_ajax.php.

89  {
90  return $form['study_location'];
91 }