You are here

public function FrxSection::scrapeConfig in Forena Reports 7.5

oull configs.

Overrides RendererBase::scrapeConfig

File

src/Renderer/FrxSection.php, line 11

Class

FrxSection

Namespace

Drupal\forena\Renderer

Code

public function scrapeConfig() {
  $content = array();

  // Determine if we are starting from a dom node
  $sec = 0;
  $config['sections'] = array();

  // put the divs in next
  $nodes = $this->reportDocNode
    ->xpath('div');
  if ($nodes) {
    foreach ($nodes as $node) {
      $dom_node = dom_import_simplexml($node);
      $sec++;
      $id = (string) @$node['id'] ? (string) $node['id'] : 'section-' . $sec;
      $config['sections'][$id] = array(
        'id' => $id,
        'markup' => $node
          ->asXML(),
        'class' => @(string) $node['class'] ? (string) $node['class'] : 'FrxMergeDocument',
        'weight' => $sec,
      );
    }
  }
  return $config;
}