function tripal_cv_add_form_submit
1.x tripal_cv_admin.inc | tripal_cv_add_form_submit($form, &$form_state) |
Purpose: The submit function for the add controlled vocabulary form
Related topics
File
- tripal_cv/
includes/ tripal_cv_admin.inc, line 219
Code
function tripal_cv_add_form_submit($form, &$form_state) {
$name = $form_state['values']['name'];
$desc = $form_state['values']['definition'];
$sql = "
INSERT INTO {cv}
(name,definition)
VALUES
('%s','%s')
";
$db = chado_query($sql, $name, $desc);
if ($db) {
drupal_set_message(t("Controlled vocabulary added"));
}
else {
drupal_set_message(t("Failed to add controlled vocabulary."), 'error');
}
}