function tripal_stock_add_ONE_property_form
1.x tripal_stock-properties.inc | tripal_stock_add_ONE_property_form($form_state, $node) |
Related topics
2 string references to 'tripal_stock_add_ONE_property_form'
- tripal_stock_add_ALL_property_page in tripal_stock/
includes/ tripal_stock-properties.inc - tripal_stock_edit_ALL_properties_page in tripal_stock/
includes/ tripal_stock-properties.inc
File
- tripal_stock/
includes/ tripal_stock-properties.inc, line 31 - @todo Add file header description
Code
function tripal_stock_add_ONE_property_form($form_state, $node) {
$form = array();
$stock_id = $node->stock->stock_id;
$form['add_properties'] = array(
'#type' => 'fieldset',
'#title' => t('Add Property') . '<span class="form-optional" title="This field is optional"> (optional)</span>',
);
$form['prop_nid'] = array(
'#type' => 'hidden',
'#value' => $node->nid
);
$tmp_obj = tripal_cv_get_cvterm_by_name('synonym', variable_get('chado_stock_prop_types_cv', 'null'));
$synonym_id = $tmp_obj->cvterm_id;
$prop_type_options = tripal_cv_get_cvterm_options(variable_get('chado_stock_prop_types_cv', 'null'));
$prop_type_options[0] = 'Select a Type';
ksort($prop_type_options);
$form['add_properties']['prop_type_id'] = array(
'#type' => 'select',
'#title' => t('Type of Property'),
'#options' => $prop_type_options,
);
$form['add_properties']['prop_value'] = array(
'#type' => 'textfield',
'#title' => t('Value') . '<span class="form-optional" title="This field is optional">+</span>',
);
$form['add_properties']['preferred_synonym'] = array(
'#type' => 'checkbox',
'#title' => t('Preferred Synonym (only applicable if type is synonym)'),
);
$form['add_properties']['prop_stock_id'] = array(
'#type' => 'value',
'#value' => $stock_id,
'#required' => TRUE
);
$form['add_properties']['submit-add'] = array(
'#type' => 'submit',
'#value' => t('Add Property')
);
return $form;
}