function chado_add_node_form_dbxrefs_add_button_submit

2.x chado_add_node_form_dbxrefs_add_button_submit($form, &$form_state)

Called by the add button in chado_add_node_form_dbxrefs

Create an array of additional dbxrefs in the form state. This array will then be used to rebuild the form in subsequent builds

Related topics

1 call to chado_add_node_form_dbxrefs_add_button_submit()
chado_add_node_form_subtables_add_button_submit in tripal_core/api/
Add subtable entries to the node forms. Supported subtables: Properties, Relationships, Additional DBxrefs.


tripal_core/api/, line 473
API to manage the chado _dbxref table for various Tripal Node Types


function chado_add_node_form_dbxrefs_add_button_submit($form, &$form_state) {

  // if the chado_additional_dbxrefs array is not set then this is the first time modifying the
  // dbxref table. this means we need to include all the dbxrefs from the db
  if (!isset($form_state['chado_additional_dbxrefs'])) {
    chado_add_node_form_dbxrefs_create_dbxref_formstate_array($form, $form_state);

  // get details for the new dbxref
  $dbxref = array(
    'db_id' => $form_state['values']['dbxref_table']['new']['db'],
    'db_name' => $form_state['values']['dbxref_table']['new']['db_name'],
    'dbxref_id' => 'TEMP' . uniqid(),
    'version' => $form_state['values']['dbxref_table']['new']['dbxref_version'],
    'accession' => $form_state['values']['dbxref_table']['new']['dbxref_accession'],
  $key = $dbxref['db_id'] . '-' . $dbxref['dbxref_id'];
  $form_state['chado_additional_dbxrefs'][$key] = (object) $dbxref;

  // we don't want the new element to pick up the values from the previous element so wipe them out