You are here

public function RendererBase::arrayAttributes in Forena Reports 8

Puts attributes back in array format prior to rendering.

Parameters

array $attributes:

Return value

array Attributes of the node.

File

src/FrxPlugin/Renderer/RendererBase.php, line 1043
FrxRenderer.php Base class for FrxAPI custom Renderer @author davidmetzler

Class

RendererBase
Crosstab Renderer

Namespace

Drupal\forena\FrxPlugin\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;
}