{**
* Инициализация редактора
*
* sEditorType - тип
* sEditorSelector - селектор textarea с редактором
*
* Настройки редакторов храняться в файле templates/framework/js/core/settings.js
*
* TODO: Исправить повторное подключение скрипта
* TODO: Локализация TinyMCE
*}
{* Дефолтный тип редактора *}
{if ! $sEditorType}
{$sEditorType = 'default'}
{/if}
{* Дефолтный селектор редактора *}
{if ! $sEditorSelector}
{$sEditorSelector = 'js-editor'}
{/if}
{* Инициализация *}
{if $oConfig->GetValue('view.wysiwyg')}
{* WYSIWYG редактор *}
{hookb run='editor_init_wysiwyg' sEditorType=$sEditorType sEditorSelector=$sEditorSelector}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.get("tinymceComment")'}
{else}
{hook run='editor_init_wysiwyg_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.get("tinymce")'}
{/if}
{/if}
{/hookb}
{else}
{* Markup редактор *}
{hookb run='editor_init_markup' sEditorType=$sEditorType sEditorSelector=$sEditorSelector}
{include file='modals/modal.upload_image.tpl'}
{if $sEditorType == 'comment'}
{$sSettings = 'ls.settings.get("markitupComment")'}
{else}
{hook run='editor_init_markup_settings' sEditorType=$sEditorType assign='sSettings'}
{if ! $sSettings}
{$sSettings = 'ls.settings.get("markitup")'}
{/if}
{/if}
{/hookb}
{/if}