function variable_group_variables in Variable 7.2
Group variable list by variable info property.
@result Array of arrays indexed by that field value.
Parameters
$list: Array of variable names or full built variables.
$field: Field to group by. If empty, they will be added to the '<none>' array.
1 call to variable_group_variables()
- variable_realm_select_variables_form in variable_realm/
variable_realm.form.inc - Select variables for realm.
File
- ./
variable.module, line 752 - Variable API module
Code
function variable_group_variables($list, $field = 'group') {
$groups = array();
foreach ($list as $variable) {
$build = _variable_variable($variable);
$value = isset($build[$field]) ? $build[$field] : '<none>';
$groups[$value][$build['name']] = $variable;
}
return $groups;
}