You are here

public function RendererBase::extractTemplateHTML in Forena Reports 7.5

Get the textual representations of html for the configuration engine.

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

... See full list

File

src/Renderer/RendererBase.php, line 957
FrxRenderer.php Base class for Frx custom Renderer @author davidmetzler

Class

RendererBase

Namespace

Drupal\forena\Renderer

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->frxReport->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;
    }
  }
}