You are here

function forena_parameter_form_submit in Forena Reports 7

Same name and namespace in other branches
  1. 6.2 forena.common.inc \forena_parameter_form_submit()
  2. 7.5 forena.module \forena_parameter_form_submit()
  3. 7.2 forena.common.inc \forena_parameter_form_submit()
  4. 7.3 forena.module \forena_parameter_form_submit()
  5. 7.4 forena.module \forena_parameter_form_submit()

gets the values from the params form redirects to the report page with the values in the querystring.

File

./forena.common.inc, line 732
Common functions used throughout the project but loaded in this file to keep the module file lean.

Code

function forena_parameter_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  $q = '';
  foreach ($values['params'] as $key => $value) {
    $q .= '&' . $key . '=' . urlencode($value);
  }
  $q = trim($q, '&');
  $form_state['redirect'] = array(
    $_GET['q'],
    array(
      'query' => $values['params'],
    ),
  );
}