function get_tripal_stock_admin_form_vocabulary_set
1.x tripal_stock.admin.inc | get_tripal_stock_admin_form_vocabulary_set(&$form) |
Parameters
$form:
1 call to get_tripal_stock_admin_form_vocabulary_set()
- tripal_stock_admin in tripal_stock/
includes/ tripal_stock.admin.inc - Purpose: Provide administration options for chado_stocks
File
- tripal_stock/
includes/ tripal_stock.admin.inc, line 170 - @todo Add file header description
Code
function get_tripal_stock_admin_form_vocabulary_set(&$form) {
$form['set_cv'] = array(
'#type' => 'fieldset',
'#title' => t('Set Stock Controlled Vocabularies'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['set_cv']['message'] = array(
'#value' => t("This setting allows you to set which chado controlled vocabularies (cv)"
. " are used. Cvs are used to control user input for the type of stock,"
. " any properties they enter for a stock & the types of relationships"
. " between stocks. Only cvs already loaded into chado can be selected here.")
);
// get the list of CVs for the next form element
$sql = "SELECT * FROM {cv} ORDER BY name";
$results = chado_query($sql);
$cv_options = array();
while ($r = db_fetch_object($results)) {
$cv_options[$r->cv_id] = $r->name;
}
$form['set_cv']['stock_types_cv'] = array(
'#type' => 'select',
'#title' => t('Controlled Vocabulary governing Stock Types'),
'#options' => $cv_options,
'#default_value' => variable_get('chado_stock_types_cv', 0)
);
$form['set_cv']['stock_prop_types_cv'] = array(
'#type' => 'select',
'#title' => t('Controlled Vocabulary governing Types of Stock Properties'),
'#description' => t("This cv must contain a cvterm entry where name='synonym'."),
'#options' => $cv_options,
'#default_value' => variable_get('chado_stock_prop_types_cv', 0)
);
$form['set_cv']['stock_relationship_cv'] = array(
'#type' => 'select',
'#title' => t('Controlled Vocabulary governing Types of Relationsips between Stocks'),
'#options' => $cv_options,
'#default_value' => variable_get('chado_stock_relationship_cv', 0)
);
$form['set_cv']['button'] = array(
'#type' => 'submit',
'#value' => t('Set Controlled Vacabularies')
);
}