function chado_add_node_form_relationships_remove_button_submit

2.x tripal_core.chado_nodes.relationships.api.inc chado_add_node_form_relationships_remove_button_submit(&$form, &$form_state)

Remove the correct relationship from the form Called by the many remove buttons in chado_add_node_form_relationships

Related topics

1 call to chado_add_node_form_relationships_remove_button_submit()
chado_add_node_form_subtables_remove_button_submit in tripal_core/api/tripal_core.chado_nodes.api.inc
Remove subtable entries to the node forms. Supported subtables: Properties, Relationships, Additional DBxrefs.

File

tripal_core/api/tripal_core.chado_nodes.relationships.api.inc, line 800
API to manage the chado _relationship table for various Tripal Node Types

Code

function chado_add_node_form_relationships_remove_button_submit(&$form, &$form_state) {

  // if the chado_relationships array is not set then this is the first time modifying the
  // relationship table. this means we need to include all the relationships from the db
  chado_add_node_form_relationships_create_relationship_formstate_array($form, $form_state);

  // remove the specified relationship from the form relationship table
  if (preg_match('/relationships_remove-([^-]+-[^-]+)/', $form_state['triggering_element']['#name'], $match)) {
    $key = $match[1];
    if (array_key_exists($key, $form_state['chado_relationships'])) {
      unset($form_state['chado_relationships'][$key]);
    }
  }
}