} switch ($_REQUEST['renderer']) { case 'PNG': $renderer = new GD_GRenderer($_REQUEST['width'], $_REQUEST['height'], 'png'); $ext = 'png'; break; case 'JPEG': $renderer = new GD_GRenderer($_REQUEST['width'], $_REQUEST['height'], 'jpg'); $ext = 'jpg'; break; case 'PDF': $renderer = new PDFLib_GRenderer($_REQUEST['format'], $_REQUEST['orientation']); $ext = 'pdf'; break; case 'PS': $renderer = new PS_GRenderer($_REQUEST['format'], $_REQUEST['orientation']); $ext = 'ps'; break; default: $smarty->assign('msg', tra('You must select a renderer.')); $smarty->display('error.tpl'); die; } if (file_exists($cache_file) && time() - filemtime($cache_file) < 3600) { $renderer->httpHeaders("graph.{$ext}"); readfile($cache_file); exit; } $handler = new TikiSheetDatabaseHandler($sheetId); $grid = new TikiSheet($_REQUEST['sheetId']); $grid->import($handler);