You are here

function variable_edit_form in Variable 6

Same name and namespace in other branches
  1. 7.2 variable.module \variable_edit_form()
  2. 7 variable.module \variable_edit_form()

Build edit form for one or multiple variables

Parameters

$form_state:

$variable: Variable name or array of variable names

2 calls to variable_edit_form()
variable_group_form in ./variable.module
Form for group variables
variable_module_form in ./variable.module
Form for module variables
2 string references to 'variable_edit_form'
variable_admin_page_edit in variable_admin/variable_admin.pages.inc
Edit variable
variable_admin_page_group in variable_admin/variable_admin.pages.inc
Variable group, edit all variables

File

./variable.module, line 54
Variable API module

Code

function variable_edit_form(&$form_state, $variable_name) {
  module_load_include('form.inc', 'variable');
  $args = is_array($variable_name) ? $variable_name : array(
    $variable_name,
  );
  foreach ($args as $name) {
    if ($variable = variable_info($name)) {
      $form[$name] = variable_form_element($variable);
    }
  }
  return system_settings_form($form);
}