You are here

public function RendererBase::blockDiv in Forena Reports 7.5

Generate generic div tag.

Parameters

unknown_type $config:

unknown_type $text:

9 calls to RendererBase::blockDiv()
FrxCrosstab::generate in src/Renderer/FrxCrosstab.php
Generate the template from the configuration.
FrxEmailMerge::generate in src/Renderer/FrxEmailMerge.php
Generate the template from the configuration.
FrxFieldTable::generate in src/Renderer/FrxFieldTable.php
Generate the template from the configuration.
FrxInclude::generate in src/Renderer/FrxInclude.php
Implement template generator.
FrxMergeDocument::generate in src/Renderer/FrxMergeDocument.php
Generate the template from the configuration.

... See full list

File

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

Class

RendererBase

Namespace

Drupal\forena\Renderer

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