Tripal Plant PopGen Submit
|
Go to the source code of this file.
Functions | |
tpps_dynamic_list (array &$form, array &$form_state, $id, array $repeat, array $options=array()) | |
tpps_form_state_info (array &$new, array &$old) | |
tpps_get_ajax_number (array &$state, array $parents, $up, $down, $default=0, $minimum=0, array $options=array()) | |
tpps_get_ajax_value (array &$state, array $parents, $default=NULL, $file_name="") | |
tpps_pre_validate ($accession, $fid, $org_num, $job=NULL) | |
tpps_pre_validate_init ($accession=NULL) | |
tpps_pre_validate_status ($accession=NULL, $jid=NULL) | |
tpps_preserve_valid_file (array &$form_state, $fid, $org_num=NULL, $prefix=NULL) | |
Defines useful functions to be used with the TPPS form.
Definition in file form_utils.inc.
tpps_dynamic_list | ( | array & | $form, |
array & | $form_state, | ||
$id, | |||
array | $repeat, | ||
array | $options = array() |
||
) |
Creates a dynamic list fieldset complete with add/remove buttons and ajax.
This function accepts a form object, form state object, an id, and a field to repeat, and creates a fieldset with buttons to add/remove items from the list. This function also supports a variety of additional options, which can be specified in the $options array. The list will be inserted at $form[$id], unless parents are specified in the options, in which case the list will be inserted at $form[...$parents][$id].
array | $form | The form array that the new list will be generated for. |
array | $form_state | The form state array of the provided form. |
string | $id | The id of the dynamic list. |
array | $repeat | The field to repeat. |
array | $options | Additional options. |
Definition at line 29 of file form_utils.inc.
tpps_form_state_info | ( | array & | $new, |
array & | $old | ||
) |
Migrates necessary information from the old form state to the new one.
This function is usually only called from tpps_main().
array | $new | The new form state to be populated. |
array | $old | The old form state with the old information. |
Definition at line 290 of file form_utils.inc.
tpps_get_ajax_number | ( | array & | $state, |
array | $parents, | ||
$up, | |||
$down, | |||
$default = 0 , |
|||
$minimum = 0 , |
|||
array | $options = array() |
||
) |
Retrieves the value of the number of a tpps_dynamic_list fieldset.
This function first checks the values of the form state, then the saved_values, and finally returns the default if it cannot find the number. This function also accepts an optional $options array, which contains alternative increment values, or functions which return a new number. This can be useful for adding buttons to a dynamic list such as "Add 5 of x".
array | $state | The state of the form. |
array | $parents | The parents leading to the list number. |
string | $up | The #name of the button to increase the list number. |
string | $down | The #name of the button to decrease the list number. |
int | $default | The default number if the number does not exist. |
int | $minimum | The minimum number we are allowed to reach. |
array | $options | Optional additional increment values. |
Definition at line 157 of file form_utils.inc.
tpps_get_ajax_value | ( | array & | $state, |
array | $parents, | ||
$default = NULL , |
|||
$file_name = "" |
|||
) |
Retrieves the value of a field that may have been altered through ajax.
This function first checks the 'complete form' of the form state, then the saved_values, and finally returns the default if it cannot find the value. If the value we are trying to reach is part of a TPPS managed_file, then we can also pass the file name in order to find saved_values such as 'file-columns', or 'file-no-header'.
array | $state | The state of the form. |
array | $parents | The parents leading to the list number. |
mixed | $default | The default value to return. |
string | $file_name | Optional - the name of the file. |
Definition at line 236 of file form_utils.inc.
tpps_pre_validate | ( | $accession, | |
$fid, | |||
$org_num, | |||
$job = NULL |
|||
) |
Executes a TPPS pre-validation job.
string | $accession | The accession of the submission being pre-validated. |
int | $fid | The id of the file to be pre-validated. |
int | $org_num | The organism number that this file is associated with. |
mixed | $job | The TripalJob object of the current job. |
Definition at line 451 of file form_utils.inc.
tpps_pre_validate_init | ( | $accession = NULL | ) |
Initializes TPPS VCF file pre-validation jobs.
This function also requires that the body of the pre-validation request contains the file ids of all of the VCF files that need to be pre-validated.
string | $accession | The accession of the submission to pre-validate. |
Definition at line 349 of file form_utils.inc.
tpps_pre_validate_status | ( | $accession = NULL , |
|
$jid = NULL |
|||
) |
Check the status of a TPPS pre-validation job.
string | $accession | The accession of the submission being pre-validated. |
int | $jid | The id of the pre-validation job. |
Definition at line 424 of file form_utils.inc.
tpps_preserve_valid_file | ( | array & | $form_state, |
$fid, | |||
$org_num = NULL , |
|||
$prefix = NULL |
|||
) |
If there have been no form errors, then the file is valid, so preserve it.
Also adds the standardized name and fid to the submission state file_info.
array | $form_state | The form state being validated. |
int | $fid | The Drupal file ID. |
mixed | $org_num | The species number to get the species name from the form state array. |
mixed | $prefix | The standardized file name prefix. |
Definition at line 328 of file form_utils.inc.