1<?php
2/**
3 * Composant Action pour HowHard (Toolbar)
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Fabrice DEJAIGHER <fabrice@chtiland.com>
7 */
8
9if (!defined('DOKU_INC'))
10{
11	die();
12}
13
14if (!defined('DOKU_PLUGIN'))
15{
16	define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
17}
18require_once(DOKU_PLUGIN . 'action.php');
19
20class action_plugin_howhard extends DokuWiki_Action_Plugin
21{
22
23
24	function register(Doku_Event_Handler $controller)
25	{
26		$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());
27	}
28
29	function handle_toolbar(&$event, $param)
30	{
31		$event->data[] = array
32		(
33			'type'  => 'picker',
34			'title' => 'HowHard',
35			'class' => 'howhard_toolbar',
36			'icon'  => '../../plugins/howhard/images/toolbar/level_select.png',
37			'list'  => array (
38				array (
39					'type'   => 'insert',
40					'title'  => $this->getLang('level1'),
41					'icon'   => '../../plugins/howhard/images/toolbar/1.png',
42					'insert' => '{{howhard>1}}',
43				),
44				array (
45					'type'   => 'insert',
46					'title'  => $this->getLang('level2'),
47					'icon'   => '../../plugins/howhard/images/toolbar/2.png',
48					'insert' => '{{howhard>2}}',
49				),
50				array (
51					'type'   => 'insert',
52					'title'  => $this->getLang('level3'),
53					'icon'   => '../../plugins/howhard/images/toolbar/3.png',
54					'insert' => '{{howhard>3}}',
55				),
56				array (
57					'type'   => 'insert',
58					'title'  => $this->getLang('level4'),
59					'icon'   => '../../plugins/howhard/images/toolbar/4.png',
60					'insert' => '{{howhard>4}}',
61				),
62				array (
63					'type'   => 'insert',
64					'title'  => $this->getLang('level5'),
65					'icon'   => '../../plugins/howhard/images/toolbar/5.png',
66					'insert' => '{{howhard>5}}',
67				)
68			)
69		);
70	}
71}
72
73