function tripal_cv_cvterm_add_form
2.x tripal_cv.cvterm_form.inc | tripal_cv_cvterm_add_form($form, &$form_state) |
3.x tripal_chado.cv.inc | tripal_cv_cvterm_add_form($form, &$form_state) |
Form for adding cvterms
2 string references to 'tripal_cv_cvterm_add_form'
- tripal_chado_menu in tripal_chado/
tripal_chado.module - Implements hook_menu().
- tripal_cv_menu in legacy/
tripal_cv/ tripal_cv.module - Implements hook_menu(). Registers all menu items associated with this module
File
- tripal_chado/
includes/ tripal_chado.cv.inc, line 431
Code
function tripal_cv_cvterm_add_form($form, &$form_state) {
$cv_id = 0;
if (array_key_exists('values', $form_state)) {
$cv_id = $form_state['values']['cv_id'];
}
elseif (isset($form_state['build_info']['args'][0])) {
$cv_id = $form_state['build_info']['args'][0];
}
// get a list of CVs
$cvs = array();
$sql = "SELECT * FROM {cv} WHERE NOT name = 'tripal' ORDER BY name ";
$results = chado_query($sql);
$cvs[] = 'Select a vocabulary';
foreach ($results as $cv) {
$cvs[$cv->cv_id] = $cv->name;
}
$form['cv_id'] = array(
'#title' => t('Controlled Vocabulary (Ontology) Name'),
'#type' => 'select',
'#options' => $cvs,
'#required' => TRUE,
'#default_value' => $cv_id,
);
tripal_cv_add_cvterm_form_fields($form, $form_state);
$form['add'] = array(
'#type' => 'submit',
'#value' => t('Add Term'),
);
return $form;
}