Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
72 lines (66 loc) · 1.77 KB

File metadata and controls

72 lines (66 loc) · 1.77 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* $Id: server.php,v 1.1 2012/11/15 13:26:41 gaudenz Exp $
* Copyright (c) 2006, Gaudenz Alder
*
* This server handles two types of POST requests:
*
* - Save requests persist a graph model XML to a local file.
* They have an xml and draft (GET) parameter. draft
* is optional, the default value for draft is false.
* - Show requests convert a display XML to an image
* They have an xml and format (GET) paramter.
* xml is the mxGraphView XML data, format
* is one of html, png or jpg.
*/
// Includes the mxGraph library
include_once("../src/mxServer.php");
// Gets the format parameter from the URL
$format = $_GET["format"];
// Gets the XML parameter from the POST request
$xml = stripslashes($_POST["xml"]);
if (isset($xml))
{
// Creates an image for the given format
if (isset($format))
{
// Displays a saveAs dialog on the client
header("Content-Disposition: attachment; filename=\"diagram.$format\"");
header("Content-Type: image/$format");
$image = mxGraphViewImageReader::convert($xml, "#FFFFFF");
echo mxUtils::encodeImage($image, $format);
}
else
{
// Stores the xml in a local file
$ext = "tmp";
if (!isset($HTTP_GET_VARS["draft"]))
{
$ext = "xml";
unlink("diagram.tmp");
}
$filename = "diagram.$ext";
$fh = fopen($filename, "w");
fputs($fh, stripslashes($xml));
fclose($fh);
chmod($filename, 0777);
}
}
else
{
// Sends the diagram file to the client if
// there is a draft (tmp-file).
$filename = "diagram.tmp";
if (file_exists($filename))
{
// Avoids cache in Firefox
header("Content-type: text/xml");
Header("Pragma: no-cache"); #HTTP 1.0
Header("Cache-control: private, no-cache, no-store");
Header("Expires: 0");
$fh=fopen($filename, "r");
fpassthru($fh);
fclose($fh);
}
}
?>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.