Commit 24fa74b0 authored by metzlerd's avatar metzlerd
Browse files

Update template to use new graphing syntax.

parent 806bb320
......@@ -131,8 +131,8 @@ class FrxGraphTemplate extends FrxTemplate {
'type' => $type,
'renderer' => 'FrxSVGGraph',
'xpath' => $xpath,
'options' => forena_query_string($config),
);
$frxparms = array_merge($config, $frxparms);
$svg = $this->addNode($div, 2, 'svg', NULL, NULL, $frxparms);
if ($gen_table) {
$columns = $this->columns($xml);
......
......@@ -100,9 +100,25 @@ class FrxTemplate {
}
if ($frx_attributes) foreach ($frx_attributes as $key => $value) {
if ($value) {
$attr = $dom->createAttributeNS($this->xmlns, $key);
$attr->value = htmlentities($value);
$pnode->appendChild($attr);
// 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;
foreach ($value as $v) {
$i++;
$k = $key . '_' . trim((string)$i);
$attr = $dom->createAttributeNS($this->xmlns, $k);
$attr->value = htmlentities($v);
$pnode->appendChild($attr);
}
}
// A normal value.
else {
$attr = $dom->createAttributeNS($this->xmlns, $key);
$attr->value = htmlentities($value);
$pnode->appendChild($attr);
}
}
}
$cur_node->appendChild($pnode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment