Настройка Tinymce Hesk
Все настройки хранятся в файле /inc/tiny_mce/tinymce.inc.php
<?php
/**
*
* This file is part of HESK - PHP Help Desk Software.
*
* (c) Copyright Klemen Stirn. All rights reserved.
* https://www.hesk.com
*
* For the full copyright and license agreement information visit
* https://www.hesk.com/eula.php
*
*/
/* Check if this is a valid include */
if (!defined("IN_SCRIPT")) {
die("Invalid attempt");
}
function hesk_tinymce_init($selector = "#message")
{
global $hesklang; ?>
<script>
tinymce.init({
selector: '<?php echo $selector; ?>',
convert_urls: false,
branding: false,
browser_spellcheck: true,
contextmenu: 'link useBrowserSpellcheck image table',
setup: function(editor) {
editor.ui.registry.addMenuItem('useBrowserSpellcheck', {
text: '<?php echo hesk_slashJS($hesklang["tmce1"]); ?>',
onAction: function() {
editor.notificationManager.open({
text: '<?php echo hesk_slashJS($hesklang["tmce2"]); ?>',
type: 'info',
timeout: 5000,
closeButton: true
});
}
});
editor.ui.registry.addContextMenu('useBrowserSpellcheck', {
update: function(node) {
return editor.selection.isCollapsed() ? ['useBrowserSpellcheck'] : [];
}
});
},
toolbar1: 'undo redo | styleselect fontselect fontsizeselect | bold italic underline | alignleft aligncenter alignright alignjustify | forecolor backcolor | bullist numlist outdent indent', // Первый toolbar
toolbar2: 'link unlink image | responsivefilemanager | codesample code removeformat fullscreen', // Второй toolbar
image_advtab: true , // вкладка дополнительно, при вставке файла / изображения
plugins: 'charmap code codesample image link lists table autolink fullscreen contentcss paste responsivefilemanager',
height: 350,
language: 'ru', // указывает название файла локализации без расширения
toolbar_mode: 'sliding',
paste_as_text: true, // вставка очищает формат текста
mobile: {
toolbar_mode: 'scrolling',
height: 300
},
content_css: '/inc/tlm_mod/css/misc.css', // до стили внутри text area
external_filemanager_path: "/filemanager/",
filemanager_title: "Файловый менеджер",
external_plugins: {
"filemanager": "/filemanager/plugin.min.js"
}
});
</script>
<?php
} // END hesk_tinymce_init()