You are here

function forena_fields_form_submit in Forena Reports 7.2

Same name and namespace in other branches
  1. 6.2 forena.admin.inc \forena_fields_form_submit()
  2. 6 forena.admin.inc \forena_fields_form_submit()
  3. 7 forena.admin.inc \forena_fields_form_submit()
  4. 7.3 forena.admin.inc \forena_fields_form_submit()

File

./forena.admin.inc, line 1592

Code

function forena_fields_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  $name = $values['report_name'];
  $r = forena_get_report_editor($name);

  /*now build the fields*/
  $fields = $values['fields'];
  $r
    ->setFields($fields);
  if (forena_save_report($name, $r
    ->asXML(), TRUE) == 1) {
    drupal_set_message(t('Your report, %s has been saved.', array(
      '%s' => $name,
    )));
  }
  else {
    drupal_set_message(t('There was an error saving your report, %s to the database.', array(
      '%s' => $name,
    )));
  }
}