You are here

public function FrxReport::__construct in Forena Reports 7.4

Same name and namespace in other branches
  1. 6.2 FrxReport.inc \FrxReport::__construct()
  2. 6 FrxReport.inc \FrxReport::__construct()
  3. 7 FrxReport.inc \FrxReport::__construct()
  4. 7.2 FrxReport.inc \FrxReport::__construct()
  5. 7.3 FrxReport.inc \FrxReport::__construct()

File

./FrxReport.inc, line 63
Basic report provider. Controls the rendering of the report.

Class

FrxReport

Code

public function __construct($xhtml = '', $data = array(), $edit = FALSE) {
  $this->renderers = Frx::getRendererPlugins();
  $this->access = array();
  $this->parameters = array();
  $this->options = array();
  $this->teng = new FrxSyntaxEngine(FRX_TOKEN_EXP, '{}', $this);
  $this
    ->setParameters($data);
  if ($xhtml) {
    $dom = $this->dom = new DOMDocument('1.0', 'UTF-8');

    // Old assumption is an ojbect is a simplexml one
    if (is_object($xhtml)) {
      $xhtml = $xhtml
        ->asXML();
    }

    // Load document and simplexml representation
    try {
      $success = $dom
        ->loadXML($xhtml);
    } catch (Exception $e) {
      return;
    }
    if (!$success) {
      return;
    }
    $this->xpathQuery = new DOMXPath($dom);
    $this
      ->setReport($dom, $this->xpathQuery);
  }
}