function tripal_cv_list_form
1.x trees.inc | tripal_cv_list_form($form_state) |
Form listing CVs
Related topics
1 string reference to 'tripal_cv_list_form'
- tripal_cv_show_browser in tripal_cv/
includes/ trees.inc - Renders the cv_list form
File
- tripal_cv/
includes/ trees.inc, line 435 - @todo Stephen describe this file
Code
function tripal_cv_list_form($form_state) {
// get a list of db from chado for user to choose
$sql = "
SELECT DISTINCT CV.name,CV.cv_id
FROM {cvterm_relationship} CVTR
INNER JOIN {cvterm} CVT on CVTR.object_id = CVT.cvterm_id
INNER JOIN {CV} on CV.cv_id = CVT.cv_id
";
$results = chado_query($sql);
$blastdbs = array();
$cvs[''] = '';
while ($cv = db_fetch_object($results)) {
$cvs[$cv->cv_id] = $cv->name;
}
$form['db_options'] = array(
'#type' => 'value',
'#value' => $cvs
);
$form['cv_list'] = array(
'#title' => t('CVs with relationships'),
'#type' => 'select',
'#description' => t('Choose the controlled vocabulary to browse'),
'#options' => $form['db_options']['#value'],
'#attributes' => array(
'onChange' => "return tripal_cv_init_browser(this)",
)
);
return $form;
}