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
6d9677a3
Commit
6d9677a3
authored
May 30, 2014
by
David Metzler
Browse files
#2276807
XML document declaration missing in XML Reports
parent
5513d902
Changes
8
Hide whitespace changes
Inline
Side-by-side
FrxDocument.inc
View file @
6d9677a3
...
...
@@ -11,6 +11,17 @@ class FrxDocument {
public
$charset
=
'UTF-8'
;
public
$allowDirectOutput
=
FALSE
;
public
function
header
(
$r
,
$print
=
TRUE
)
{
$r
->
html
=
''
;
if
(
$this
->
content_type
)
{
header
(
'Content-Type: '
.
$this
->
content_type
.
' ;charset='
.
$this
->
charset
);
header
(
'Cache-Control:'
);
header
(
'Pragma:'
);
$file_name
=
basename
(
$_GET
[
'q'
]);
header
(
'Content-Disposition: attachment; filename="'
.
$file_name
.
'"'
);
header
(
'Cache-Control: must-revalidate'
);
}
}
public
function
loadCSSFiles
(
$format
)
{
// Add css files
...
...
@@ -64,19 +75,8 @@ class FrxDocument {
}
public
function
output
(
&
$output
)
{
if
(
$this
->
content_type
)
{
header
(
'Content-Type: '
.
$this
->
content_type
.
' ;charset='
.
$this
->
charset
);
header
(
'Cache-Control:'
);
header
(
'Pragma:'
);
$file_name
=
basename
(
$_GET
[
'q'
]);
header
(
'Content-Disposition: attachment; filename="'
.
$file_name
.
'"'
);
header
(
'Cache-Control: must-revalidate'
);
print
$output
;
return
TRUE
;
}
else
{
return
FALSE
;
}
}
/**
...
...
FrxEditor.inc
View file @
6d9677a3
...
...
@@ -911,6 +911,7 @@ class FrxEditor {
$cache
=
array
();
$o
=
Frx
::
Document
(
$format
);
$o
->
header
(
$this
->
frxReport
,
$print
);
$this
->
frxReport
->
allowDirectWrite
=
$o
->
allowDirectOutput
;
if
(
$this
->
frxReport
->
allowDirectWrite
&&
$filename
)
{
$this
->
frxReport
->
file
=
fopen
(
$filename
,
'w'
);
...
...
FrxReport.inc
View file @
6d9677a3
...
...
@@ -204,7 +204,6 @@ class FrxReport {
$body
=
$dom
->
getElementsByTagName
(
'body'
)
->
item
(
0
);
// Render the rport.
$this
->
html
=
''
;
$c
=
Frx
::
Controls
(
'FrxRenderer'
);
$c
->
initReportNode
(
$body
,
$this
);
if
(
!
$this
->
missing_parms
)
$c
->
renderChildren
(
$body
,
$this
->
html
);
...
...
docformats/FrxHtmlDoc.inc
View file @
6d9677a3
...
...
@@ -24,9 +24,4 @@ class FrxHtmlDoc extends FrxDocument {
$output
.
=
'<title>'
.
$r
->
title
.
'</title></head><body class="forena-report"><h1>'
.
$r
->
title
.
'</h1>'
.
$r
->
html
.
'</body></html>'
;
return
$output
;
}
public
function
output
(
&
$output
)
{
print
$output
;
return
TRUE
;
}
}
\ No newline at end of file
docformats/FrxMPDF.inc
View file @
6d9677a3
...
...
@@ -17,6 +17,10 @@ class FrxMPDF extends FrxDocument {
}
public
function
header
(
$r
,
$print
=
TRUE
)
{
$r
->
html
=
''
;
}
public
function
render
(
$r
,
$format
,
$options
=
array
())
{
// To Do
...
...
docformats/FrxPrincePDF.inc
View file @
6d9677a3
...
...
@@ -77,14 +77,13 @@ class FrxPrincePDF extends FrxDocument {
}
}
public
function
output
(
&
$output
)
{
if
(
$output
)
{
public
function
header
(
$r
,
$print
=
FALSE
)
{
$r
->
html
=
''
;
if
(
$print
)
{
header
(
'Content-Type: '
.
$this
->
content_type
);
header
(
'Cache-Control:'
);
header
(
'Pragma:'
);
header
(
'Cache-Control: must-revalidate'
);
print
$output
;
return
TRUE
;
}
}
}
docformats/FrxSVGDoc.inc
View file @
6d9677a3
...
...
@@ -11,6 +11,16 @@ class FrxSVGDoc extends FrxDocument {
$this
->
content_type
=
'image/svg+xml'
;
}
public
function
header
(
$r
,
$print
=
TRUE
)
{
$r
->
html
=
''
;
if
(
$print
&&
$$this
->
content_type
)
{
header
(
'Content-Type: '
.
$this
->
content_type
);
header
(
'Cache-Control:'
);
header
(
'Pragma:'
);
header
(
'Cache-Control: must-revalidate'
);
}
}
public
function
render
(
$r
,
$format
,
$options
=
array
())
{
$output
=
''
;
$doc
=
new
DomDocument
();
...
...
@@ -38,11 +48,6 @@ class FrxSVGDoc extends FrxDocument {
*/
public
function
output
(
&
$output
)
{
if
(
$this
->
content_type
)
{
header
(
'Content-Type: '
.
$this
->
content_type
);
header
(
'Cache-Control:'
);
header
(
'Pragma:'
);
header
(
'Cache-Control: must-revalidate'
);
print
$output
;
return
TRUE
;
}
...
...
docformats/FrxXMLDoc.inc
View file @
6d9677a3
...
...
@@ -24,6 +24,16 @@ class FrxXMLDoc extends FrxDocument {
}
}
public
function
header
(
$r
,
$print
=
TRUE
)
{
if
(
$print
)
{
header
(
'Content-Type: '
.
$this
->
content_type
);
header
(
'Cache-Control:'
);
header
(
'Pragma:'
);
header
(
'Cache-Control: must-revalidate'
);
}
$r
->
html
=
'<?xml version="1.0"?>'
.
"
\n
"
;
}
public
function
render
(
$r
,
$format
,
$options
=
array
())
{
$output
=
''
;
...
...
@@ -39,16 +49,6 @@ class FrxXMLDoc extends FrxDocument {
}
public
function
output
(
&
$output
)
{
header
(
'Content-Type: '
.
$this
->
content_type
);
header
(
'Cache-Control:'
);
header
(
'Pragma:'
);
header
(
'Cache-Control: must-revalidate'
);
print
'<?xml version="1.0"?>'
.
"
\n
"
;
print
$output
;
return
TRUE
;
}
private
function
_build_opening_root_tag_contents
()
{
$tag_contents
=
$this
->
root_tag
;
if
(
isset
(
$this
->
root_attributes
)
&&
is_array
(
$this
->
root_attributes
))
{
...
...
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