1<?php
2/**
3 * DokuWiki Plugin prettytables (Action Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Constantinos Xanthopoulos <conx@xanthopoulos.info>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) die();
11
12if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
13if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
14if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
15
16require_once DOKU_PLUGIN.'action.php';
17
18class action_plugin_prettytables extends DokuWiki_Action_Plugin {
19
20    public function register(Doku_Event_Handler $controller) {
21    	$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button');
22
23    }
24
25    public function insert_button(Doku_Event &$event, $param) {
26    	$event->data[] = array (
27        	'type' => 'prettytables',
28                'title' => $this->getLang('fix_table_syntax'),
29                'icon' => '../../plugins/prettytables/plugin.png',
30                );
31    }
32
33}
34
35// vim:ts=4:sw=4:et:
36