• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/field.php
  • Класс: BitrixListsField
  • Вызов: Field::renderHtmlEditor
static function renderHtmlEditor($fieldId, $fieldNameForHtml, $params, $content)
{
	$html = '';
	if (Loader::includeModule('fileman'))
	{
		ob_start();
		$editor = new CHTMLEditor;
		$res = array(
			'name' => $fieldNameForHtml,
			'inputName' => $fieldNameForHtml,
			'id' => $fieldId,
			'width' => $params['width'],
			'height' => $params['height'],
			'content' => $content,
			'useFileDialogs' => false,
			'minBodyWidth' => 350,
			'normalBodyWidth' => 555,
			'bAllowPhp' => false,
			'limitPhpAccess' => false,
			'showTaskbars' => false,
			'showNodeNavi' => false,
			'beforeUnloadHandlerAllowed' => true,
			'askBeforeUnloadPage' => false,
			'bbCode' => false,
			'siteId' => SITE_ID,
			'autoResize' => true,
			'autoResizeOffset' => 40,
			'saveOnBlur' => true,
			'actionUrl' => '/bitrix/tools/html_editor_action.php',
			'setFocusAfterShow' => false,
			'controlsMap' => array(
				array('id' => 'Bold', 'compact' => true, 'sort' => 80),
				array('id' => 'Italic', 'compact' => true, 'sort' => 90),
				array('id' => 'Underline', 'compact' => true, 'sort' => 100),
				array('id' => 'Strikeout', 'compact' => true, 'sort' => 110),
				array('id' => 'RemoveFormat', 'compact' => true, 'sort' => 120),
				array('id' => 'Color', 'compact' => true, 'sort' => 130),
				array('id' => 'FontSelector', 'compact' => false, 'sort' => 135),
				array('id' => 'FontSize', 'compact' => false, 'sort' => 140),
				array('separator' => true, 'compact' => false, 'sort' => 145),
				array('id' => 'OrderedList', 'compact' => true, 'sort' => 150),
				array('id' => 'UnorderedList', 'compact' => true, 'sort' => 160),
				array('id' => 'AlignList', 'compact' => false, 'sort' => 190),
				array('separator' => true, 'compact' => false, 'sort' => 200),
				array('id' => 'InsertLink', 'compact' => true, 'sort' => 210),
				array('id' => 'InsertImage', 'compact' => false, 'sort' => 220),
				array('id' => 'InsertVideo', 'compact' => true, 'sort' => 230),
				array('id' => 'InsertTable', 'compact' => false, 'sort' => 250),
				array('separator' => true, 'compact' => false, 'sort' => 290),
				array('id' => 'Fullscreen', 'compact' => false, 'sort' => 310),
				array('id' => 'More', 'compact' => true, 'sort' => 400)
			),
		);
		$editor->show($res);
		$html = ob_get_contents();
		ob_end_clean();
	}
	return $html;
}