You are here

function variable_form_element_multiple in Variable 6

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

Build multiple form element

1 call to variable_form_element_multiple()
variable_form_element in ./variable.form.inc
Build form element for a variable
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 30
Variable API module. Form library.

Code

function variable_form_element_multiple($variable) {
  $element = isset($variable['form_element']) ? $variable['form_element'] : array();
  $element += array(
    '#type' => 'fieldset',
    '#title' => $variable['title'],
    '#description' => $variable['description'],
  );

  // Add child elements
  foreach ($variable['children'] as $key) {
    if ($info = variable_info($key)) {
      $element[$key] = variable_form_element($info);
    }
  }
  return $element;
}