aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPim van den Berg2015-06-22 11:45:45 +0200
committerPim van den Berg2015-06-22 11:49:13 +0200
commitfad32cf4fbf5ad686b670f8500686d4b10ba702a (patch)
tree76b2b38ec4ca0857ce29eadc7b49a48cc7e02afe
parentgraph: only use local json when no json provided by CGP (diff)
downloadapt-panopticon_cgp-fad32cf4fbf5ad686b670f8500686d4b10ba702a.zip
apt-panopticon_cgp-fad32cf4fbf5ad686b670f8500686d4b10ba702a.tar.gz
apt-panopticon_cgp-fad32cf4fbf5ad686b670f8500686d4b10ba702a.tar.bz2
apt-panopticon_cgp-fad32cf4fbf5ad686b670f8500686d4b10ba702a.tar.xz
graph: in case of aggregation, reset pi after initializing $obj
Probably related to #122
-rw-r--r--graph.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/graph.php b/graph.php
index fc1eb83..32748d6 100644
--- a/graph.php
+++ b/graph.php
@@ -30,8 +30,9 @@ if (GET('h') === NULL) {
30$typesdb = parse_typesdb_file($CONFIG['typesdb']); 30$typesdb = parse_typesdb_file($CONFIG['typesdb']);
31 31
32if ($plugin == 'aggregation') { 32if ($plugin == 'aggregation') {
33 $pi = explode("-", GET('pi')); 33 $aggr = true;
34 $plugin = $_GET['p'] = GET('p', $pi[0]); 34 $pi = explode("-", GET('pi'), 2);
35 $plugin = GET('p', $pi[0]);
35} 36}
36 37
37# plugin json 38# plugin json
@@ -81,6 +82,11 @@ switch ($plugin_json[$type]['type']) {
81 break; 82 break;
82} 83}
83 84
85# in case of aggregation, reset pi after initializing $obj to get a correct title
86if ($aggr) {
87 $_GET['pi'] = GET('pi', $pi[1]);
88}
89
84if (isset($typesdb[$type])) { 90if (isset($typesdb[$type])) {
85 $obj->data_sources = array(); 91 $obj->data_sources = array();
86 foreach ($typesdb[$type] as $ds => $property) { 92 foreach ($typesdb[$type] as $ds => $property) {