8namespace Bitrix\Fileman\Block;
10use Bitrix\Main\Application;
11use Bitrix\Main\Loader;
12use Bitrix\Main\Web\DOM\Document;
13use Bitrix\Main\Localization\Loc;
14use Bitrix\Main\Web\DOM\CssParser;
15use Bitrix\Main\Text\HtmlFilter;
17Loc::loadMessages(__FILE__);
62 <div
id=
"bx-block-editor-container-#id#" class=
"bx-block-editor-container">
63 <div
class=
"button-panel">
66 <span
class=
"bx-editor-block-btn-close" title=
"#MESS_BTN_MIN#">#MESS_BTN_MIN#</span>
67 <span
class=
"bx-editor-block-btn-full" title=
"#MESS_BTN_MAX#">#MESS_BTN_MAX#</span>
68 <span data-role=
"block-editor-tab-btn-get-html" class=
"bx-editor-block-btn-full bx-editor-block-btn-html-copy" title=
"#MESS_BTN_HTML_COPY#"></span>
75 <li data-bx-block-editor-block-status=
"blank"
76 data-bx-block-editor-block-type=
"#code#"
77 class=
"bx-editor-typecode-#code_class# bx-editor-type-#type_class# bx-block-editor-i-block-list-item"
80 <span
class=
"bx-block-editor-i-block-list-item-icon"></span>
81 <span
class=
"bx-block-editor-i-block-list-item-name">#name#</span>
85 'block_page' => <<<HTML
86 <ul
class=
"bx-block-editor-i-block-list">
92 <div
class=
"bx-editor-block-tools" data-bx-editor-tool=
"#group#:#id#">
93 <div
class=
"caption">#name#:</div>
94 <div
class=
"item">#html#</div>
99 <div
class=
"device #class#" data-bx-preview-device-
class=
"#class#" data-bx-preview-device-
width=
"#width#" data-bx-preview-device-
height=
"#height#">
100 <span>#MESS_NAME#</span>
105 <span
class=
"bx-editor-block-btn bx-editor-block-btn-#code# #tab_active#">#name#</span>
108 'tab_active' =>
'bx-editor-block-btn-active'
111 <div
class=
"bx-editor-block-panel #code#-panel" #panel_hidden#>#html#</div>
114 'panel_hidden' =>
'style="display: none;"'
116 'panel-edit' => <<<HTML
117 <div
class=
"visual-part">
119 <div
class=
"edit-text"></div>
121 <iframe
id=
"bx-block-editor-iframe-#id#" src=
"" style=
"border: none;" width=
"100%" height=
"100%"></iframe>
123 <div
class=
"dialog-part">
124 <div
style=
"overflow-x: hidden;">
125 <div
class=
"block-list-cont">
126 <div
class=
"block-list-tabs">
128 <div
class=
"bx-editor-block-tabs">
129 <span
class=
"tab-list">
130 <span
class=
"tab blocks active">#MESS_BLOCKS#</span>
131 <span
class=
"tab styles">#MESS_STYLES#</span>
135 <div
class=
"edit-panel-tabs-style">
136 <ul
class=
"bx-block-editor-i-place-list" data-bx-place-name=
"item"></ul>
138 <div
style=
"clear: both;"></div>
140 <div
class=
"edit-panel-tabs-block">
144 <div
style=
"clear: both;"></div>
145 <div
class=
"block-pager adm-nav-pages-block">
146 <span
class=
"adm-nav-page adm-nav-page-prev #nav-display#"></span>
147 <span
class=
"adm-nav-page adm-nav-page-next #nav-display#"></span>
153 <div
style=
"clear: both;"></div>
161 <div
class=
"block-edit-cont">
162 <div
class=
"bx-editor-block-form-head">
163 <div
class=
"bx-editor-block-form-head-btn">
164 <a
class=
"bx-editor-block-tools-btn bx-editor-block-tools-close" title=
"#MESS_TOOL_SAVE_TITLE#">#MESS_TOOL_SAVE#</a>
165 <a
class=
"bx-editor-block-tools-btn bx-editor-block-tools-cancel" title=
"#MESS_TOOL_CANCEL_TITLE#">#MESS_TOOL_CANCEL#</a>
168 <div
class=
"block-edit-tabs">
169 <div
class=
"block-edit-tabs-inner">
170 <span data-bx-block-editor-settings-tab=
"cont" class=
"bx-editor-block-tab active">#MESS_TOOL_CONTENT#</span>
171 <span data-bx-block-editor-settings-tab=
"style" class=
"bx-editor-block-tab">#MESS_TOOL_STYLES#</span>
172 <span data-bx-block-editor-settings-tab=
"prop" class=
"bx-editor-block-tab">#MESS_TOOL_SETTINGS#</span>
177 <div
class=
"block-edit-form-empty">
181 <div
class=
"block-edit-form">
187 'panel-preview' => <<<HTML
188 <div
class=
"bx-block-editor-preview-container">
190 <div
class=
"edit-text"></div>
191 <div
class=
"error-text">#MESS_ACCESS_DENIED#</div>
193 <div
class=
"devices">
198 <div
class=
"iframe-wrapper">
199 <iframe sandbox=
"allow-same-origin allow-forms" class=
"preview-iframe" src=
""></iframe>
204 <div
style=
"clear:both;"></div>
207 'panel-get-html' => <<<HTML
208 <textarea
style=
"width: 100%; height: 100%; min-height: 400px;" onfocus=
"this.select()"></textarea>
232 $this->previewUrl = isset(
$params[
'previewUrl']) ?
$params[
'previewUrl'] :
'/bitrix/admin/fileman_block_editor.php?action=preview';
233 $this->saveFileUrl = isset(
$params[
'saveFileUrl']) ?
$params[
'saveFileUrl'] :
'/bitrix/admin/fileman_block_editor.php?action=save_file';
234 $this->templateType =
$params[
'templateType'];
235 $this->templateId =
$params[
'templateId'];
237 $this->charset =
$params[
'charset'];
238 $this->isTemplateMode = isset(
$params[
'isTemplateMode']) ? (bool)
$params[
'isTemplateMode'] :
false;
239 $this->useLightTextEditor = isset(
$params[
'useLightTextEditor']) ? (bool)
$params[
'useLightTextEditor'] :
false;
240 $this->isUserHavePhpAccess = isset(
$params[
'isUserHavePhpAccess']) ? (bool)
$params[
'isUserHavePhpAccess'] :
false;
241 $this->ownResultId = isset(
$params[
'own_result_id']) ?
$params[
'own_result_id'] :
true;
243 $this->componentFilter = isset(
$params[
'componentFilter']) ?
$params[
'componentFilter'] :
array();
246 $this->previewModes =
array(
247 array(
'CLASS' =>
'phone',
'NAME' => Loc::getMessage(
'BLOCK_EDITOR_PREVIEW_MODE_PHONE'),
'WIDTH' => 320,
'HEIGHT' => 480),
248 array(
'CLASS' =>
'tablet',
'NAME' => Loc::getMessage(
'BLOCK_EDITOR_PREVIEW_MODE_TABLET'),
'WIDTH' => 768,
'HEIGHT' => 1024),
249 array(
'CLASS' =>
'desktop',
'NAME' => Loc::getMessage(
'BLOCK_EDITOR_PREVIEW_MODE_DESKTOP'),
'WIDTH' => 1024,
'HEIGHT' => 768),
253 'edit' =>
array(
'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TABS_EDIT'),
'ACTIVE' =>
true),
254 'preview' =>
array(
'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TABS_PREVIEW'),
'ACTIVE' =>
false),
270 if(!is_array($this->blocks))
272 $this->blocks =
array();
275 foreach($this->blocks as
$key => $block)
277 if(!isset($block[
'TYPE']))
279 $block[
'TYPE'] = $block[
'CODE'];
282 $block[
'IS_COMPONENT'] =
false;
283 $block[
'CLASS'] = $block[
'CODE'];
284 $this->blocks[
$key] = $block;
287 $componentsNotAsBlocks =
array();
288 if (!$this->useLightTextEditor)
291 foreach($componentList as $component)
293 if(!isset($this->componentsAsBlocks[$component[
'NAME']]))
295 $componentsNotAsBlocks[] =
array(
296 'TYPE' =>
'component',
297 'IS_COMPONENT' =>
true,
298 'CODE' => $component[
'NAME'],
299 'NAME' => $component[
'TITLE'],
300 'DESC' => $component[
'TITLE'] .
".\n" . $component[
'DESCRIPTION'],
306 $interfaceName = $this->componentsAsBlocks[$component[
'NAME']][
'NAME'];
307 $this->blocks[] =
array(
308 'TYPE' =>
'component',
309 'IS_COMPONENT' =>
false,
310 'CODE' => $component[
'NAME'],
311 'NAME' => $interfaceName ? $interfaceName : $component[
'TITLE'],
312 'DESC' => $component[
'DESCRIPTION'],
318 $this->blocks = array_merge($this->blocks, $componentsNotAsBlocks);
343 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_BLOCK_TEXT_NAME'),
344 'DESC' => Loc::getMessage(
'BLOCK_EDITOR_BLOCK_TEXT_DESC'),
345 'HTML' => Loc::getMessage(
'BLOCK_EDITOR_BLOCK_TEXT_EXAMPLE')
357 if (!Loader::includeModule(
'bitrix24'))
362 return in_array(\CBitrix24::getPortalZone(),
array(
'ru',
'kz',
'by'));
367 $portalZone = Application::getInstance()->getLicense()->getRegion();
388 $resultList =
array();
390 $resultList[] =
array(
393 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_HTML_RAW'),
394 'HTML' =>
'<textarea style="width:600px; height: 400px;" data-bx-editor-tool-input="item"></textarea>',
397 $resultList[] =
array(
400 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_SRC'),
401 'HTML' =>
'<input type="hidden" data-bx-editor-tool-input="item" value="">'
403 "id" =>
"BX_BLOCK_EDITOR_SRC_" . $this->
id,
404 "name" =>
"NEW_FILE_EDITOR[n#IND#]",
407 "fileDialog" =>
true,
412 $resultList[] =
array(
415 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_TITLE'),
419 $resultList[] =
array(
422 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_HREF'),
429 <div
class=
"column" data-bx-editor-column=
"item">
430 <?
for ($columnNumber = 1; $columnNumber < 5; $columnNumber++):?>
431 <span data-bx-editor-column-number=
"<?=$columnNumber?>"
432 style=
"display: none;">
433 <?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_COLUMN')?> <?=$columnNumber?>
440 echo
'<div style="color: #bfbfbf; font-size: 17px; padding: 0 0; position: relative;">';
442 $editor = new \CHTMLEditor;
446 'minBodyWidth' => 350,
447 'normalBodyWidth' => 555,
448 'bAllowPhp' =>
false,
449 'limitPhpAccess' =>
false,
450 'showTaskbars' =>
false,
451 'showNodeNavi' =>
false,
452 'askBeforeUnloadPage' =>
true,
456 'autoResize' =>
false,
457 'autoResizeOffset' => 40,
458 'saveOnBlur' =>
true,
459 'controlsMap' =>
array(
460 array(
'id' =>
'placeholder_selector',
'compact' =>
true,
'sort' => 60),
461 array(
'id' =>
'StyleSelector',
'compact' =>
true,
'sort' => 70),
462 array(
'id' =>
'Bold',
'compact' =>
true,
'sort' => 80),
463 array(
'id' =>
'Italic',
'compact' =>
true,
'sort' => 90),
464 array(
'id' =>
'Underline',
'compact' =>
true,
'sort' => 100),
465 array(
'id' =>
'Strikeout',
'compact' =>
true,
'sort' => 110),
466 array(
'id' =>
'RemoveFormat',
'compact' =>
true,
'sort' => 120),
467 array(
'id' =>
'Color',
'compact' =>
true,
'sort' => 130),
468 array(
'id' =>
'FontSelector',
'compact' =>
false,
'sort' => 135),
469 array(
'id' =>
'FontSize',
'compact' =>
false,
'sort' => 140),
471 array(
'id' =>
'OrderedList',
'compact' =>
true,
'sort' => 150),
472 array(
'id' =>
'UnorderedList',
'compact' =>
true,
'sort' => 160),
473 array(
'id' =>
'AlignList',
'compact' =>
false,
'sort' => 190),
475 array(
'id' =>
'InsertLink',
'compact' =>
true,
'sort' => 210),
483 array(
'id' =>
'RemoveFormat',
'compact' =>
false,
'sort' => 310),
484 array(
'id' =>
'Fullscreen',
'compact' =>
false,
'sort' => 320),
485 array(
'id' =>
'BbCode',
'compact' =>
true,
'sort' => 340),
486 array(
'id' =>
'More',
'compact' =>
true,
'sort' => 400)
488 'isCopilotEnabled' =>
false,
491 'name' =>
'BX_BLOCK_EDITOR_CONTENT_' . $this->
id,
492 'id' =>
'BX_BLOCK_EDITOR_CONTENT_' . $this->
id,
494 'arSmilesSet' =>
array(),
495 'arSmiles' =>
array(),
497 'fontSize' =>
'14px',
499 '.bx-spoiler {border:1px solid #cecece;background-color:#f6f6f6;padding: 8px 8px 8px 24px;color:#373737;border-radius:var(--ui-border-radius-sm, 2px);min-height:1em;margin: 0;}',
509 'BX_BLOCK_EDITOR_CONTENT_' . $this->
id,
526 'componentFilter' => $this->componentFilter,
528 'hideTypeSelector' =>
true,
529 'minBodyWidth' =>
'420',
530 'normalBodyWidth' =>
'420',
535 $resultList[] =
array(
538 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_CONTENT'),
539 'HTML' =>
'<input type="hidden" data-bx-editor-tool-input="item" value="">' . ob_get_clean()
544 <script type=
"text/template" id=
"template-social-item">
545 <table
style=
"background-color: #E9E9E9;">
547 <td><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_ADDRESS')?></td>
549 <input
class=
"href" type=
"text" value=
"#href#">
551 <option value=
""><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_SELECT')?></option>
552 <option value=
"http://#SERVER_NAME#/"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_OURSITE')?></option>
553 <?
if (self::isAvailableRussian()):?>
554 <option value=
"http://vk.com/"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_VK')?></option>
555 <option value=
"http://ok.ru/"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_OK')?></option>
557 <?
if (self::isNotAvailableInRussian()):?>
558 <option value=
"http://facebook.com/"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_FACEBOOK')?></option>
559 <option value=
"http://instagram.com/"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_INSTAGRAM')?></option>
561 <option value=
"http://twitter.com/"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_TWITTER')?></option>
562 <option value=
"http://"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_SITE')?></option>
563 <option value=
"mailto:"><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_EMAIL')?></option>
568 <td><?=Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_NAME')?></td>
570 <input
class=
"name" type=
"text" value=
"#name#">
571 <input
class=
"delete" type=
"button" value=
"<?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_BTN_DELETE')?>">
577 <div
class=
"container"></div>
578 <input
class=
"add" type=
"button" value=
"<?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_BTN_ADD')?>">
580 $resultList[] =
array(
582 'ID' =>
'social_content',
583 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_SOCIAL_CONTENT'),
584 'HTML' =>
'<input type="hidden" data-bx-editor-tool-input="item" value="">' . ob_get_clean()
587 $resultList[] =
array(
589 'ID' =>
'button_caption',
590 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_BUTTON_CAPTION'),
594 $resultList[] =
array(
597 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_SIZE'),
601 $resultList[] =
array(
603 'ID' =>
'text-align',
604 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
608 $resultList[] =
array(
611 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_BORDER'),
612 'HTML' =>
'<input type="hidden" data-bx-editor-tool-input="item" id="block_editor_style_border">
613 <select id="block_editor_style_border_style">
614 <option value="">' . Loc::getMessage(
'BLOCK_EDITOR_COMMON_NO') .
'</option>
615 <option value="solid">' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_BORDER_SOLID') .
'</option>
616 <option value="dashed">' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_BORDER_DASHED') .
'</option>
617 <option value="dotted">' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_BORDER_DOTTED') .
'</option>
619 <select id="block_editor_style_border_width" style="width: 80px; min-width: 80px;">
620 <option value="">' . Loc::getMessage(
'BLOCK_EDITOR_COMMON_NO') .
'</option>
621 <option value="1px">1px</option>
622 <option value="2px">2px</option>
623 <option value="3px">3px</option>
624 <option value="4px">4px</option>
625 <option value="5px">5px</option>
626 <option value="6px">6px</option>
627 <option value="7px">7px</option>
629 <input id="block_editor_style_border_color" type="hidden" class="bx-editor-color-picker">
630 <span class="bx-editor-color-picker-view"></span>
631 <span class="bx-editor-color-picker-text">' . Loc::getMessage(
'BLOCK_EDITOR_TOOLS_COLOR') .
'</span>
635 $resultList[] =
array(
637 'ID' =>
'background-color',
638 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_BACKGROUND_COLOR'),
642 $resultList[] =
array(
644 'ID' =>
'border-radius',
645 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_BORDER_RADIUS'),
649 $resultList[] =
array(
652 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_COLOR'),
656 $resultList[] =
array(
658 'ID' =>
'font-family',
659 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_FAMILY'),
663 $resultList[] =
array(
666 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_ALIGN'),
670 $resultList[] =
array(
672 'ID' =>
'text-decoration',
673 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_TEXT_DECORATION'),
677 $resultList[] =
array(
680 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_ALIGN'),
684 $resultList[] =
array(
686 'ID' =>
'imagetextalign',
687 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_IMAGETEXTALIGN'),
689 'left' => Loc::getMessage(
'BLOCK_EDITOR_CTRL_ALIGN_LEFT'),
690 'right' => Loc::getMessage(
'BLOCK_EDITOR_CTRL_ALIGN_RIGHT')
694 $resultList[] =
array(
696 'ID' =>
'imagetextpart',
697 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_IMAGETEXTPART'),
700 '1/4' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_IMAGETEXTPART14'),
701 '1/3' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_IMAGETEXTPART13'),
702 '1/2' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_IMAGETEXTPART12'),
703 '2/3' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_IMAGETEXTPART23')
708 $resultList[] =
array(
711 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_HEIGHT'),
715 $resultList[] =
array(
717 'ID' =>
'margin-top',
718 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_MARGIN_TOP'),
722 $resultList[] =
array(
724 'ID' =>
'margin-bottom',
725 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_MARGIN_BOTTOM'),
729 $resultList[] =
array(
731 'ID' =>
'groupimage-view',
732 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW'),
735 '' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW_2COL'),
736 '1' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW_1COL')
742 $resultList[] =
array(
744 'ID' =>
'column-count',
745 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_COLUMN_COUNT'),
749 $resultList[] =
array(
752 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_PADDINGS'),
755 'Y' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_PADDINGS_STANDARD'),
756 'N' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_PADDINGS_WITHOUT')
762 $resultList[] =
array(
765 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_WIDE'),
768 'N' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_WIDE_N'),
769 'Y' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_WIDE_Y')
775 $resultList[] =
array(
777 'ID' =>
'bx-stylist-bgcolor',
778 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_BACKGROUND_COLOR'),
782 $resultList[] =
array(
784 'ID' =>
'bx-stylist-padding-top',
785 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_MARGIN_TOP'),
789 $resultList[] =
array(
791 'ID' =>
'bx-stylist-padding-bottom',
792 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_MARGIN_BOTTOM'),
796 $resultList[] =
array(
798 'ID' =>
'bx-stylist-text-color',
799 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_TEXT') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_COLOR'),
803 $resultList[] =
array(
805 'ID' =>
'bx-stylist-text-font-family',
806 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_TEXT') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_FAMILY'),
810 $resultList[] =
array(
812 'ID' =>
'bx-stylist-text-font-size',
813 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_TEXT') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_SIZE'),
817 $resultList[] =
array(
819 'ID' =>
'bx-stylist-text-font-weight',
820 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_TEXT') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
824 $resultList[] =
array(
826 'ID' =>
'bx-stylist-text-line-height',
827 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_TEXT') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_LINE_HEIGHT'),
831 $resultList[] =
array(
833 'ID' =>
'bx-stylist-text-text-align',
834 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_TEXT') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
838 $resultList[] =
array(
840 'ID' =>
'bx-stylist-a-color',
841 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_LINK') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_COLOR'),
845 $resultList[] =
array(
847 'ID' =>
'bx-stylist-a-font-weight',
848 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_LINK') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
852 $resultList[] =
array(
854 'ID' =>
'bx-stylist-a-text-decoration',
855 'NAME' => Loc::getMessage(
'BLOCK_EDITOR_TOOL_STYLIST_LINK') .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_TEXT_DECORATION'),
859 for(
$i = 1;
$i <= 4;
$i++)
861 $resultList[] =
array(
863 'ID' =>
'bx-stylist-h' .
$i .
'-color',
864 'NAME' =>
'H' .
$i .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_COLOR'),
868 $resultList[] =
array(
870 'ID' =>
'bx-stylist-h' .
$i .
'-font-size',
871 'NAME' =>
'H' .
$i .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_SIZE'),
875 $resultList[] =
array(
877 'ID' =>
'bx-stylist-h' .
$i .
'-font-weight',
878 'NAME' =>
'H' .
$i .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
882 $resultList[] =
array(
884 'ID' =>
'bx-stylist-h' .
$i .
'-line-height',
885 'NAME' =>
'H' .
$i .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_LINE_HEIGHT'),
889 $resultList[] =
array(
891 'ID' =>
'bx-stylist-h' .
$i .
'-text-align',
892 'NAME' =>
'H' .
$i .
' ' . Loc::getMessage(
'BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
909 if(!array_key_exists(
$id, $this->uiPatterns) || trim($this->uiPatterns[
$id]) ==
'')
914 $placeholders = array_keys($values);
915 $placeholders =
'#' . implode(
'#,#', $placeholders) .
'#';
916 $placeholders = explode(
',', $placeholders);
918 return str_replace($placeholders, array_values($values), $this->uiPatterns[
$id]);
936 foreach(array_chunk($this->blocks, static::BLOCK_COUNT_PER_PAGE) as $blocksPerPage)
939 foreach($blocksPerPage as $block)
941 $blocksForPage .= $this->
getUI(
'block',
array(
942 'type_class' =>
htmlspecialcharsbx($block[
'IS_COMPONENT'] ?
'component' :
'blockcomponent'),
954 foreach($this->tools as $tool)
960 'html' => $tool[
'HTML'],
964 foreach($this->previewModes as $mode)
975 if(!$this->ownResultId)
979 .
'" style="width:800px;height:900px; display: none;"></textarea>';
982 foreach($this->tabs as $tabCode => $tab)
984 if(!isset($this->uiPatterns[
'panel-' . $tabCode]))
992 'tab_active' => ($tab[
'ACTIVE'] ? $this->
getUI(
'tab_active',
array()) :
'')
999 'devices' => $devices,
1000 'nav-display' =>
count($this->blocks) <= static::BLOCK_COUNT_PER_PAGE ?
'bx-block-hide' :
'',
1001 'MESS_ACCESS_DENIED' => Loc::getMessage(
'ACCESS_DENIED'),
1002 'MESS_STYLES' => Loc::getMessage(
'BLOCK_EDITOR_UI_STYLES'),
1003 'MESS_BLOCKS' => Loc::getMessage(
'BLOCK_EDITOR_UI_BLOCKS'),
1004 'MESS_TOOL_CONTENT' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_CONTENT'),
1005 'MESS_TOOL_STYLES' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_STYLES'),
1006 'MESS_TOOL_SETTINGS' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_SETTINGS'),
1007 'MESS_TOOL_EMPTY' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_EMPTY'),
1008 'MESS_TOOL_SAVE' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_SAVE'),
1009 'MESS_TOOL_SAVE_TITLE' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_SAVE_TITLE'),
1010 'MESS_TOOL_CANCEL' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_CANCEL'),
1011 'MESS_TOOL_CANCEL_TITLE' => Loc::getMessage(
'BLOCK_EDITOR_UI_TOOL_CANCEL_TITLE'),
1016 'panel_hidden' => (!$tab[
'ACTIVE'] ? $this->
getUI(
'panel_hidden',
array()) :
''),
1022 'TEXTAREA' => $textArea,
1025 'panels' => $panels,
1026 'MESS_BTN_MAX' => Loc::getMessage(
'BLOCK_EDITOR_UI_BTN_MAX'),
1027 'MESS_BTN_MIN' => Loc::getMessage(
'BLOCK_EDITOR_UI_BTN_MIN'),
1028 'MESS_BTN_HTML_COPY' => Loc::getMessage(
'BLOCK_EDITOR_UI_BTN_HTML_COPY'),
1041 '/bitrix/js/main/core/core_dragdrop.js',
1042 '/bitrix/js/fileman/block_editor/dialog.js',
1043 '/bitrix/js/fileman/block_editor/helper.js',
1044 '/bitrix/js/fileman/block_editor/editor.js',
1046 'css' =>
'/bitrix/js/fileman/block_editor/dialog.css',
1047 'rel' => [
'ui.design-tokens',
'ui.fonts.opensans'],
1048 'lang' =>
'/bitrix/modules/fileman/lang/' . LANGUAGE_ID .
'/js_block_editor.php',
1052 static $isBlockEditorManagerInited =
false;
1053 $editorBlockTypeListByCode =
array();
1054 if(!$isBlockEditorManagerInited)
1056 foreach($this->blocks as $block)
1058 $editorBlockTypeListByCode[$block[
'CODE']] = $block;
1062 $jsCreateParams =
array(
1064 'url' => $this->url,
1065 'previewUrl' => $this->previewUrl,
1066 'saveFileUrl' => $this->saveFileUrl,
1067 'templateType' => $this->templateType,
1068 'templateId' => $this->templateId,
1069 'isTemplateMode' => $this->isTemplateMode,
1070 'site' => $this->site,
1071 'charset' => $this->charset
1076 if(!$isBlockEditorManagerInited)
1078 $result .=
'BX.BlockEditorManager.setBlockList(' . \CUtil::PhpToJSObject($editorBlockTypeListByCode) .
");\n";
1081 $result .=
"var blockEditorParams = " . \CUtil::PhpToJSObject($jsCreateParams) .
";\n";
1085 $result .=
"BX.BlockEditorManager.create(blockEditorParams);\n";
1087 $result =
"\n" .
'<script>BX.ready(function(){' .
"\n" .
$result .
'})</script>' .
"\n";
1091 $isBlockEditorManagerInited =
true;
1106 foreach($phpList as $php)
1109 $id =
'bx_block_php_' . mt_rand();
1110 $surrogate =
'<span id="' .
$id .
'" ' . self::BLOCK_PHP_ATTR .
'="' . ($phpFormatted) .
'" class="bxhtmled-surrogate" title=""></span>';
1111 $html = str_replace($php[2], $surrogate, $html);
1116 $charset = Application::getInstance()->getContext()->getCulture()->getCharset();
1120 $charsetPlaceholder =
'#CHARSET#';
1121 $html = static::replaceCharset($html, $charsetPlaceholder);
1122 $html = str_replace($charsetPlaceholder, HtmlFilter::encode(
$charset), $html);
1138 $html = preg_replace(
1139 '/(<meta .*?charset=["\']+?)([^"\']+?)(["\']+?.*?>)/i',
1144 $html = preg_replace(
1145 '/(<meta .*?content=["\']+?[^;]+?;[ ]*?charset=)([^"\']*?)(["\']+?.*?>)/i',
1146 '$1' .
$charset .
'$3', $html, 1, $replaceCount
1148 if($replaceCount === 0 && $add)
1150 $html = preg_replace(
1152 '$1<meta http-equiv="Content-Type" content="text/html; charset=' .
$charset .
'">',
1219 if(mb_strpos(
$content,
'<HTML') ===
false)
1223 if(mb_strpos(
$content,
'</HTML') ===
false)
1227 if(mb_strpos(
$content,
'<BODY') ===
false)
1248 return static::getComponentListPlain(static::getComponentTree());
1253 $util = new \CComponentUtil;
1255 return $util->GetComponentsTree(
false,
false, $this->componentFilter);
1263 if(!is_array($list))
1268 if(isset($list[
'@']))
1273 if(isset($list[
'*']))
1275 $componentList =
array();
1281 return $componentList;
1284 if(isset($list[
'#']))
1286 foreach($list[
'#'] as
$key => $item)
1288 $resultItem = static::getComponentListPlain($item);
1289 if(is_array($resultItem) && is_array(
$path))
1293 if(!isset($componentData[
'TREE_PATH']))
1295 $componentData[
'TREE_PATH'] =
array();
static create(Document $document=null)
static fillHtmlTemplate($htmlTemplate, $content, $encoding=null)
setComponentFilter(array $componentFilter=null)
setBlockList(array $blocks)
static isContentSupported($content)
static isHtmlDocument($content)
static replaceCharset($html, $charset='#CHARSET#', $add=false)
CONST BLOCK_PLACE_ATTR_DEF_VALUE
static isAvailableRussian()
setToolList(array $tools)
static createInstance($params)
getUI($id, array $values)
getComponentListPlain($list)
static isNotAvailableInRussian()
static getHtmlForEditor($html, $charset=null)
static fillDocumentBySliceContent(Document $document, $string, $encoding=null)
CONST BLOCK_COUNT_PER_PAGE
static fillTemplateBySliceContent($template, $string, $encoding=null)
static includeModule($moduleName)
static AddHTMLEditorFrame( $strTextFieldName, $strTextValue, $strTextTypeFieldName, $strTextTypeValue, $arSize=Array("height"=>350), $CONVERT_FOR_WORKFLOW="N", $WORKFLOW_DOCUMENT_ID=0, $NEW_DOCUMENT_PATH="", $textarea_field="", $site=false, $bWithoutPHP=true, $arTaskbars=false, $arAdditionalParams=Array())
static Init($arExt=array(), $bReturn=false)
static RegisterExt($name, $arPaths)
static ParseFile($filesrc, $limit=false)
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
IsModuleInstalled($module_id)
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
<? endif;?> window document title
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']