You are here

public function RendererBase::arrayAttributes in Forena Reports 7.5

Puts attributes back in array format prior to rendering.

Parameters

unknown $attributes:

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

File

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

Class

RendererBase

Namespace

Drupal\forena\Renderer

Code

public function arrayAttributes($attributes) {
  $remove_attrs = array();
  foreach ($attributes as $key => $value) {
    if (is_array($value)) {
      $i = 0;
      foreach ($value as $idx => $v) {
        $i++;
        $new_key = $key . '_' . trim($i);
        $attributes[$new_key] = (string) $v;
      }
      $remove_attrs[] = $key;
    }
  }
  foreach ($remove_attrs as $key) {
    unset($attributes[$key]);
  }
  return $attributes;
}