public function FrxTemplate::blockDiv in Forena Reports 7.2
Same name and namespace in other branches
- 6.2 templates/FrxTemplate.inc \FrxTemplate::blockDiv()
- 7.3 templates/FrxTemplate.inc \FrxTemplate::blockDiv()
Generate generic div tag.
Parameters
unknown_type $config:
unknown_type $text:
6 calls to FrxTemplate::blockDiv()
- FrxEmailMerge::generate in templates/
FrxEmailMerge.inc - * * Enter description here ... *
- FrxFieldTable::generate in templates/
FrxFieldTable.inc - * * Enter description here ... *
- FrxGraphTemplate::generate in templates/
FrxGraphTemplate.inc - * * Enter description here ... *
- FrxRptInclude::generate in templates/
FrxRptInclude.inc - * * Enter description here ... *
- FrxTable::generate in templates/
FrxTable.inc - * * Enter description here ... *
File
- templates/
FrxTemplate.inc, line 141
Class
Code
public function blockDiv(&$config, $text = '') {
$body = $this->body;
$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);
$frx_attributes = array(
'block' => $block,
'foreach' => $foreach,
);
$attributes = array(
'id' => $id,
'class' => $class,
);
$node = $this
->addNode($body, 2, 'div', $text, $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' => 'FrxInclude',
'src' => $src,
));
}
return $node;
}