-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
streamlined code with graphviz plugin
ODT export should work now
- Loading branch information
1 parent
05cbae8
commit 95615d6
Showing
4 changed files
with
92 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html) | ||
* @author Andreas Gohr <andi@splitbrain.org> | ||
*/ | ||
|
||
if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../../'); | ||
define('NOSESSION',true); | ||
require_once(DOKU_INC.'inc/init.php'); | ||
|
||
// let the syntax plugin do the work | ||
$data = $_REQUEST; | ||
$plugin = plugin_load('syntax','ditaa'); | ||
$cache = $plugin->_imgfile($data); | ||
if(!$cache) _fail(); | ||
|
||
header('Content-Type: image/png;'); | ||
header('Expires: '.gmdate("D, d M Y H:i:s", time()+max($conf['cachetime'], 3600)).' GMT'); | ||
header('Cache-Control: public, proxy-revalidate, no-transform, max-age='.max($conf['cachetime'], 3600)); | ||
header('Pragma: public'); | ||
http_conditionalRequest($time); | ||
echo io_readFile($cache,false); | ||
|
||
|
||
function _fail(){ | ||
header("HTTP/1.0 404 Not Found"); | ||
header('Content-Type: image/png'); | ||
echo io_readFile('broken.png',false); | ||
exit; | ||
} | ||
|
||
//Setup VIM: ex: et ts=4 enc=utf-8 : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters