You are here

function _autofill_textfield_combo in Autofill 6

Autofill combo boxes for admin settings form.

1 call to _autofill_textfield_combo()
autofill_form in ./autofill.admin.inc
Implementation of Autofill settings form.

File

./autofill.admin.inc, line 123
Adminstrative page callbacks for Autofill

Code

function _autofill_textfield_combo($delta, $id, $value, $pre) {
  $form = array(
    '#tree' => TRUE,
  );
  $form['markup1'] = array(
    '#value' => '<div class="autofill-row">',
  );
  $form['id'] = array(
    '#type' => 'textfield',
    '#title' => t('ID/class'),
    '#default_value' => $id,
    '#attributes' => array(
      'class' => 'field_spacing',
    ),
    '#parents' => array(
      'fields',
      $delta,
      'id',
    ),
  );
  $form['value'] = array(
    '#type' => 'textfield',
    '#title' => t('Empty value'),
    '#default_value' => $value,
    '#attributes' => array(
      'class' => 'field_spacing',
    ),
    '#parents' => array(
      'fields',
      $delta,
      'value',
    ),
  );
  $form['pre'] = array(
    '#type' => 'textfield',
    '#title' => t('Pre-populate value'),
    '#default_value' => $pre,
    '#attributes' => array(
      'class' => 'field_spacing',
    ),
    '#parents' => array(
      'fields',
      $delta,
      'pre',
    ),
  );
  $form['markup2'] = array(
    '#value' => '</div>',
  );
  return $form;
}