1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
editor.php
См. документацию.
1<?php
8namespace Bitrix\Fileman\Block;
9
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;
16
17Loc::loadMessages(__FILE__);
18
19class Editor
20{
21 CONST SLICE_SECTION_ID = 'BX_BLOCK_EDITOR_EDITABLE_SECTION';
22 CONST BLOCK_PLACE_ATTR = 'data-bx-block-editor-place';
23 CONST BLOCK_PHP_ATTR = 'data-bx-editor-php-slice';
24 CONST STYLIST_TAG_ATTR = 'data-bx-stylist-container';
27
28 public $id;
29 protected $site;
30 protected $url;
31 protected $previewUrl;
32 protected $saveFileUrl;
33 protected $templateType;
34 protected $templateId;
35 protected $charset;
36 protected $isTemplateMode;
39 protected $ownResultId;
40
41 /*
42 * block list
43 */
44 public $tools = array();
45
46 /*
47 * block list
48 */
49 public $blocks = array();
50
51 protected $componentFilter = array();
52
54
55 public $previewModes = array();
56
57 public $tabs = array();
58
60 'main' => <<<HTML
61 #TEXTAREA#
62 <div id="bx-block-editor-container-#id#" class="bx-block-editor-container">
63 <div class="button-panel">
64 #tabs#
65
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>
69 </div>
70 #panels#
71 </div>
72HTML
73 ,
74 'block' => <<<HTML
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"
78 title="#desc#"
79 >
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>
82 </li>
83HTML
84 ,
85 'block_page' => <<<HTML
86 <ul class="bx-block-editor-i-block-list">
87 #blocks#
88 </ul>
89HTML
90 ,
91 'tool' => <<<HTML
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>
95 </div>
96HTML
97 ,
98 'device' => <<<HTML
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>
101 </div>
102HTML
103 ,
104 'tab' => <<<HTML
105 <span class="bx-editor-block-btn bx-editor-block-btn-#code# #tab_active#">#name#</span>
106HTML
107 ,
108 'tab_active' => 'bx-editor-block-btn-active'
109 ,
110 'panel' => <<<HTML
111 <div class="bx-editor-block-panel #code#-panel" #panel_hidden#>#html#</div>
112HTML
113 ,
114 'panel_hidden' => 'style="display: none;"'
115 ,
116 'panel-edit' => <<<HTML
117 <div class="visual-part">
118 <div class="shadow">
119 <div class="edit-text"></div>
120 </div>
121 <iframe id="bx-block-editor-iframe-#id#" src="" style="border: none;" width="100%" height="100%"></iframe>
122 </div>
123 <div class="dialog-part">
124 <div style="overflow-x: hidden;">
125 <div class="block-list-cont">
126 <div class="block-list-tabs">
127
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>
132 </span>
133 </div>
134
135 <div class="edit-panel-tabs-style">
136 <ul class="bx-block-editor-i-place-list" data-bx-place-name="item"></ul>
137 </div>
138 <div style="clear: both;"></div>
139
140 <div class="edit-panel-tabs-block">
141
142 <div>#blocks#</div>
143
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>
148 </div>
149
150 </div>
151
152
153 <div style="clear: both;"></div>
154 </div>
155 <div>
156
157 </div>
158 </div>
159 </div>
160 </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>
166 </div>
167
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>
173 </div>
174 </div>
175 </div>
176
177 <div class="block-edit-form-empty">
178 #MESS_TOOL_EMPTY#
179 </div>
180
181 <div class="block-edit-form">
182 #tools#
183 </div>
184 </div>
185HTML
186 ,
187 'panel-preview' => <<<HTML
188 <div class="bx-block-editor-preview-container">
189 <div class="shadow">
190 <div class="edit-text"></div>
191 <div class="error-text">#MESS_ACCESS_DENIED#</div>
192 </div>
193 <div class="devices">
194 #devices#
195 </div>
196
197 <center>
198 <div class="iframe-wrapper">
199 <iframe sandbox="allow-same-origin allow-forms" class="preview-iframe" src=""></iframe>
200 </div>
201 </center>
202 </div>
203
204 <div style="clear:both;"></div>
205HTML
206 ,
207 'panel-get-html' => <<<HTML
208 <textarea style="width: 100%; height: 100%; min-height: 400px;" onfocus="this.select()"></textarea>
209HTML
210 );
211
218 public static function createInstance($params)
219 {
220 return new static($params);
221 }
222
228 public function __construct($params)
229 {
230 $this->id = $params['id'];
231 $this->url = $params['url'];
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'];
236 $this->site = $params['site'];
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;
242
243 $this->componentFilter = isset($params['componentFilter']) ? $params['componentFilter'] : array();
244 $this->setToolList($this->getDefaultToolList());
245
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),
250 );
251
252 $this->tabs = array(
253 'edit' => array('NAME' => Loc::getMessage('BLOCK_EDITOR_TABS_EDIT'), 'ACTIVE' => true),
254 'preview' => array('NAME' => Loc::getMessage('BLOCK_EDITOR_TABS_PREVIEW'), 'ACTIVE' => false),
255 //'get-html' => array('NAME' => Loc::getMessage('BLOCK_EDITOR_TABS_HTML'), 'ACTIVE' => false),
256 );
257 }
258
259
266 public function setBlockList(array $blocks)
267 {
268 $this->blocks = $blocks;
269
270 if(!is_array($this->blocks))
271 {
272 $this->blocks = array();
273 }
274
275 foreach($this->blocks as $key => $block)
276 {
277 if(!isset($block['TYPE']))
278 {
279 $block['TYPE'] = $block['CODE'];
280 }
281
282 $block['IS_COMPONENT'] = false;
283 $block['CLASS'] = $block['CODE'];
284 $this->blocks[$key] = $block;
285 }
286
287 $componentsNotAsBlocks = array();
288 if (!$this->useLightTextEditor)
289 {
290 $componentList = $this->getComponentList();
291 foreach($componentList as $component)
292 {
293 if(!isset($this->componentsAsBlocks[$component['NAME']]))
294 {
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'],
301 'HTML' => ''
302 );
303 }
304 else
305 {
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'],
313 'HTML' => ''
314 );
315 }
316 }
317 }
318 $this->blocks = array_merge($this->blocks, $componentsNotAsBlocks);
319
320 }
321
328 public function setToolList(array $tools)
329 {
330 $this->tools = $tools;
331 }
332
338 public function getDefaultBlockList()
339 {
340 return array(
341 array(
342 'CODE' => 'text',
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')
346 ),
347 );
348 }
349
355 public static function isAvailableRussian()
356 {
357 if (!Loader::includeModule('bitrix24'))
358 {
359 return true;
360 }
361
362 return in_array(\CBitrix24::getPortalZone(), array('ru', 'kz', 'by'));
363 }
364
365 public static function isNotAvailableInRussian(): bool
366 {
367 $portalZone = Application::getInstance()->getLicense()->getRegion();
368
369 if ($portalZone === 'ru' || !$portalZone)
370 {
371 return false;
372 }
373
374 return true;
375 }
376
382 public function getDefaultToolList()
383 {
386
387
388 $resultList = array();
389
390 $resultList[] = array(
391 'GROUP' => 'cont',
392 'ID' => 'html-raw',
393 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_HTML_RAW'),
394 'HTML' => '<textarea style="width:600px; height: 400px;" data-bx-editor-tool-input="item"></textarea>',
395 );
396
397 $resultList[] = array(
398 'GROUP' => 'cont',
399 'ID' => 'src',
400 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_SRC'),
401 'HTML' => '<input type="hidden" data-bx-editor-tool-input="item" value="">'
402 . \Bitrix\Main\UI\FileInput::createInstance((array(
403 "id" => "BX_BLOCK_EDITOR_SRC_" . $this->id,
404 "name" => "NEW_FILE_EDITOR[n#IND#]",
405 "upload" => true,
406 "medialib" => true,
407 "fileDialog" => true,
408 "cloud" => true
409 )))->show()
410 );
411
412 $resultList[] = array(
413 'GROUP' => 'cont',
414 'ID' => 'title',
415 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_TITLE'),
416 'HTML' => Tools::getControlInput(),
417 );
418
419 $resultList[] = array(
420 'GROUP' => 'cont',
421 'ID' => 'href',
422 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_HREF'),
423 'HTML' => Tools::getControlInput(),
424 );
425
427 ob_start();
428 ?>
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?>
434 </span>
435 <?endfor;?>
436 </div>
437 <?
439 {
440 echo '<div style="color: #bfbfbf; font-size: 17px; padding: 0 0; position: relative;">';
441
442 $editor = new \CHTMLEditor;
443 $res = array_merge(
444 array(
445 'height' => 400,
446 'minBodyWidth' => 350,
447 'normalBodyWidth' => 555,
448 'bAllowPhp' => false,
449 'limitPhpAccess' => false,
450 'showTaskbars' => false,
451 'showNodeNavi' => false,
452 'askBeforeUnloadPage' => true,
453 'useFileDialogs' => !IsModuleInstalled('intranet'),
454 'bbCode' => false,
455 'siteId' => SITE_ID,
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),
470 //array('separator' => true, 'compact' => false, 'sort' => 145),
471 array('id' => 'OrderedList', 'compact' => true, 'sort' => 150),
472 array('id' => 'UnorderedList', 'compact' => true, 'sort' => 160),
473 array('id' => 'AlignList', 'compact' => false, 'sort' => 190),
474 //array('separator' => true, 'compact' => false, 'sort' => 200),
475 array('id' => 'InsertLink', 'compact' => true, 'sort' => 210),
476 //array('id' => 'InsertImage', 'compact' => false, 'sort' => 220),
477 //array('id' => 'InsertVideo', 'compact' => true, 'sort' => 230, 'wrap' => 'bx-b-video-'.$arParams["FORM_ID"]),
478 //array('id' => 'InsertTable', 'compact' => false, 'sort' => 250),
479 //array('id' => 'Code', 'compact' => true, 'sort' => 260),
480 //array('id' => 'Quote', 'compact' => true, 'sort' => 270, 'wrap' => 'bx-b-quote-'.$arParams["FORM_ID"]),
481 //array('id' => 'Smile', 'compact' => false, 'sort' => 280),
482 //array('separator' => true, 'compact' => false, 'sort' => 290),
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)
487 ),
488 'isCopilotEnabled' => false,
489 ),
490 array(
491 'name' => 'BX_BLOCK_EDITOR_CONTENT_' . $this->id,
492 'id' => 'BX_BLOCK_EDITOR_CONTENT_' . $this->id,
493 'width' => '100%',
494 'arSmilesSet' => array(),
495 'arSmiles' => array(),
496 'content' => '',
497 'fontSize' => '14px',
498 'iframeCss' =>
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;}',
500 )
501 );
502 $editor->Show($res);
503
504 echo '</div>';
505 }
506 else
507 {
509 'BX_BLOCK_EDITOR_CONTENT_' . $this->id,
510 '',
511 false,
512 "html",
513 array(
514 'height' => '200',
515 'width' => '100%'
516 ),
517 "N",
518 0,
519 "",
520 '',//'data-bx-editor-tool-input="content"',
521 false,
523 false,
524 array(
525 //'templateID' => $str_SITE_TEMPLATE_ID,
526 'componentFilter' => $this->componentFilter,
527 'limit_php_access' => !$isUserHavePhpAccess,
528 'hideTypeSelector' => true,
529 'minBodyWidth' => '420',
530 'normalBodyWidth' => '420',
531 )
532 );
533 }
534
535 $resultList[] = array(
536 'GROUP' => 'cont',
537 'ID' => 'content',
538 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_CONTENT'),
539 'HTML' => '<input type="hidden" data-bx-editor-tool-input="item" value="">' . ob_get_clean()
540 );
541
542 ob_start();
543 ?>
544 <script type="text/template" id="template-social-item">
545 <table style="background-color: #E9E9E9;">
546 <tr>
547 <td><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_ADDRESS')?></td>
548 <td>
549 <input class="href" type="text" value="#href#">
550 <select class="preset">
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>
556 <?endif;?>
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>
560 <?endif;?>
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>
564 </select>
565 </td>
566 </tr>
567 <tr>
568 <td><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_NAME')?></td>
569 <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')?>">
572 </td>
573 </tr>
574 </table>
575 <br/>
576 </script>
577 <div class="container"></div>
578 <input class="add" type="button" value="<?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_BTN_ADD')?>">
579 <?
580 $resultList[] = array(
581 'GROUP' => 'cont',
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()
585 );
586
587 $resultList[] = array(
588 'GROUP' => 'cont',
589 'ID' => 'button_caption',
590 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BUTTON_CAPTION'),
591 'HTML' => Tools::getControlInput(),
592 );
593
594 $resultList[] = array(
595 'GROUP' => 'style',
596 'ID' => 'font-size',
597 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_SIZE'),
598 'HTML' => Tools::getControlFontSize(),
599 );
600
601 $resultList[] = array(
602 'GROUP' => 'style',
603 'ID' => 'text-align',
604 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
605 'HTML' => Tools::getControlTextAlign(),
606 );
607
608 $resultList[] = array(
609 'GROUP' => 'style',
610 'ID' => 'border',
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>
618 </select>
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>
628 </select>
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>
632 ',
633 );
634
635 $resultList[] = array(
636 'GROUP' => 'style',
637 'ID' => 'background-color',
638 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BACKGROUND_COLOR'),
639 'HTML' => Tools::getControlColor(),
640 );
641
642 $resultList[] = array(
643 'GROUP' => 'style',
644 'ID' => 'border-radius',
645 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BORDER_RADIUS'),
647 );
648
649 $resultList[] = array(
650 'GROUP' => 'style',
651 'ID' => 'color',
652 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
653 'HTML' => Tools::getControlColor(),
654 );
655
656 $resultList[] = array(
657 'GROUP' => 'style',
658 'ID' => 'font-family',
659 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_FAMILY'),
660 'HTML' => Tools::getControlFontFamily(),
661 );
662
663 $resultList[] = array(
664 'GROUP' => 'prop',
665 'ID' => 'align',
666 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_ALIGN'),
667 'HTML' => Tools::getControlTextAlign(),
668 );
669
670 $resultList[] = array(
671 'GROUP' => 'style',
672 'ID' => 'text-decoration',
673 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_DECORATION'),
675 );
676
677 $resultList[] = array(
678 'GROUP' => 'prop',
679 'ID' => 'align',
680 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_ALIGN'),
681 'HTML' => Tools::getControlTextAlign(),
682 );
683
684 $resultList[] = array(
685 'GROUP' => 'prop',
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')
691 ), false)
692 );
693
694 $resultList[] = array(
695 'GROUP' => 'prop',
696 'ID' => 'imagetextpart',
697 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_IMAGETEXTPART'),
698 'HTML' => Tools::getControlSelect(
699 array(
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')
704 ),
705 false)
706 );
707
708 $resultList[] = array(
709 'GROUP' => 'prop',
710 'ID' => 'height',
711 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_HEIGHT'),
712 'HTML' => Tools::getControlInput(),
713 );
714
715 $resultList[] = array(
716 'GROUP' => 'prop',
717 'ID' => 'margin-top',
718 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_TOP'),
720 );
721
722 $resultList[] = array(
723 'GROUP' => 'prop',
724 'ID' => 'margin-bottom',
725 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_BOTTOM'),
727 );
728
729 $resultList[] = array(
730 'GROUP' => 'prop',
731 'ID' => 'groupimage-view',
732 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW'),
733 'HTML' => Tools::getControlSelect(
734 array(
735 '' => Loc::getMessage('BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW_2COL'),
736 '1' => Loc::getMessage('BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW_1COL')
737 ),
738 false
739 ),
740 );
741
742 $resultList[] = array(
743 'GROUP' => 'prop',
744 'ID' => 'column-count',
745 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_COLUMN_COUNT'),
746 'HTML' => Tools::getControlSelect(array('1' => '1', '2' => '2', '3' => '3'), false),
747 );
748
749 $resultList[] = array(
750 'GROUP' => 'prop',
751 'ID' => 'paddings',
752 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_PADDINGS'),
753 'HTML' => Tools::getControlSelect(
754 array(
755 'Y' => Loc::getMessage('BLOCK_EDITOR_TOOL_PADDINGS_STANDARD'),
756 'N' => Loc::getMessage('BLOCK_EDITOR_TOOL_PADDINGS_WITHOUT')
757 ),
758 false
759 ),
760 );
761
762 $resultList[] = array(
763 'GROUP' => 'prop',
764 'ID' => 'wide',
765 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_WIDE'),
766 'HTML' => Tools::getControlSelect(
767 array(
768 'N' => Loc::getMessage('BLOCK_EDITOR_TOOL_WIDE_N'),
769 'Y' => Loc::getMessage('BLOCK_EDITOR_TOOL_WIDE_Y')
770 )
771 , false
772 ),
773 );
774
775 $resultList[] = array(
776 'GROUP' => 'style',
777 'ID' => 'bx-stylist-bgcolor',
778 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BACKGROUND_COLOR'),
779 'HTML' => Tools::getControlColor(),
780 );
781
782 $resultList[] = array(
783 'GROUP' => 'style',
784 'ID' => 'bx-stylist-padding-top',
785 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_TOP'),
787 );
788
789 $resultList[] = array(
790 'GROUP' => 'style',
791 'ID' => 'bx-stylist-padding-bottom',
792 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_BOTTOM'),
794 );
795
796 $resultList[] = array(
797 'GROUP' => 'style',
798 'ID' => 'bx-stylist-text-color',
799 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
800 'HTML' => Tools::getControlColor(),
801 );
802
803 $resultList[] = array(
804 'GROUP' => 'style',
805 'ID' => 'bx-stylist-text-font-family',
806 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_FAMILY'),
807 'HTML' => Tools::getControlFontFamily(),
808 );
809
810 $resultList[] = array(
811 'GROUP' => 'style',
812 'ID' => 'bx-stylist-text-font-size',
813 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_SIZE'),
814 'HTML' => Tools::getControlFontSize(),
815 );
816
817 $resultList[] = array(
818 'GROUP' => 'style',
819 'ID' => 'bx-stylist-text-font-weight',
820 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
821 'HTML' => Tools::getControlFontWeight(),
822 );
823
824 $resultList[] = array(
825 'GROUP' => 'style',
826 'ID' => 'bx-stylist-text-line-height',
827 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_LINE_HEIGHT'),
828 'HTML' => Tools::getControlLineHeight(),
829 );
830
831 $resultList[] = array(
832 'GROUP' => 'style',
833 'ID' => 'bx-stylist-text-text-align',
834 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
835 'HTML' => Tools::getControlTextAlign(),
836 );
837
838 $resultList[] = array(
839 'GROUP' => 'style',
840 'ID' => 'bx-stylist-a-color',
841 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_LINK') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
842 'HTML' => Tools::getControlColor(),
843 );
844
845 $resultList[] = array(
846 'GROUP' => 'style',
847 'ID' => 'bx-stylist-a-font-weight',
848 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_LINK') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
849 'HTML' => Tools::getControlFontWeight(),
850 );
851
852 $resultList[] = array(
853 'GROUP' => 'style',
854 'ID' => 'bx-stylist-a-text-decoration',
855 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_LINK') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_DECORATION'),
857 );
858
859 for($i = 1; $i <= 4; $i++)
860 {
861 $resultList[] = array(
862 'GROUP' => 'style',
863 'ID' => 'bx-stylist-h' . $i . '-color',
864 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
865 'HTML' => Tools::getControlColor(),
866 );
867
868 $resultList[] = array(
869 'GROUP' => 'style',
870 'ID' => 'bx-stylist-h' . $i . '-font-size',
871 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_SIZE'),
872 'HTML' => Tools::getControlFontSize(),
873 );
874
875 $resultList[] = array(
876 'GROUP' => 'style',
877 'ID' => 'bx-stylist-h' . $i . '-font-weight',
878 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
879 'HTML' => Tools::getControlFontWeight(),
880 );
881
882 $resultList[] = array(
883 'GROUP' => 'style',
884 'ID' => 'bx-stylist-h' . $i . '-line-height',
885 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_LINE_HEIGHT'),
886 'HTML' => Tools::getControlLineHeight(),
887 );
888
889 $resultList[] = array(
890 'GROUP' => 'style',
891 'ID' => 'bx-stylist-h' . $i . '-text-align',
892 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
893 'HTML' => Tools::getControlTextAlign(),
894 );
895 }
896
897 return $resultList;
898 }
899
907 public function getUI($id, array $values)
908 {
909 if(!array_key_exists($id, $this->uiPatterns) || trim($this->uiPatterns[$id]) == '')
910 {
911 return '';
912 }
913
914 $placeholders = array_keys($values);
915 $placeholders = '#' . implode('#,#', $placeholders) . '#';
916 $placeholders = explode(',', $placeholders);
917
918 return str_replace($placeholders, array_values($values), $this->uiPatterns[$id]);
919 }
920
926 public function showEditor()
927 {
928 $textArea = '';
929 $panels = '';
930 $tabs = '';
931 $blocks = '';
932 $tools = '';
933 $devices = '';
934
935
936 foreach(array_chunk($this->blocks, static::BLOCK_COUNT_PER_PAGE) as $blocksPerPage)
937 {
938 $blocksForPage = '';
939 foreach($blocksPerPage as $block)
940 {
941 $blocksForPage .= $this->getUI('block', array(
942 'type_class' => htmlspecialcharsbx($block['IS_COMPONENT'] ? 'component' : 'blockcomponent'),
943 'code_class' => htmlspecialcharsbx(str_replace(array(':', '.'), array('-', '-'), $block['CODE'])),
944 'type' => htmlspecialcharsbx($block['TYPE']),
945 'code' => htmlspecialcharsbx($block['CODE']),
946 'name' => htmlspecialcharsbx($block['NAME']),
947 'desc' => htmlspecialcharsbx($block['DESC']),
948 ));
949 }
950
951 $blocks .= $this->getUI('block_page', array('blocks' => $blocksForPage));
952 }
953
954 foreach($this->tools as $tool)
955 {
956 $tools .= $this->getUI('tool', array(
957 'group' => htmlspecialcharsbx($tool['GROUP']),
958 'id' => htmlspecialcharsbx($tool['ID']),
959 'name' => htmlspecialcharsbx($tool['NAME']),
960 'html' => $tool['HTML'],
961 ));
962 }
963
964 foreach($this->previewModes as $mode)
965 {
966 $devices .= $this->getUI('device', array(
967 'MESS_NAME' => mb_strtoupper(htmlspecialcharsbx($mode['NAME'])),
968 'class' => htmlspecialcharsbx($mode['CLASS']),
969 'width' => htmlspecialcharsbx($mode['WIDTH']),
970 'height' => htmlspecialcharsbx($mode['HEIGHT']),
971 ));
972 }
973
974
975 if(!$this->ownResultId)
976 {
977 $this->ownResultId = 'bx-block-editor-result-' . htmlspecialcharsbx($this->id);
978 $textArea = '<textarea name="' . htmlspecialcharsbx($this->id) . '" id="' . htmlspecialcharsbx($this->ownResultId)
979 .'" style="width:800px;height:900px; display: none;"></textarea>';
980 }
981
982 foreach($this->tabs as $tabCode => $tab)
983 {
984 if(!isset($this->uiPatterns['panel-' . $tabCode]))
985 {
986 continue;
987 }
988
989 $tabs .= $this->getUI('tab', array(
990 'code' => htmlspecialcharsbx($tabCode),
991 'name' => htmlspecialcharsbx($tab['NAME']),
992 'tab_active' => ($tab['ACTIVE'] ? $this->getUI('tab_active', array()) : '')
993 ));
994
995 $panel = $this->getUI('panel-' . $tabCode, array(
996 'id' => htmlspecialcharsbx($this->id),
997 'blocks' => $blocks,
998 'tools' => $tools,
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'),
1012 ));
1013
1014 $panels .= $this->getUI('panel', array(
1015 'code' => htmlspecialcharsbx($tabCode),
1016 'panel_hidden' => (!$tab['ACTIVE'] ? $this->getUI('panel_hidden', array()) : ''),
1017 'html' => $panel
1018 ));
1019 }
1020
1021 return $this->getUI('main', array(
1022 'TEXTAREA' => $textArea,
1023 'id' => htmlspecialcharsbx($this->id),
1024 'tabs' => $tabs,
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'),
1029 ));
1030 }
1031
1037 public function show()
1038 {
1039 \CJSCore::RegisterExt('block_editor', array(
1040 'js' => array(
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',
1045 ),
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',
1049 ));
1050 \CJSCore::Init(array("block_editor", "color_picker", "clipboard"));
1051
1052 static $isBlockEditorManagerInited = false;
1053 $editorBlockTypeListByCode = array();
1054 if(!$isBlockEditorManagerInited)
1055 {
1056 foreach($this->blocks as $block)
1057 {
1058 $editorBlockTypeListByCode[$block['CODE']] = $block;
1059 }
1060 }
1061
1062 $jsCreateParams = array(
1063 'id' => $this->id,
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
1072 );
1073
1074
1075 $result = '';
1076 if(!$isBlockEditorManagerInited)
1077 {
1078 $result .= 'BX.BlockEditorManager.setBlockList(' . \CUtil::PhpToJSObject($editorBlockTypeListByCode) . ");\n";
1079 }
1080
1081 $result .= "var blockEditorParams = " . \CUtil::PhpToJSObject($jsCreateParams) . ";\n";
1082 $result .= "blockEditorParams['context'] = BX('bx-block-editor-container-" . htmlspecialcharsbx($this->id) . "');\n";
1083 $result .= "blockEditorParams['iframe'] = BX('bx-block-editor-iframe-" . htmlspecialcharsbx($this->id) . "');\n";
1084 $result .= "blockEditorParams['resultNode'] = BX('" . htmlspecialcharsbx($this->ownResultId) . "');\n";
1085 $result .= "BX.BlockEditorManager.create(blockEditorParams);\n";
1086
1087 $result = "\n" . '<script>BX.ready(function(){' . "\n" . $result . '})</script>' . "\n";
1088 $result = $this->showEditor() . $result;
1089
1090
1091 $isBlockEditorManagerInited = true;
1092
1093 return $result;
1094 }
1095
1103 public static function getHtmlForEditor($html, $charset = null)
1104 {
1105 $phpList = \PHPParser::ParseFile($html);
1106 foreach($phpList as $php)
1107 {
1108 $phpFormatted = htmlspecialcharsbx(str_replace(["\r", "\n"], "", $php[2]));
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);
1112 }
1113
1114 if(!$charset)
1115 {
1116 $charset = Application::getInstance()->getContext()->getCulture()->getCharset();
1117 $charset = 'UTF-8';
1118 }
1119
1120 $charsetPlaceholder = '#CHARSET#';
1121 $html = static::replaceCharset($html, $charsetPlaceholder);
1122 $html = str_replace($charsetPlaceholder, HtmlFilter::encode($charset), $html);
1123 $html = Sanitizer::clean($html);
1124
1125 return $html;
1126 }
1127
1136 public static function replaceCharset($html, $charset = '#CHARSET#', $add = false)
1137 {
1138 $html = preg_replace(
1139 '/(<meta .*?charset=["\']+?)([^"\']+?)(["\']+?.*?>)/i',
1140 '$1' . $charset . '$3',
1141 $html
1142 );
1143
1144 $html = preg_replace(
1145 '/(<meta .*?content=["\']+?[^;]+?;[ ]*?charset=)([^"\']*?)(["\']+?.*?>)/i',
1146 '$1' . $charset . '$3', $html, 1, $replaceCount
1147 );
1148 if($replaceCount === 0 && $add)
1149 {
1150 $html = preg_replace(
1151 '/(<head.*?>)/i',
1152 '$1<meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '">',
1153 $html
1154 );
1155 }
1156
1157 return $html;
1158 }
1159
1171 public static function fillTemplateBySliceContent($template, $string, $encoding = null)
1172 {
1173 return Content\Engine::fillHtmlTemplate($template, $string, $encoding);
1174 }
1175
1186 public static function fillDocumentBySliceContent(Document $document, $string, $encoding = null)
1187 {
1188 return Content\Engine::create($document)->setEncoding($encoding)->setContent($string)->fill();
1189 }
1190
1197 public static function isContentSupported($content)
1198 {
1199 if(!$content || mb_strpos($content, Content\Engine::BLOCK_PLACE_ATTR) === false)
1200 {
1201 return false;
1202 }
1203 else
1204 {
1205 return true;
1206 }
1207 }
1208
1215 public static function isHtmlDocument($content)
1216 {
1217 $result = true;
1218 $content = mb_strtoupper($content);
1219 if(mb_strpos($content, '<HTML') === false)
1220 {
1221 $result = false;
1222 }
1223 if(mb_strpos($content, '</HTML') === false)
1224 {
1225 $result = false;
1226 }
1227 if(mb_strpos($content, '<BODY') === false)
1228 {
1229 $result = false;
1230 }
1231
1232 return $result;
1233 }
1234
1242 {
1243 $this->componentFilter = $componentFilter;
1244 }
1245
1246 protected function getComponentList()
1247 {
1248 return static::getComponentListPlain(static::getComponentTree());
1249 }
1250
1251 protected function getComponentTree()
1252 {
1253 $util = new \CComponentUtil;
1254
1255 return $util->GetComponentsTree(false, false, $this->componentFilter);
1256 }
1257
1258 protected function getComponentListPlain($list)
1259 {
1260 $result = array();
1261 $path = null;
1262
1263 if(!is_array($list))
1264 {
1265 return $result;
1266 }
1267
1268 if(isset($list['@']))
1269 {
1270 $path = $list['@'];
1271 }
1272
1273 if(isset($list['*']))
1274 {
1275 $componentList = array();
1276 foreach($list['*'] as $componentName => $componentData)
1277 {
1278 $componentData['TREE_PATH'] = array($path);
1279 $componentList[$componentName] = $componentData;
1280 }
1281 return $componentList;
1282 }
1283
1284 if(isset($list['#']))
1285 {
1286 foreach($list['#'] as $key => $item)
1287 {
1288 $resultItem = static::getComponentListPlain($item);
1289 if(is_array($resultItem) && is_array($path))
1290 {
1291 foreach($resultItem as $componentName => $componentData)
1292 {
1293 if(!isset($componentData['TREE_PATH']))
1294 {
1295 $componentData['TREE_PATH'] = array();
1296 }
1297 $resultItem[$componentName]['TREE_PATH'] = array_merge(array($path), $componentData['TREE_PATH']);
1298 }
1299 }
1300
1301 $result = array_merge($result, $resultItem);
1302 }
1303 }
1304
1305 return $result;
1306 }
1307
1308}
$path
Определения access_edit.php:21
return select
Определения access_edit.php:440
static create(Document $document=null)
Определения engine.php:63
static fillHtmlTemplate($htmlTemplate, $content, $encoding=null)
Определения engine.php:156
getDefaultBlockList()
Определения editor.php:338
$isUserHavePhpAccess
Определения editor.php:37
showEditor()
Определения editor.php:926
setComponentFilter(array $componentFilter=null)
Определения editor.php:1241
setBlockList(array $blocks)
Определения editor.php:266
$templateType
Определения editor.php:33
$componentFilter
Определения editor.php:51
static isContentSupported($content)
Определения editor.php:1197
CONST SLICE_SECTION_ID
Определения editor.php:21
static isHtmlDocument($content)
Определения editor.php:1215
static replaceCharset($html, $charset='#CHARSET#', $add=false)
Определения editor.php:1136
CONST BLOCK_PLACE_ATTR_DEF_VALUE
Определения editor.php:25
getComponentList()
Определения editor.php:1246
static isAvailableRussian()
Определения editor.php:355
CONST BLOCK_PLACE_ATTR
Определения editor.php:22
setToolList(array $tools)
Определения editor.php:328
CONST STYLIST_TAG_ATTR
Определения editor.php:24
__construct($params)
Определения editor.php:228
static createInstance($params)
Определения editor.php:218
$useLightTextEditor
Определения editor.php:38
$previewModes
Определения editor.php:55
getUI($id, array $values)
Определения editor.php:907
getComponentListPlain($list)
Определения editor.php:1258
CONST BLOCK_PHP_ATTR
Определения editor.php:23
$componentsAsBlocks
Определения editor.php:53
getDefaultToolList()
Определения editor.php:382
$isTemplateMode
Определения editor.php:36
static isNotAvailableInRussian()
Определения editor.php:365
getComponentTree()
Определения editor.php:1251
static getHtmlForEditor($html, $charset=null)
Определения editor.php:1103
static fillDocumentBySliceContent(Document $document, $string, $encoding=null)
Определения editor.php:1186
CONST BLOCK_COUNT_PER_PAGE
Определения editor.php:26
static fillTemplateBySliceContent($template, $string, $encoding=null)
Определения editor.php:1171
static clean($html)
Определения sanitizer.php:26
static getControlTextAlign()
Определения tools.php:103
static getControlTextDecoration()
Определения tools.php:89
static getControlColor()
Определения tools.php:47
static getControlLineHeight()
Определения tools.php:148
static getControlSelect(array $optionList, $haveDefault=true)
Определения tools.php:27
static getControlInput()
Определения tools.php:19
static getControlPaddingBottoms()
Определения tools.php:57
static getControlFontWeight()
Определения tools.php:165
static getControlBorderRadius()
Определения tools.php:74
static getControlFontSize()
Определения tools.php:186
static getControlFontFamily()
Определения tools.php:130
static includeModule($moduleName)
Определения loader.php:67
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())
Определения fileman.php:1321
static Init($arExt=array(), $bReturn=false)
Определения jscore.php:66
static RegisterExt($name, $arPaths)
Определения jscore.php:28
static ParseFile($filesrc, $limit=false)
Определения php_parser.php:651
$content
Определения commerceml.php:144
$componentName
Определения component_props2.php:49
$template
Определения file_edit.php:49
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
$portalZone
Определения .description.php:14
endif
Определения csv_new_setup.php:990
$panel
Определения options.php:177
IsModuleInstalled($module_id)
Определения tools.php:5301
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
<? endif;?> window document title
Определения prolog_main_admin.php:76
if(empty($signedUserToken)) $key
Определения quickway.php:257
$i
Определения factura.php:643
font style
Определения invoice.php:442
</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."%"
Определения waybill.php:936
endfor
Определения template.php:569
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
const SITE_ID
Определения sonet_set_content_view.php:12