You are here

function views_fieldsets_hierarchy_total_weights_set in Views fieldsets 7

Same name and namespace in other branches
  1. 7.2 views_fieldsets.module \views_fieldsets_hierarchy_total_weights_set()

Helper to ...

1 call to views_fieldsets_hierarchy_total_weights_set()
views_fieldsets_hierarchy_total_weights in ./views_fieldsets.module
Helper to ...

File

./views_fieldsets.module, line 290
Hooks, helpers and theming for the Views Fieldsets module.

Code

function views_fieldsets_hierarchy_total_weights_set(&$hierarchy, &$fields, &$weight) {
  foreach ($hierarchy as $field_name => $field) {
    $field->info->total_weight = $weight++;
    $fields[$field_name] = $field;
    if (isset($field->children)) {
      views_fieldsets_hierarchy_total_weights_set($field->children, $fields, $weight);
    }
  }
}