public function RendererBase::extractTemplateHTML in Forena Reports 8
Get the textual representations of html for the configuration engine.
1 call to RendererBase::extractTemplateHTML()
- RendererBase::scrapeConfig in src/
FrxPlugin/ Renderer/ RendererBase.php - Default method for extracting configuration information from the template. This just scrapes teh current child html as the template.
File
- src/
FrxPlugin/ Renderer/ RendererBase.php, line 973 - FrxRenderer.php Base class for FrxAPI custom Renderer @author davidmetzler
Class
- RendererBase
- Crosstab Renderer
Namespace
Drupal\forena\FrxPlugin\RendererCode
public function extractTemplateHTML(DOMNode $node, &$content, $tags = array()) {
$this->report
->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->report->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;
}
}
}