function chado_add_node_form_properties_remove_button_submit
2.x tripal_core.chado_nodes.properties.api.inc | chado_add_node_form_properties_remove_button_submit(&$form, &$form_state) |
3.x tripal_core.chado_nodes.properties.api.inc | chado_add_node_form_properties_remove_button_submit(&$form, &$form_state) |
Remove the correct property from the form Called by the many remove buttons in chado_add_node_form_properties
1 call to chado_add_node_form_properties_remove_button_submit()
- chado_add_node_form_subtables_remove_button_submit in legacy/
tripal_core/ api/ tripal_core.chado_nodes.api.inc - Remove subtable entries to the node forms. Supported subtables: Properties, Relationships, Additional DBxrefs.
File
- legacy/
tripal_core/ api/ tripal_core.chado_nodes.properties.api.inc, line 723 - API to manage the chado prop table for various Tripal Node Types
Code
function chado_add_node_form_properties_remove_button_submit(&$form, &$form_state) {
// if the chado_properties array is not set then this is the first time modifying the
// property table. this means we need to include all the properties from the db
if (!isset($form_state['chado_properties'])) {
chado_add_node_form_properties_create_property_formstate_array($form, $form_state);
}
// remove the specified property from the form property table
if (preg_match('/properties_remove-([^-]+-[^-]+)/', $form_state['triggering_element']['#name'], $match)) {
$key = $match[1];
if (array_key_exists($key, $form_state['chado_properties'])) {
unset($form_state['chado_properties'][$key]);
}
}
}