public function FrxDrupalApplication::repositories in Forena Reports 7.2
Same name and namespace in other branches
- 6.2 FrxDrupalApplication.inc \FrxDrupalApplication::repositories()
- 7.3 FrxDrupalApplication.inc \FrxDrupalApplication::repositories()
- 7.4 FrxDrupalApplication.inc \FrxDrupalApplication::repositories()
Return the repositories configured for this applicaiton.
Overrides FrxHostApplication::repositories
File
- ./
FrxDrupalApplication.inc, line 247 - 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
Code
public function repositories() {
global $_forena_repositories;
$repos = array();
// Load the repository list from the global settings.php file.
if ($_forena_repositories) {
$repos = $_forena_repositories;
}
$path = $this
->forena_path();
// Overide difinitions of the sample and drupal repositories.
$repos['forena_help'] = array(
'path' => $path . '/repos/forena_help',
'title' => 'Forena Help Reports',
);
$repos['drupal'] = array(
'path' => $path . '/repos/drupal',
'title' => 'Drupal Reports',
);
$repos['sampledb'] = array(
'path' => $path . '/repos/sample',
'title' => 'Sample DB Repository',
);
// Retrieve the repositories defined in the database;
$results = db_query('SELECT * FROM {forena_repositories}');
foreach ($results as $r) {
if ($r->config) {
$new_r = unserialize($r->config);
}
else {
$new_r = array();
}
$r_name = $r->repository;
if (is_array(@$repos[$r_name])) {
$new_r = array_merge($new_r, $repos[$r_name]);
}
else {
$new_r['source'] = 'user';
}
$new_r['title'] = $r->title;
$new_r['enabled'] = $r->enabled;
$repos[$r_name] = $new_r;
}
drupal_alter('forena_repos', $repos);
return $repos;
}