You are here

function variable_edit_subform in Variable 7

Same name and namespace in other branches
  1. 7.2 variable.module \variable_edit_subform()

Form elements for variable list.

Parameters

$list: Variable name or array of variable names..

$options: Regular variable options (language, realm, etc) and optional 'form parents' array.

3 calls to variable_edit_subform()
variable_edit_form in ./variable.module
Form for variable list
variable_element_process_fieldset in ./variable.module
Process variable fieldset
variable_realm_edit_variables_form in variable_realm/variable_realm.form.inc
Edit variables for realm.

File

./variable.module, line 422
Variable API module

Code

function variable_edit_subform($list, $options = array()) {
  module_load_include('form.inc', 'variable');
  $list = is_array($list) ? $list : array(
    $list,
  );
  $form = array();
  foreach ($list as $name) {
    if ($variable = variable_get_info($name, $options)) {
      $form[$name] = variable_form_element($variable, $options);
    }
  }
  return $form;
}