Skip to content

Commit

Permalink
store graph params in session close #397
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Dec 3, 2024
1 parent 8dbb7eb commit 3778e1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/class/Controllerhome.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions app/class/Servicesession.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 3778e1f

Please sign in to comment.