You are here

function FrxDrupalApplication::load_report in Forena Reports 7.4

Same name and namespace in other branches
  1. 6.2 FrxDrupalApplication.inc \FrxDrupalApplication::load_report()
  2. 7.2 FrxDrupalApplication.inc \FrxDrupalApplication::load_report()
  3. 7.3 FrxDrupalApplication.inc \FrxDrupalApplication::load_report()

Accepts the name of a file

Returns a xml object of the file.

File

./FrxDrupalApplication.inc, line 109
HostApp.inc Defines all the interface points between the host application and Forena. Each of these methods must be specified in order for Forena to function properly. The base class here is drupal, so those

Class

FrxDrupalApplication

Code

function load_report($report_name) {
  $r = NULL;
  global $language;
  $r_text = '';
  if ($report_name) {
    $i_report_name = $report_name;
    $int_filename = $language->language . '/' . $report_name . '.frx';
    $filename = $report_name . '.frx';
    if (Frx::File()
      ->exists($int_filename) && @$_GET['language'] != 'en') {
      $i_report_name = $language->language . '/' . $report_name;
      $r_text = Frx::File()
        ->contents($int_filename);
      $full_path = Frx::File()
        ->path($int_filename);
      $modified = filemtime($full_path);
      $filename = $int_filename;
    }
    elseif (Frx::File()
      ->exists($filename)) {
      $r_text = Frx::File()
        ->contents($filename);
      $modified = filemtime(Frx::File()
        ->path($filename));
    }
    return $r_text;
  }
}