1<?php
2/**
3 * Insert Toolbar for noprint-Plugin
4 * The toolbar image is a compound of images found at http://www.famfamfam.com
5 *
6 * @author Dennis Ploeger <develop@dieploegers.de>
7 */
8
9if (!defined('DOKU_INC')) die();
10if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
11require_once (DOKU_PLUGIN . 'action.php');
12
13class action_plugin_noprint extends DokuWiki_Action_Plugin {
14
15    /**
16     * Return some info
17     */
18    function getInfo() {
19        return array (
20            'author' => 'Dennis Ploeger',
21            'email' => 'develop@dieploegers.de',
22            'date' => '2009-11-20',
23            'name' => 'noprint Plugin (Action Component)',
24            'desc' => 'Inserts a button into the toolbar for the noprint-Plugin',
25            'url'    => 'http://www.dokuwiki.org/plugin:noprint',
26        );
27    }
28
29    /**
30     * Register the eventhandlers
31     */
32    function register(Doku_Event_Handler $controller) {
33        $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());
34    }
35
36    /**
37     * Inserts the toolbar button
38     */
39    function insert_button(& $event, $param) {
40        $event->data[] = array (
41            'type' => 'format',
42            'title' => $this->getLang('qb_noprint'),
43            'icon' => '../../plugins/noprint/toolbar.png',
44            'open' => '<noprint>',
45            'close' => '</noprint>',
46        );
47    }
48
49}
50