You are here

protected function ViewsEFFieldsetTree::setWeights in Views Exposed Form Fieldset 7.2

1 call to ViewsEFFieldsetTree::setWeights()
ViewsEFFieldsetTree::__construct in includes/tree.inc

File

includes/tree.inc, line 91

Class

ViewsEFFieldsetTree

Code

protected function setWeights(&$tree, $negative_offset = FALSE) {
  $weight = count($tree);
  if ($negative_offset) {
    $weight = 0 - $weight;
  }
  foreach ($tree as &$item) {
    $item['weight'] = $weight++;
    $this
      ->setWeights($item['children'], $negative_offset);
  }
}