You are here

public function FrxTemplate::blockDiv in Forena Reports 7.3

Same name and namespace in other branches
  1. 6.2 templates/FrxTemplate.inc \FrxTemplate::blockDiv()
  2. 7.2 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 ...

... See full list

File

templates/FrxTemplate.inc, line 158
FrxTemplate Base Class for all tmeplates. By default simply renders a document with all the possible tokens in it. @author davidmetzler

Class

FrxTemplate
@file FrxTemplate Base Class for all tmeplates. By default simply renders a document with all the possible tokens in it. @author davidmetzler

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