Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
forena
Commits
806e35bc
Commit
806e35bc
authored
May 28, 2013
by
David Metzler
Browse files
Added support for frx:skip_root attribute.
parent
63eea523
Changes
2
Hide whitespace changes
Inline
Side-by-side
FrxReport.inc
View file @
806e35bc
...
...
@@ -173,6 +173,7 @@ class FrxReport {
$frx
=
$node
->
attributes
(
FRX_NS
);
$include_root
=
!
isset
(
$frx
[
'skip_root'
])
||
!
$frx
[
'skip_root'
];
$elements
=
$dom_node
->
childNodes
->
length
;
// Test to see if we have any nodes that contain data url
if
(
$node
->
xpath
(
'*//@frx:*'
)
||
$frx
)
{
...
...
@@ -241,11 +242,11 @@ class FrxReport {
foreach
(
$tmp_attrs
as
$key
=>
$value
)
{
$r_attr_text
.
=
' '
.
$key
.
'="'
.
(
string
)
$value
.
'"'
;
}
$o
.
=
$this
->
teng
->
replace
(
'<'
.
$tag
.
$r_attr_text
.
'>'
);
if
(
$include_root
)
$o
.
=
$this
->
teng
->
replace
(
'<'
.
$tag
.
$r_attr_text
.
'>'
);
foreach
(
$dom_node
->
childNodes
as
$child
)
{
$o
.
=
$this
->
render_section
(
$child
);
}
$o
.
=
'</'
.
$tag
.
'>'
;
if
(
$include_root
)
$o
.
=
'</'
.
$tag
.
'>'
;
Frx
::
Data
()
->
pop
();
}
}
...
...
@@ -260,13 +261,13 @@ class FrxReport {
}
}
else
{
$o
.
=
$this
->
teng
->
replace
(
'<'
.
$tag
.
$attr_text
.
'>'
);
if
(
$include_root
)
$o
.
=
$this
->
teng
->
replace
(
'<'
.
$tag
.
$attr_text
.
'>'
);
// None found, so render children
foreach
(
$dom_node
->
childNodes
as
$child
)
{
$o
.
=
$this
->
render_section
(
$child
);
}
$o
.
=
'</'
.
$tag
.
'>'
;
if
(
$include_root
)
$o
.
=
'</'
.
$tag
.
'>'
;
}
}
if
(
$is_data_block
&&
$continue
)
{
...
...
repos/reports/help/design.frx
View file @
806e35bc
...
...
@@ -65,6 +65,12 @@
'*', which would imply creating a a repeating pattern for every row or
element returned by the query.
</p>
<p
id=
"skip_root"
>
<strong>
frx:skip_root attribute
</strong>
- This will cause the current node
of the report to not be rendered, but children will be rendered as normal.
This is most commonly used when you want the frx:foreach to not render the node
containing the frx:foreach attribute.
</p>
<h2>
Report fields
</h2>
<p>
Each field in the report is referenced by an xpath expression
enclosed by curly braces. In its simplest form the xpath xpression can
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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