You are here

function FrxSVGGraph::generateTable in Forena Reports 7.5

Generate a basic table.

Parameters

unknown $xml:

unknown $config:

unknown $div:

1 call to FrxSVGGraph::generateTable()
FrxSVGGraph::generate in src/Renderer/FrxSVGGraph.php
Generate the template from the configuration.

File

src/Renderer/FrxSVGGraph.php, line 696
FrxSVGGraph php SVG Graph generator

Class

FrxSVGGraph

Namespace

Drupal\forena\Renderer

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']);
      }
    }
  }
}