function expand_sequence_combo

2.x tripal_core.form_elements.inc expand_sequence_combo($element, $form_state, $complete_form)
3.x tripal_core.form_elements.inc expand_sequence_combo($element, $form_state, $complete_form)
1.x form_elements.inc expand_sequence_combo($element, $edit, $form_state, $complete_form)

Retrieve Sequence bases form element.

Related topics

1 string reference to 'expand_sequence_combo'
tripal_core_element_info in tripal_core/includes/tripal_core.form_elements.inc
Register form elements.

File

tripal_core/includes/tripal_core.form_elements.inc, line 162
Form elements used Various places in Tripal

Code

function expand_sequence_combo($element, $form_state, $complete_form) {

  // set the default values for each field
  if (empty($element['#value'])) {
    $element['#value'] = array(
      'upstream' => '',
      'downstream' => '',
    );
  }

  $element['#tree'] = TRUE;

  // add the upstream box
  $parents = $element['#parents'];
  $parents[] = 'upstream';
  $element['upstream'] = array(
    '#type' => 'textfield',
    '#title' => t('Get Upstream Bases'),
    '#description' => t('Specify the number of upstream bases to include in the sequence'),
    '#default_value' => $element['#value']['upstream'],
  );
  // add the downstream box
  $parents = $element['#parents'];
  $parents[] = 'downstream';
  $element['downstream'] = array(
    '#type' => 'textfield',
    '#prefix' => '<br>',
    '#title' => t('Get Downstream Bases'),
    '#description' => t('Specify the number of downstream bases to include in the seqeunce'),
    '#default_value' => $element['#value']['downstream'],
  );
  return $element;
}