1<?php
2/**
3 * Example Action Plugin: Inserts a newline button into the toolbar
4 *
5 * @author Xarkam <xarkam@gmail.com>
6 */
7
8if (!defined('DOKU_INC')) die();
9
10class action_plugin_newline extends DokuWiki_Action_Plugin {
11
12    /**
13     * Register the eventhandlers
14     */
15    public function register(Doku_Event_Handler $controller) {
16        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());
17    }
18
19    /**
20     * Inserts the toolbar button
21     */
22    public function insert_button(Doku_Event $event, $param) {
23        $event->data[] = array (
24            'type' => 'format',
25            'title' => $this->getLang('qb_newlinebutton'),
26            'icon' => '../../plugins/newline/newline.png',
27            'open' => '\\\\ ',
28            'close' => '',
29        );
30    }
31
32}
33