Commit 6abb8fd72843dc3a40db24a8dc6ae191eb86859c

Authored by Benjamin Renard
1 parent b39c9d1d

Fix save plot

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
php/downloadPlot.php
... ... @@ -10,19 +10,19 @@ if (!isset($_POST['sessionId']))
10 10 }
11 11 $sessionId = $_POST['sessionId'];
12 12  
13   -if (!isset($_POST['tabId']))
  13 +if (!isset($_POST['interactiveId']))
14 14 {
15 15 header("HTTP/1.0 400 Bad Request");
16   - echo json_encode(array("success" => false, "error" => "Unknown tab Id"));
  16 + echo json_encode(array("success" => false, "error" => "Unknown interactive Id"));
17 17 exit;
18 18 }
19   -$tabId = $_POST['tabId'];
  19 +$interactiveId = $_POST['interactiveId'];
20 20  
21 21 $preview = empty($_POST['preview']) ? FALSE : $_POST['preview'];
22 22  
23   -download_plot($sessionId, $tabId, $preview);
  23 +download_plot($sessionId, $interactiveId, $preview);
24 24  
25   -function download_plot($sessionId, $tabId, $preview)
  25 +function download_plot($sessionId, $interactiveId, $preview)
26 26 {
27 27 // Must be fresh start
28 28 if( headers_sent() )
... ... @@ -38,10 +38,10 @@ function download_plot($sessionId, $tabId, $preview)
38 38  
39 39 //Build file path
40 40 if (!$preview) {
41   - $fullPath = USERPATH."/".$sessionId."/RES/Plot_/".$tabId.".png";
  41 + $fullPath = USERPATH."/".$sessionId."/RES/Plot_/".$interactiveId.".png";
42 42 }
43 43 else {
44   - $fullPath = USERPATH."/".$sessionId."/RES/Plot_/".str_replace('plot_','instant',$tabId).".png";
  44 + $fullPath = USERPATH."/".$sessionId."/RES/Plot_/".str_replace('plot_','instant',$interactiveId).".png";
45 45 }
46 46 // File Exists?
47 47 if( file_exists($fullPath) ){
... ...