public function FrxRenderer::blockDiv in Forena Reports 7.4
Generate generic div tag.
Parameters
unknown_type $config:
unknown_type $text:
9 calls to FrxRenderer::blockDiv()
- FrxCrosstab::generate in renderers/
FrxCrosstab.inc - Generate the template from the configuration.
- FrxEmailMerge::generate in renderers/
FrxEmailMerge.inc - Generate the template from the configuration.
- FrxFieldTable::generate in renderers/
FrxFieldTable.inc - Generate the template from the configuration.
- FrxInclude::generate in renderers/
FrxInclude.inc - Implement template generator.
- FrxMergeDocument::generate in renderers/
FrxMergeDocument.inc - Generate the template from the configuration.
File
- renderers/
FrxRenderer.inc, line 743 - 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 blockDiv(&$config, $text = '') {
$node = $this->reportDocDomNode;
$heading = $this
->extract('heading', $config);
$descr = $this
->extract('description', $config);
$include = $this
->extract('include', $config);
$block = $this
->extract('block', $config);
$foreach = $this
->extract('foreach', $config);
$id = $this
->extract('id', $config);
if (!$id) {
$id = $this
->idFromBlock($block);
}
$class = $this
->extract('class', $config);
if (!$class) {
$class = get_class($this);
}
$frx_attributes = array(
'block' => $block,
);
if ($foreach) {
$frx_attributes['foreach'] = $foreach;
}
$attributes = array(
'id' => $id,
'class' => $class,
);
$this
->setAttributes($node, $attributes, $frx_attributes);
if ($heading) {
$this
->addNode($node, 4, 'h2', $heading);
}
if ($descr) {
$this
->addNode($node, 4, 'p', $descr);
}
if ($include) {
$src = 'reports/' . str_replace('/', '.', $include);
$this
->addNode($node, 4, 'div', NULL, NULL, array(
'renderer' => get_class($this),
'src' => $src,
));
}
return $node;
}