aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/start.php
blob: 89c378376eca226e503eb5cf52560b74bb3cdf33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
 * TinyMCE wysiwyg editor
 *
 * @package ElggTinyMCE
 */

function tinymce_init() {
	elgg_extend_view('css/elgg', 'tinymce/css');
	elgg_extend_view('css/admin', 'tinymce/css');
	
	elgg_extend_view('input/longtext', 'tinymce/init');
	
	elgg_extend_view('embed/custom_insert_js', 'tinymce/embed_custom_insert_js');
	
	elgg_register_plugin_hook_handler('register', 'menu:longtext', 'tinymce_longtext_menu');
}

function tinymce_longtext_menu($hook, $type, $items, $vars) {
	
	$items[] = array(
		'name' => 'tinymce_toggler',
		'class' => 'tinymce-toggle-editor',
		'href' => "javascript:elgg.tinymce.toggleEditor('{$vars['id']}');",
		'text' => elgg_echo('tinymce:remove'),
	);
	
	return $items;
}

elgg_register_event_handler('init', 'system', 'tinymce_init', 9999);