You are here

function FrxSVGGraph::generateTable in Forena Reports 8

Generate a basic table.

Parameters

\SimpleXMLElement $xml: Data used to preview reprot.

array $config: Template COnfiguration

\SimpleXMLElement $div: variable used to create div obejt on.

1 call to FrxSVGGraph::generateTable()
FrxSVGGraph::generate in src/FrxPlugin/Template/FrxSVGGraph.php

File

src/FrxPlugin/Template/FrxSVGGraph.php, line 561
FrxSVGGraph php SVG Graph generator

Class

FrxSVGGraph

Namespace

Drupal\forena\Template

Code

function generateTable($xml, &$config, &$div) {
  $attrs = array(
    'foreach' => '*',
  );
  $table = $this
    ->setFirstNode($div, 4, 'table');
  if (@$config['caption']) {
    $this
      ->setFirstNode($table, 6, 'caption', $config['caption']);
  }
  $thead = $this
    ->setFirstNode($table, 6, 'thead');
  $throw = $this
    ->setFirstNode($thead, 8, 'tr');
  $tbody = $this
    ->setFirstNode($table, 6, 'tbody');
  $tdrow = $this
    ->setFirstNode($tbody, 8, 'tr', NULL, array(), $attrs);
  if (isset($config['crosstab_columns'])) {
    foreach ($config['crosstab_columns'] as $key => $col) {
      if ($col['type'] != 'ignore') {
        $this
          ->addNode($throw, 10, 'th', $col['label']);
        $this
          ->addNode($tdrow, 10, 'td', $col['contents']);
      }
    }
  }
}