Due to an apparent bug in the core View class, raw images were not being generated with the inclusion of the DebugToolkit. This checkin does NOT fix the problem, but it does include some debug mechanisms that I have continued to need from time to time.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@98 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -211,9 +211,13 @@ class MapsController extends AppController {
|
||||
*/
|
||||
|
||||
function image($info, $legend = false) {
|
||||
$debug = false;
|
||||
|
||||
if (!$debug) {
|
||||
$this->layout = null;
|
||||
$this->autoLayout = false;
|
||||
Configure::write('debug', '0');
|
||||
}
|
||||
|
||||
// Define our color palate
|
||||
// REVISIT <AP>: 20090513
|
||||
@@ -254,9 +258,7 @@ class MapsController extends AppController {
|
||||
$code['fg'] = $component;
|
||||
}
|
||||
|
||||
//pr($info);
|
||||
|
||||
$this->set(compact('info'));
|
||||
$this->set(compact('info', 'debug'));
|
||||
$this->render('image');
|
||||
}
|
||||
|
||||
|
||||
@@ -83,11 +83,15 @@ foreach ($info['units'] AS $unit) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($debug) {
|
||||
print("<H2>Would Now Render Image as image/png</H2>\n");
|
||||
}
|
||||
else {
|
||||
header("Content-type: image/png");
|
||||
if (! imagepng($image)) {
|
||||
die("Couldn't output image!");
|
||||
}
|
||||
}
|
||||
|
||||
// Clear image from memory
|
||||
imagedestroy($image);
|
||||
|
||||
Reference in New Issue
Block a user