xref: /plugin/todo/action.php (revision 63314d65712f1adc68da8cdacf392664edfd7023)
1<?php
2
3/**
4 * ToDo Action Plugin: Inserts button for ToDo plugin into toolbar
5 *
6 * Original Example: http://www.dokuwiki.org/devel:action_plugins
7 * @author     Babbage <babbage@digitalbrink.com>
8 */
9
10if (!defined('DOKU_INC')) die();
11if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
12require_once (DOKU_PLUGIN . 'action.php');
13
14class action_plugin_todo extends DokuWiki_Action_Plugin {
15
16	/**
17	 * Return some info
18	 */
19	function getInfo() {
20		return array (
21			'author' => 'Babbage',
22			'email' => 'babbage@digitalbrink.com',
23			'date' => '2010-02-27',
24			'name' => 'ToDo Action Plugin',
25			'desc' => 'Inserts a ToDo button into the editor toolbar',
26			'url' => 'http://www.dokuwiki.org/plugin:todo',
27
28		);
29	}
30
31	/**
32	 * Register the eventhandlers
33	 */
34	function register(&$controller) {
35		$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ());
36	}
37
38	/**
39	 * Inserts the toolbar button
40	 */
41	function insert_button(&$event, $param) {
42		$event->data[] = array(
43			'type'   => 'format',
44			'title'  => $this->getLang('qb_todobutton'),
45			'icon'   => '../../plugins/todo/todo.png',
46			'key'    => 't',
47			'open'   => '<todo>',
48			'close'  => '</todo>',
49		);
50	}
51
52}
53