1<?php
2/**
3 * Action Component for the Ad-Hoc Wrap Plugin
4 *
5 * @license	GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author	 Andreas Gohr <andi@splitbrain.org>
7 * @author	 Sascha Leib <sascha.leib(at)kolmio.com>
8 */
9
10class action_plugin_adhocwrap extends DokuWiki_Action_Plugin {
11
12	/**
13	* register the eventhandlers
14	*
15	* @author	Andreas Gohr <andi@splitbrain.org>
16	* @author	Sascha Leib <sascha.leib(at)kolmio.com>
17	*/
18	function register(Doku_Event_Handler $controller){
19		$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'handle_toolbar', array ());
20	}
21
22	function handle_toolbar(Doku_Event $event, $param) {
23
24		/* create the menu */
25		$event->data[] = array (
26			'type'	=>	'picker',
27			'title'	=>	'Ad-Hoc Wrap',
28			'icon'	=>	'../../plugins/adhocwrap/images/wrap.svg',
29			'id'	=>	'tbbtn_adhocWrap',
30			'list'	=>	array(
31				array(
32					'type'		=> 'format',
33					'title'		=> 'Outline box (div)',
34					'icon'		=> '../../plugins/adhocwrap/images/box-outline.svg',
35					'open'		=> '<div box>',
36					'close'		=> '</div>',
37					'sample'	=> '\nOutline box\n'
38				),
39				array(
40					'type'		=> 'format',
41					'title'		=> 'Info-Block (div)',
42					'icon'		=> '../../plugins/adhocwrap/images/information-slab-box-outline.svg',
43					'open'		=> '<div info>',
44					'close'		=> '</div>',
45					'sample'	=> '\nInformation Block\n'
46				),
47				array(
48					'type'		=> 'format',
49					'title'		=> 'Tip-Block (div)',
50					'icon'		=> '../../plugins/adhocwrap/images/lightbulb-box-outline.svg',
51					'open'		=> '<div tip>',
52					'close'		=> '</div>',
53					'sample'	=> '\nTip Block\n'
54				),
55				array(
56					'type'		=> 'format',
57					'title'		=> 'Important Block (div)',
58					'icon'		=> '../../plugins/adhocwrap/images/alert-box-outline.svg',
59					'open'		=> '<div important>',
60					'close'		=> '</div>',
61					'sample'	=> '\nImportant Block\n'
62				),
63				array(
64					'type'		=> 'format',
65					'title'		=> 'Alert Block (div)',
66					'icon'		=> '../../plugins/adhocwrap/images/close-box-outline.svg',
67					'open'		=> '<div alert>',
68					'close'		=> '</div>',
69					'sample'	=> '\nAlert Block\n'
70				),
71				array(
72					'type'		=> 'format',
73					'title'		=> 'Inline block (aside)',
74					'icon'		=> '../../plugins/adhocwrap/images/aside-block.svg',
75					'open'		=> '<aside outline box>\n',
76					'close'		=> '\n</aside>',
77					'sample'	=> 'Aside block'
78				),
79				array(
80					'type'		=> 'format',
81					'title'		=> 'Illustration block, floating right, with border and outline (aside+figure)',
82					'icon'		=> '../../plugins/adhocwrap/images/float-block-right.svg',
83					'open'		=> '<aside float-right><figure outline box>\n',
84					'close'		=> '\n<figcaption centered>Figure caption here</figcaption>\n</figure></aside>',
85					'sample'	=> 'Figure content'
86				),
87				array(
88					'type'		=> 'format',
89					'title'		=> 'Illustration block, floating left, with border and outline (aside+figure)',
90					'icon'		=> '../../plugins/adhocwrap/images/float-block-left.svg',
91					'open'		=> '<aside float-left><figure outline box>\n',
92					'close'		=> '\n<figcaption centered>Figure caption here</figcaption>\n</figure></aside>',
93					'sample'	=> 'Figure content'
94				),
95				array(
96					'type'		=> 'format',
97					'title'		=> 'Layout 2 columns (div)',
98					'icon'		=> '../../plugins/adhocwrap/images/layout-2-columns.svg',
99					'open'		=> '<div grid-2-columns>\n<div>\n',
100					'close'		=> '\n</div>\n<div>\nColumn 2\n</div>\n</div>',
101					'sample'	=> 'Column 1'
102				),
103				array(
104					'type'		=> 'format',
105					'title'		=> 'Layout 3 columns (div)',
106					'icon'		=> '../../plugins/adhocwrap/images/layout-3-columns.svg',
107					'open'		=> '<div grid-3-columns>\n<div>\n',
108					'close'		=> '\n</div>\n<div>\nColumn 2\n</div>\n<div>\nColumn 3\n</div>\n</div>',
109					'sample'	=> 'Column 1'
110				),
111				array(
112					'type'		=> 'format',
113					'title'		=> 'Marker red',
114					'icon'		=> '../../plugins/adhocwrap/images/marker-red.svg',
115					'open'		=> '<mark red>',
116					'close'		=> '</mark>',
117					'sample'	=> 'Red marked text'
118				),
119				array(
120					'type'		=> 'format',
121					'title'		=> 'Marker orange',
122					'icon'		=> '../../plugins/adhocwrap/images/marker-orange.svg',
123					'open'		=> '<mark orange>',
124					'close'		=> '</mark>',
125					'sample'	=> 'Orange highlight'
126				),
127				array(
128					'type'		=> 'format',
129					'title'		=> 'Marker green',
130					'icon'		=> '../../plugins/adhocwrap/images/marker-green.svg',
131					'open'		=> '<mark green>',
132					'close'		=> '</mark>',
133					'sample'	=> 'Green marked text'
134				),
135				array(
136					'type'		=> 'format',
137					'title'		=> 'Marker cyan',
138					'icon'		=> '../../plugins/adhocwrap/images/marker-cyan.svg',
139					'open'		=> '<mark cyan>',
140					'close'		=> '</mark>',
141					'sample'	=> 'Cyan marked text'
142				),
143				array(
144					'type'		=> 'format',
145					'title'		=> 'Marker grey',
146					'icon'		=> '../../plugins/adhocwrap/images/marker-grey.svg',
147					'open'		=> '<mark grey>',
148					'close'		=> '</mark>',
149					'sample'	=> 'Grey marked text'
150				),
151				array(
152					'type'		=> 'format',
153					'title'		=> 'Maximum emphasis',
154					'icon'		=> '../../plugins/adhocwrap/images/strong-emphasis.svg',
155					'open'		=> '<strong large-text red>',
156					'close'		=> '</strong>',
157					'sample'	=> 'Emphasis'
158				),
159				array(
160					'type'		=> 'format',
161					'title'		=> 'Small grey text',
162					'icon'		=> '../../plugins/adhocwrap/images/small-text.svg',
163					'open'		=> '<small grey>',
164					'close'		=> '</small>',
165					'sample'	=> 'side content'
166				)
167
168			)
169		);
170	}
171
172}