function tripal_feature_add_ONE_dbreference_form
1.x tripal_feature-db_references.inc | tripal_feature_add_ONE_dbreference_form($form_state, $node) |
Implements Hook_form() Handles adding of Database References to features
Related topics
2 string references to 'tripal_feature_add_ONE_dbreference_form'
- tripal_feature_add_ALL_dbreferences_page in tripal_feature/
includes/ tripal_feature-db_references.inc - tripal_feature_edit_ALL_dbreferences_page in tripal_feature/
includes/ tripal_feature-db_references.inc
File
- tripal_feature/
includes/ tripal_feature-db_references.inc, line 33 - @todo Add file header description
Code
function tripal_feature_add_ONE_dbreference_form($form_state, $node) {
$form['nid'] = array(
'#type' => 'hidden',
'#value' => $node->nid
);
$form['feature_id'] = array(
'#type' => 'hidden',
'#value' => $node->feature->feature_id,
);
$form['add_dbreference'] = array(
'#type' => 'fieldset',
'#title' => t('Add Database References') . '<span class="form-optional" title="This field is optional">(optional)</span>',
);
$form['add_dbreference']['accession'] = array(
'#type' => 'textfield',
'#title' => t('Accession'),
'#required' => TRUE,
);
$form['add_dbreference']['description'] = array(
'#type' => 'textarea',
'#title' => t('Description of Reference') . '<span class="form-optional" title="This field is optional">+</span>',
'#description' => t('Optionally enter a description about the database accession.'),
);
$db_options = tripal_db_get_db_options();
$db_options[0] = 'Select a Database';
ksort($db_options);
$form['add_dbreference']['db_id'] = array(
'#type' => 'select',
'#title' => t('Database'),
'#options' => $db_options,
'#required' => TRUE,
);
$form['add_dbreference']['submit'] = array(
'#type' => 'submit',
'#value' => t('Add Database Reference')
);
return $form;
}