You are here

function _forena_query_remove_parent_data in Forena Reports 7.3

Assuming a tree=true structure, drill down into parent to add a data structure to the appropriate point in the tree.

Parameters

$values data from form elements:

$parents array of parents that indicates how deep to set the tree.:

$to_add element to add:

2 calls to _forena_query_remove_parent_data()
forena_query_remove_filter in ./forena_query.inc
Remove a filter grouping.
forena_query_remove_group in ./forena_query.inc
Remove a grouping.

File

./forena_query.inc, line 562

Code

function _forena_query_remove_parent_data(&$values, &$parents) {
  if ($parents) {
    $key = array_shift($parents);
    if (!$parents) {
      unset($values[$key]);
    }
    else {
      _forena_query_remove_parent_data($values[$key], $parents);
    }
  }
}