Commit 3a84d0a8 authored by metzlerd's avatar metzlerd
Browse files

Fixed the way contexts are passed from FrxReportContext

parent 0c1ca370
...@@ -25,6 +25,7 @@ class FrxReport { ...@@ -25,6 +25,7 @@ class FrxReport {
public $html; public $html;
public $skin; public $skin;
private $ids; private $ids;
private $data_passed = FALSE;
public $teng; public $teng;
public $parms; public $parms;
public $missing_parms = FALSE; public $missing_parms = FALSE;
...@@ -38,6 +39,7 @@ class FrxReport { ...@@ -38,6 +39,7 @@ class FrxReport {
$this->parameters = array(); $this->parameters = array();
$this->options = array(); $this->options = array();
$this->parms = $data; $this->parms = $data;
if ($data) $this->data_passed = TRUE;
$this->teng = new FrxSyntaxEngine(FRX_TOKEN_EXP, '{}', $this); $this->teng = new FrxSyntaxEngine(FRX_TOKEN_EXP, '{}', $this);
if ($xhtml) { if ($xhtml) {
$dom = $this->dom = new DOMDocument('1.0', 'UTF-8'); $dom = $this->dom = new DOMDocument('1.0', 'UTF-8');
...@@ -303,8 +305,8 @@ class FrxReport { ...@@ -303,8 +305,8 @@ class FrxReport {
*/ */
public function render($format, $render_form=TRUE) { public function render($format, $render_form=TRUE) {
if (!$format) $format = 'web'; if (!$format) $format = 'web';
// Only push the parameter context // Only push the parameter conte
if (!Frx::Data()->contextExists('parm')) Frx::Data()->push($this->parms, 'parm'); Frx::Data()->push($this->parms, 'parm');
$this->format = $format; $this->format = $format;
$dom = $this->dom; $dom = $this->dom;
......
...@@ -322,6 +322,7 @@ function forena_query_preview($form, &$form_state) { ...@@ -322,6 +322,7 @@ function forena_query_preview($form, &$form_state) {
if ($fields) $fields = array_combine($fields, $fields); if ($fields) $fields = array_combine($fields, $fields);
$form_state['storage']['fields'] = $fields; $form_state['storage']['fields'] = $fields;
if ($fields) { if ($fields) {
$report = $t->asXML(); $report = $t->asXML();
$rpt = new FrxReport($report, $data); $rpt = new FrxReport($report, $data);
$preview = $rpt->render('web', FALSE); $preview = $rpt->render('web', FALSE);
......
...@@ -97,7 +97,6 @@ class FrxPDO extends FrxDataSource { ...@@ -97,7 +97,6 @@ class FrxPDO extends FrxDataSource {
$row_node->addChild($key, htmlspecialchars($value)); $row_node->addChild($key, htmlspecialchars($value));
} }
} }
} }
if ($this->debug) { if ($this->debug) {
......
...@@ -9,7 +9,8 @@ class FrxReportContext { ...@@ -9,7 +9,8 @@ class FrxReportContext {
// Get report based on current context and embed it. // Get report based on current context and embed it.
public function getValue($key, $context) { public function getValue($key, $context) {
$output = forena_report($key, NULL, FALSE); $context = Frx::Data()->currentContext();
$output = forena_report($key, $context, FALSE);
return $output; return $output;
} }
......
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