Commit 92382a46 authored by David Metzler's avatar David Metzler
Browse files

Fixes to renderer to allow html in crosstab. Alo add some data to the

report context. 
parent 2726fc37
......@@ -104,8 +104,8 @@ function forena_report_object($report='', $data='') {
* @return string
*/
function forena_inner_xml($xml, $tag) {
if (is_object($xml) && is_object($xml->$tag)) {
$xml_data = $xml->$tag->asXML();
if (is_object($xml) && $tag) {
$xml_data = $xml->asXML();
$xml_data = preg_replace("/<\/?" . $tag . "(.|\s)*?>/", "", $xml_data);
};
return $xml_data;
......
......@@ -946,7 +946,7 @@ function forena_report($name_in, $parms = NULL, $print = TRUE, $filename='') {
$time = @new DateTime($value);
$desc['time'] = date_format($time, 'Y-m-d H:i:s');
$desc['basepath'] = base_path();
$desc['path'] = $desc['basepath'] . Frx::File()->path($desc['filename'], TRUE);
$desc['path'] = $desc['basepath'] . Frx::File()->directory(Frx::File()->path($desc['filename'], TRUE));
$desc['theme'] = $desc['basepath'] . drupal_get_path('theme',$GLOBALS['theme']);
$desc['q'] = $_GET['q'];
if (!$desc['exists']) {
......
......@@ -128,7 +128,7 @@ class FrxCrosstab extends FrxRenderer {
if ($node->thead && $node->thead->tr) {
foreach ($node->thead->tr->children() as $name => $cell) {
$hcol = array();
$hcol['data'] = (string)$cell;
$hcol['data'] = forena_inner_xml($cell, $name);
$hcol['depth'] = 1;
foreach ($cell->attributes() as $k => $v) {
$hcol[$k] = (string)$v;
......@@ -144,7 +144,7 @@ class FrxCrosstab extends FrxRenderer {
if ($node->tbody && $node->tbody->tr) {
foreach ($node->tbody->tr->children() as $name => $cell) {
$col = array();
$col['data'] = @(string)$cell;
$col['data'] = forena_inner_xml($cell, $name);
foreach ($cell->attributes() as $k => $v) {
$col[$k] = (string)$v;
}
......
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