1<?php
2/**
3 * The configuration functions for TinyMCE 4.x.
4 *
5 * Zenphoto plugin default light configuration
6 */
7/**
8 * Filter used by "file manager" plugins to attach themselves to tinyMCE.
9 *
10 * @package filters
11 * @subpackage zenpage
12 */
13$filehandler = zp_apply_filter('tinymce_zenpage_config', NULL);
14global $_zp_RTL_css;
15?>
16<script type="text/javascript" src="<?php echo WEBPATH . "/" . ZENFOLDER . "/" . PLUGIN_FOLDER; ?>/tinymce4/tinymce.min.js"></script>
17<script type="text/javascript">
18// <!-- <![CDATA[
19	tinymce.init({
20		selector: "textarea.content,textarea.desc,textarea.extracontent,textarea.texteditor",
21		language: "<?php echo $locale; ?>",
22		entity_encoding: '<?php echo getOption('tinymce4_entityencoding'); ?>',
23		<?php if(!empty(trim(getOption('tinymce4_entities')))) { ?>
24			entities: '<?php echo getOption('tinymce4_entities'); ?>',
25		<?php } ?>
26		directionality: "<?php echo $_zp_RTL_css ? 'rtl' : 'ltr'; ?>",
27		menubar: false,
28		relative_urls: false,
29		image_advtab: true,
30		content_css: "<?php echo FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER; ?>/tinymce4/config/content.css",
31<?php
32if ($filehandler) {
33	?>
34		elements : "<?php echo $filehandler; ?>",
35		file_browser_callback : <?php echo $filehandler; ?>,
36	<?php
37}
38?>
39		plugins: [
40			"advlist autolink lists link image charmap print preview anchor pagebreak",
41			"searchreplace visualblocks code fullscreen directionality",
42			"insertdatetime media table contextmenu paste textpattern imagetools tinyzenpage"
43		],
44		toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | link image tinyzenpage pagebreak | code fullscreen | ltr rtl",
45		setup: function(ed) {
46			ed.on('change', function(e) {
47				$('.dirty-check').addClass('dirty');
48			});
49		}
50	});
51// ]]> -->
52</script>
53