Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
forena
Commits
a2a07cdd
Commit
a2a07cdd
authored
Oct 25, 2013
by
metzlerd
Browse files
Removed old stuff.
parent
d7bbf6b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
forena.module
View file @
a2a07cdd
...
...
@@ -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 ...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment