You are here

function variable_form_element_multiple in Variable 7

Same name and namespace in other branches
  1. 6 variable.form.inc \variable_form_element_multiple()
  2. 7.2 variable.form.inc \variable_form_element_multiple()

Build multiple form element

1 string reference to 'variable_form_element_multiple'
variable_variable_type_info in ./variable.variable.inc
Implements hook_variable_type_info().

File

./variable.form.inc, line 72
Variable API module. Form library.

Code

function variable_form_element_multiple($variable, $options = array()) {
  $variable += array(
    'element' => array(),
    'title' => '',
    'description' => '',
  );
  $element = $variable['element'] + array(
    '#type' => 'fieldset',
    '#title' => $variable['title'],
    '#description' => $variable['description'],
  );
  foreach ($variable['children'] as $name => $item) {
    $element[$name] = variable_form_element($item, $options);
  }
  return $element;
}