Commit a2a07cdd authored by metzlerd's avatar metzlerd
Browse files

Removed old stuff.

parent d7bbf6b5
......@@ -1378,81 +1378,6 @@ function _forena_db_sync($base_path, $subdir='') {
return $skins;
}
/**
* Load cache files from the database
*/
function forena_db_sync($subdir='') {
static $prefix = '';
static $skins = '';
if (!$subdir) {
$prefix = '';
db_delete('forena_reports')
->execute();
}
$save_count=0;
$path =forena_report_path() . '/' . $subdir;
$d = dir($path);
if ($d) while (false !== ($rpt_file = $d->read())) {
$src_file = trim($d->path, '/') . '/' . trim($rpt_file, '/');
$dest_file = $path . '/' . trim($rpt_file, '/');
if (is_file($src_file)) {
@list($base_file, $ext) = explode('.', $rpt_file, 2);
switch($ext) {
// Load Forena Reports
case 'frx':
$base_file = trim($prefix . '/' . $base_file, '/');
try {
$r_xml =file_get_contents($src_file);
} catch (Exception $e) {
$s = t('unable to load Report %s', $r_xml);
forena_error($s, $s . $e->getMessage());
}
// Load the report
$r = new FrxReport($r_xml);
$save_count = forena_save_report($base_file, $r_xml, FALSE);
$r->__destruct();
unset($r);
break;
//load into list of skins
case 'skinfo':
$data = file_get_contents($src_file);
$skin = drupal_parse_info_format($data);
$skin_name = @$skin['name'] ? $skin['name'] : $base_file;
$skins[$base_file] = $skin_name;
break;
}
}
elseif (is_dir($src_file)) {
if (strpos($rpt_file, '.')!==0) {
$save_prefix = $prefix;
$prefix .= '/' . $rpt_file;
$prefix = trim($prefix, '/');
forena_db_sync($prefix);
$prefix = $save_prefix;
}
}
}
if ($d) $d->close();
// Done with cache sync.
if (!$subdir) {
// Cache the skins found
asort($skins);
variable_set('forena_skins', $skins);
// Rebuild menus.
menu_rebuild();
}
return $save_count;
}
/**
*
* Enter description here ...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment