You are here

public function FrxRenderer::extractTemplateHTML in Forena Reports 7.4

Get the textual representations of html for the configuration engine.

6 calls to FrxRenderer::extractTemplateHTML()
FrxCrosstab::scrapeConfig in renderers/FrxCrosstab.inc
Extract table configuration from the HTML
FrxFieldTable::scrapeConfig in renderers/FrxFieldTable.inc
Extract table configuration from the HTML
FrxMergeDocument::scrapeConfig in renderers/FrxMergeDocument.inc
Default method for extracting configuration information from the template. This just scrapes teh current child html as the template.
FrxRenderer::scrapeConfig in renderers/FrxRenderer.inc
Default method for extracting configuration information from the template. This just scrapes teh current child html as the template.
FrxSVGGraph::scrapeConfig in renderers/FrxSVGGraph.inc
Derive config variables from graph.

... See full list

File

renderers/FrxRenderer.inc, line 948
FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

Class

FrxRenderer
@file FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

Code

public function extractTemplateHTML(DOMNode $node, &$content, $tags = array()) {
  $this->frxReport
    ->get_attributes_by_id();
  $cur_section = 'header';
  if (!$content) {
    $content = array(
      'header' => '',
      'content' => '',
      'footer' => '',
    );
  }
  if (!$tags) {
    $cur_section = 'content';
  }
  foreach ($node->childNodes as $child) {
    switch ($child->nodeType) {
      case XML_ELEMENT_NODE:
        if (array_search($child->tagName, $tags) !== FALSE) {
          $cur_section = 'content';
        }
        elseif ($tags && $cur_section == 'content') {
          $cur_section = 'footer';
        }
        @($content[$cur_section]['value'] .= $this->dom
          ->saveXML($child));
        break;
      case XML_TEXT_NODE:
      case XML_ENTITY_REF_NODE:
      case XML_ENTITY_NODE:
        @($content[$cur_section]['value'] .= $child->textContent);
        break;
      case XML_COMMENT_NODE:
        @($content[$cur_section]['value'] .= '<!--' . $child->data . '-->');
        break;
    }
  }
}