You are here

public function FrxRenderer::arrayAttributes in Forena Reports 7.4

Puts attributes back in array format prior to rendering.

Parameters

unknown $attributes:

1 call to FrxRenderer::arrayAttributes()
FrxSVGGraph::generate in renderers/FrxSVGGraph.inc
Generate the template from the configuration.

File

renderers/FrxRenderer.inc, line 1016
FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

Class

FrxRenderer
@file FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

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