public function RendererBase::setAttributes in Forena Reports 8
Set FRX attributes.
Parameters
DOMNode $node:
array $attributes:
array $frxattributes:
3 calls to RendererBase::setAttributes()
- RendererBase::addNode in src/
FrxPlugin/ Renderer/ RendererBase.php - Add a node to the existing dom element with attributes
- RendererBase::blockDiv in src/
FrxPlugin/ Renderer/ RendererBase.php - Generate generic div tag.
- RendererBase::setFirstNode in src/
FrxPlugin/ Renderer/ RendererBase.php - Sets the first child element to a node and returns it. IF the node
File
- src/
FrxPlugin/ Renderer/ RendererBase.php, line 437 - FrxRenderer.php Base class for FrxAPI custom Renderer @author davidmetzler
Class
- RendererBase
- Crosstab Renderer
Namespace
Drupal\forena\FrxPlugin\RendererCode
public function setAttributes(DOMElement $node, $attributes, $frx_attributes) {
if ($attributes) {
foreach ($attributes as $key => $value) {
$node
->setAttribute($key, $value);
}
}
// Iterate the value
if ($frx_attributes) {
foreach ($frx_attributes as $key => $value) {
// If the value is an array create multiple attributes
// that are of the form key_1, key_2 .... etc.
if (is_array($value)) {
$i = 0;
$done = FALSE;
while (!$done) {
$v = '';
if ($value) {
$v = array_shift($value);
}
$i++;
$k = $key . '_' . trim((string) $i);
$node
->setAttribute($k, $v);
if (!$v) {
$done = TRUE;
}
}
}
else {
if ($value) {
$node
->setAttributeNS($this->xmlns, $key, $value);
}
}
}
}
}