diff --git a/app/class/Controllerhome.php b/app/class/Controllerhome.php index be4a371..0875d07 100644 --- a/app/class/Controllerhome.php +++ b/app/class/Controllerhome.php @@ -98,7 +98,9 @@ public function desktop() $vars['hiddencolumncount'] = count(User::HOME_COLUMNS) - count($this->user->columns()); if ($display === 'graph') { - $graph = new Graph($_GET); + $graph = $this->servicesession->getgraph(); + $graph->hydrate($_GET); + $this->servicesession->setgraph($graph); $datas = $this->modelhome->cytodata($pagelistopt, $graph); $vars['json'] = json_encode($datas); $vars['graph'] = $graph; diff --git a/app/class/Servicesession.php b/app/class/Servicesession.php index 2b3414d..68a3bcb 100644 --- a/app/class/Servicesession.php +++ b/app/class/Servicesession.php @@ -55,6 +55,17 @@ public function getworkspace(): Workspace return new Workspace($datas); } + public function setgraph(Graph $graph): void + { + $_SESSION['graph'] = $graph->dry(); + } + + public function getgraph(): Graph + { + $datas = $_SESSION['graph'] ?? []; + return new Graph($datas); + } + /** * Empty current user session */