diff --git a/graph.php b/graph.php index fc1eb83..32748d6 100644 --- a/graph.php +++ b/graph.php @@ -30,8 +30,9 @@ $typesdb = parse_typesdb_file($CONFIG['typesdb']); if ($plugin == 'aggregation') { - $pi = explode("-", GET('pi')); - $plugin = $_GET['p'] = GET('p', $pi[0]); + $aggr = true; + $pi = explode("-", GET('pi'), 2); + $plugin = GET('p', $pi[0]); } # plugin json @@ -81,6 +82,11 @@ break; } +# in case of aggregation, reset pi after initializing $obj to get a correct title +if ($aggr) { + $_GET['pi'] = GET('pi', $pi[1]); +} + if (isset($typesdb[$type])) { $obj->data_sources = array(); foreach ($typesdb[$type] as $ds => $property) {