public function FrxReportFile::allReports in Forena Reports 7.4
List all the reports for a language.
Return value
unknown
1 call to FrxReportFile::allReports()
- FrxReportFile::reportsByCategory in ./
FrxReportFile.inc - Generate an ordered list of reports by category
File
- ./
FrxReportFile.inc, line 32
Class
Code
public function allReports() {
global $language;
$reports = array();
$this
->validateAllCache();
$data = $this
->getCache('frx');
$def_language = language_default('language');
if ($data) {
foreach ($data as $base_name => $obj) {
if ($obj->cache) {
if ($obj->cache['language'] != 'en') {
$rpt_name = substr($base_name, strlen($obj->cache['language']) + 1);
}
else {
$rpt_name = $base_name;
}
if ($obj->cache['language'] == $language->language) {
$reports[$rpt_name] = $obj;
}
elseif ($obj->cache['language'] == $def_language && (!isset($reports[$rpt_name]) || $reports[$rpt_name]->cache['language'] == 'en')) {
$reports[$rpt_name] = $obj;
}
elseif ($obj->cache['language'] == 'en' && !isset($reports[$rpt_name])) {
$reports[$rpt_name] = $obj;
}
}
}
}
uasort($reports, 'FrxReportFile::reportCompare');
return $reports;
}