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
|
<?php
class IMAGEHandler extends DATAHandler {
public $data_not_needed = true;
function __construct(&$opts = NULL, STREAMHandler $h = NULL) {
$this->content_type = "image/png";
$this->extension = "png";
parent::__construct($opts, $h);
$this->multigroup = true;
}
function End($flags = 0) {
try {
$req = new DATARequest();
$draw = $req->CreatePlotter();
$draw->Create();
$id = $draw->Save();
}
catch(ADEIException $e) {
$error = $e->getInfo();
try {
if (!$draw) {
if (!$req) $req = new REQUEST();
$draw = $req->CreateTextPlotter();
}
// $draw->CreateMessage("Error", "No Data");
$draw->CreateMessage("Error", $error);
$id = $draw->Save();
$error = false;
} catch (ADEIException $ex) {
$ex->logInfo(NULL, $draw);
}
}
$res = DRAW::Display($id);
$this->h->Write($res);
}
}
?>
|