You are here

function forena_get_report_editor in Forena Reports 7.2

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

Accepts the name of a file

Returns an editor object of the file.

19 calls to forena_get_report_editor()
forena_add_data_block_form in ./forena.admin.inc
forena_add_param_form in ./forena.admin.inc
forena_add_param_form_submit in ./forena.admin.inc
forena_add_report_form in ./forena.admin.inc
forena_add_report_form_submit in ./forena.admin.inc

... See full list

File

./forena.admin.inc, line 384

Code

function forena_get_report_editor($report_name) {
  require_once 'FrxReportEditor.inc';
  if ($report_name) {
    $r_text = '';
    $report_path = forena_report_path();
    $filename = $report_path . '/' . $report_name . '.frx';
    if (file_exists($filename)) {
      $r_text = file_get_contents($filename);
    }
    $r = new FrxReportEditor($r_text);
    return $r;
  }
  else {
    return new FrxReportEditor();
  }
}