forked from Harvie/DokuWiki-Plugin-SVGEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.php
31 lines (26 loc) · 1.04 KB
/
action.php
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
<?php
if(!defined('DOKU_INC')) die();
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once DOKU_PLUGIN.'action.php';
class action_plugin_svgedit extends DokuWiki_Action_Plugin {
function getInfo(){
return array('author' => 'Thomas Mudrunka',
'email' => 'harvie--email-cz',
'date' => '2010-02-21',
'name' => 'SVG-Edit Plugin (do=export_svg handler)',
'desc' => 'Adds handler to have clean way for exporting SVGs',
'url' => 'http://www.dokuwiki.org/plugin:svgedit'
);
}
function register(&$controller) {
$controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this,
'_hookdo');
}
function _hookdo(&$event, $param) {
global $ID;
if($event->data === 'export_svg' && auth_quickaclcheck($ID) >= AUTH_READ) {
header('Content-type: image/svg+xml');
die(rawWiki($ID));
}
}
}