Tripal Plant PopGen Submit
page_4_ajax.php File Reference

Go to the source code of this file.

Functions

 tpps_ajax_bioproject_callback (array &$form, array $form_state)
 
 tpps_genotype_files_callback (array $form, array &$form_state)
 
 tpps_genotype_files_type_change_callback (array $form, array &$form_state)
 
 tpps_page_4_file_dynamic (array $form, array &$form_state)
 
 tpps_phenotype_file_format_callback (array $form, array &$form_state)
 
 tpps_update_phenotype (array $form, array &$form_state)
 
 tpps_update_phenotype_meta (array $form, array &$form_state)
 

Detailed Description

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

Definition in file page_4_ajax.php.

Function Documentation

◆ tpps_ajax_bioproject_callback()

tpps_ajax_bioproject_callback ( array &  $form,
array  $form_state 
)

Ajax callback for BioProject field.

Indicates the element to be updated when the NCBI BioProject ID field is changed.

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 22 of file page_4_ajax.php.

22  {
23 
24  $ajax_id = $form_state['triggering_element']['#parents'][0];
25 
26  return $form[$ajax_id]['genotype']['tripal_eutils'];
27 }

◆ tpps_genotype_files_callback()

tpps_genotype_files_callback ( array  $form,
array &  $form_state 
)

Ajax callback for genotype files fieldset.

Indicates the element to be updated when the genotype marker types checkboxes or the genotype file types checkboxes are updated.

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 103 of file page_4_ajax.php.

103  {
104  $id = $form_state['triggering_element']['#parents'][0];
105 
106  return $form[$id]['genotype']['files'];
107 }

◆ tpps_genotype_files_type_change_callback()

tpps_genotype_files_type_change_callback ( array  $form,
array &  $form_state 
)

Ajax callback for genotype files fieldset.

Indicates the element to be updated when the genotype marker types checkboxes or the genotype file types checkboxes are updated.

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 124 of file page_4_ajax.php.

124  {
125  $id = $form_state['triggering_element']['#parents'][0];
126 
127  return $form[$id]['genotype']['files'];
128 }

◆ tpps_page_4_file_dynamic()

tpps_page_4_file_dynamic ( array  $form,
array &  $form_state 
)

Indicate the managed_file element to be updated.

This function is called after a no_header element is changed, triggering an update of the managed_file element.

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

Definition at line 144 of file page_4_ajax.php.

144  {
145 
146  $parents = $form_state['triggering_element']['#parents'];
147  array_pop($parents);
148 
149  $element = drupal_array_get_nested_value($form, $parents);
150  return $element;
151 }

◆ tpps_phenotype_file_format_callback()

tpps_phenotype_file_format_callback ( array  $form,
array &  $form_state 
)

Ajax callback for phenotype file format.

Indicates the element to be updated when the format option of the phenotype file has been changed.

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 83 of file page_4_ajax.php.

83  {
84  $id = $form_state['triggering_element']['#parents'][0];
85 
86  return $form[$id]['phenotype']['file'];
87 }

◆ tpps_update_phenotype()

tpps_update_phenotype ( array  $form,
array &  $form_state 
)

Ajax callback for phenotype fieldset.

Indicates the element to be updated when the add or remove phenotype 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 43 of file page_4_ajax.php.

43  {
44  $id = $form_state['triggering_element']['#parents'][0];
45 
46  return $form[$id]['phenotype'];
47 }

◆ tpps_update_phenotype_meta()

tpps_update_phenotype_meta ( array  $form,
array &  $form_state 
)

Ajax callback for phenotype meta fieldset.

Indicates the element to be updated when changes are made in the manual phenotype metadata section.

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 63 of file page_4_ajax.php.

63  {
64  $id = $form_state['triggering_element']['#parents'][0];
65  $phenotype_num = $form_state['triggering_element']['#parents'][3];
66  return $form[$id]['phenotype']['phenotypes-meta'][$phenotype_num];
67 }