You are here

public function ReportFileSystem::menuReports in Forena Reports 8

File

src/File/ReportFileSystem.php, line 133

Class

ReportFileSystem

Namespace

Drupal\forena\File

Code

public function menuReports() {
  global $language;
  $this
    ->validateAllCache();
  $data = $this
    ->getCache('frx');
  $reports = array();
  foreach ($data as $base_name => $obj) {
    if ($obj->cache && isset($obj->cache['menu']['path']) && ($obj->cache['language'] == $language->language || $obj->cache['language'] == 'en' && !isset($obj->cache['menu']['path']))) {
      if ($obj->cache['language'] != 'en') {
        $obj->name = substr($base_name, 3);
      }
      else {
        $obj->name = $base_name;
      }
      $reports[$obj->cache['menu']['path']] = $obj;
    }
  }
  return $reports;
}