You are here

function forena_query_remove_group in Forena Reports 7.3

Remove a grouping.

_state

Parameters

unknown_type $form:

1 string reference to 'forena_query_remove_group'
_forena_query_filter_ctl in ./forena_query.inc
Recursively build query form.

File

./forena_query.inc, line 598

Code

function forena_query_remove_group($form, &$form_state) {
  $where = $form_state['values']['where'];
  _forena_query_clean_values($where, $form['where']);

  // Determine containing field of pressed button.
  $parents = $form_state['triggering_element']['#parents'];
  array_shift($parents);
  array_pop($parents);
  array_pop($parents);
  _forena_query_remove_parent_data($where, $parents);
  if (!$where['filter']) {
    $where['filter'][] = array_fill_keys(array(
      'field',
      'op',
      'value',
    ), '');
  }
  $form_state['storage']['builder']['where'] = $where;
  $form_state['rebuild'] = TRUE;
}