function forena_layout_form_submit in Forena Reports 7.2
Same name and namespace in other branches
- 6.2 forena.admin.inc \forena_layout_form_submit()
- 6 forena.admin.inc \forena_layout_form_submit()
- 7 forena.admin.inc \forena_layout_form_submit()
- 7.3 forena.admin.inc \forena_layout_form_submit()
builds a string of the xml document, submits it to forena_save_report.
1 string reference to 'forena_layout_form_submit'
- forena_layout_form in ./
forena.admin.inc - Form function for the edit report form
File
- ./
forena.admin.inc, line 748
Code
function forena_layout_form_submit($form, &$form_state) {
$nodes = array();
$values = $form_state['values'];
$report_name = $values['report_name'];
$r = forena_get_report_editor($report_name);
// Title and category
$r
->setTitle($values['title']);
$r
->setCategory($values['category']);
// Form options
$options = array(
'hidden' => $values['hidden'],
);
$r
->setOptions($options);
// Body
$r
->setBody($values['body']['value']);
// If there are no frx attributes in the body then replace them with the old values.
$frx_nodes = $r->simplexml
->xpath('body//*[@frx:block]');
if (!$frx_nodes) {
$r
->save_attributes_by_id($values['attributes']);
}
//determine redirection.
$report_path = forena_report_path();
$filename = $report_path . '/' . $report_name . '.frx';
if (forena_save_report($report_name, $r
->asXML(), TRUE) == 1) {
drupal_set_message(t('Your report, %s has been saved.', array(
'%s' => $report_name,
)));
}
}