Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
editor.php
1<?
9
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
53 public $componentsAsBlocks = array();
54
55 public $previewModes = array();
56
57 public $tabs = array();
58
59 public $uiPatterns = array(
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
370 public function getDefaultToolList()
371 {
374
375
376 $resultList = array();
377
378 $resultList[] = array(
379 'GROUP' => 'cont',
380 'ID' => 'html-raw',
381 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_HTML_RAW'),
382 'HTML' => '<textarea style="width:600px; height: 400px;" data-bx-editor-tool-input="item"></textarea>',
383 );
384
385 $resultList[] = array(
386 'GROUP' => 'cont',
387 'ID' => 'src',
388 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_SRC'),
389 'HTML' => '<input type="hidden" data-bx-editor-tool-input="item" value="">'
390 . \Bitrix\Main\UI\FileInput::createInstance((array(
391 "id" => "BX_BLOCK_EDITOR_SRC_" . $this->id,
392 "name" => "NEW_FILE_EDITOR[n#IND#]",
393 "upload" => true,
394 "medialib" => true,
395 "fileDialog" => true,
396 "cloud" => true
397 )))->show()
398 );
399
400 $resultList[] = array(
401 'GROUP' => 'cont',
402 'ID' => 'title',
403 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_TITLE'),
404 'HTML' => Tools::getControlInput(),
405 );
406
407 $resultList[] = array(
408 'GROUP' => 'cont',
409 'ID' => 'href',
410 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_HREF'),
411 'HTML' => Tools::getControlInput(),
412 );
413
414 \Bitrix\Main\Loader::includeModule('fileman');
415 ob_start();
416 ?>
417 <div class="column" data-bx-editor-column="item">
418 <?for ($columnNumber = 1; $columnNumber < 5; $columnNumber++):?>
419 <span data-bx-editor-column-number="<?=$columnNumber?>"
420 style="display: none;">
421 <?=Loc::getMessage('BLOCK_EDITOR_TOOL_COLUMN')?> <?=$columnNumber?>
422 </span>
423 <?endfor;?>
424 </div>
425 <?
427 {
428 echo '<div style="color: #bfbfbf; font-size: 17px; padding: 0 0; position: relative;">';
429
430 $editor = new \CHTMLEditor;
431 $res = array_merge(
432 array(
433 'height' => 400,
434 'minBodyWidth' => 350,
435 'normalBodyWidth' => 555,
436 'bAllowPhp' => false,
437 'limitPhpAccess' => false,
438 'showTaskbars' => false,
439 'showNodeNavi' => false,
440 'askBeforeUnloadPage' => true,
441 'useFileDialogs' => !IsModuleInstalled('intranet'),
442 'bbCode' => false,
443 'siteId' => SITE_ID,
444 'autoResize' => false,
445 'autoResizeOffset' => 40,
446 'saveOnBlur' => true,
447 'controlsMap' => array(
448 array('id' => 'placeholder_selector', 'compact' => true, 'sort' => 60),
449 array('id' => 'StyleSelector', 'compact' => true, 'sort' => 70),
450 array('id' => 'Bold', 'compact' => true, 'sort' => 80),
451 array('id' => 'Italic', 'compact' => true, 'sort' => 90),
452 array('id' => 'Underline', 'compact' => true, 'sort' => 100),
453 array('id' => 'Strikeout', 'compact' => true, 'sort' => 110),
454 array('id' => 'RemoveFormat', 'compact' => true, 'sort' => 120),
455 array('id' => 'Color', 'compact' => true, 'sort' => 130),
456 array('id' => 'FontSelector', 'compact' => false, 'sort' => 135),
457 array('id' => 'FontSize', 'compact' => false, 'sort' => 140),
458 //array('separator' => true, 'compact' => false, 'sort' => 145),
459 array('id' => 'OrderedList', 'compact' => true, 'sort' => 150),
460 array('id' => 'UnorderedList', 'compact' => true, 'sort' => 160),
461 array('id' => 'AlignList', 'compact' => false, 'sort' => 190),
462 //array('separator' => true, 'compact' => false, 'sort' => 200),
463 array('id' => 'InsertLink', 'compact' => true, 'sort' => 210),
464 //array('id' => 'InsertImage', 'compact' => false, 'sort' => 220),
465 //array('id' => 'InsertVideo', 'compact' => true, 'sort' => 230, 'wrap' => 'bx-b-video-'.$arParams["FORM_ID"]),
466 //array('id' => 'InsertTable', 'compact' => false, 'sort' => 250),
467 //array('id' => 'Code', 'compact' => true, 'sort' => 260),
468 //array('id' => 'Quote', 'compact' => true, 'sort' => 270, 'wrap' => 'bx-b-quote-'.$arParams["FORM_ID"]),
469 //array('id' => 'Smile', 'compact' => false, 'sort' => 280),
470 //array('separator' => true, 'compact' => false, 'sort' => 290),
471 array('id' => 'RemoveFormat', 'compact' => false, 'sort' => 310),
472 array('id' => 'Fullscreen', 'compact' => false, 'sort' => 320),
473 array('id' => 'BbCode', 'compact' => true, 'sort' => 340),
474 array('id' => 'More', 'compact' => true, 'sort' => 400)
475 ),
476 'isCopilotEnabled' => false,
477 ),
478 array(
479 'name' => 'BX_BLOCK_EDITOR_CONTENT_' . $this->id,
480 'id' => 'BX_BLOCK_EDITOR_CONTENT_' . $this->id,
481 'width' => '100%',
482 'arSmilesSet' => array(),
483 'arSmiles' => array(),
484 'content' => '',
485 'fontSize' => '14px',
486 'iframeCss' =>
487 '.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;}',
488 )
489 );
490 $editor->Show($res);
491
492 echo '</div>';
493 }
494 else
495 {
496 \CFileMan::AddHTMLEditorFrame(
497 'BX_BLOCK_EDITOR_CONTENT_' . $this->id,
498 '',
499 false,
500 "html",
501 array(
502 'height' => '200',
503 'width' => '100%'
504 ),
505 "N",
506 0,
507 "",
508 '',//'data-bx-editor-tool-input="content"',
509 false,
511 false,
512 array(
513 //'templateID' => $str_SITE_TEMPLATE_ID,
514 'componentFilter' => $this->componentFilter,
515 'limit_php_access' => !$isUserHavePhpAccess,
516 'hideTypeSelector' => true,
517 'minBodyWidth' => '420',
518 'normalBodyWidth' => '420',
519 )
520 );
521 }
522
523 $resultList[] = array(
524 'GROUP' => 'cont',
525 'ID' => 'content',
526 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_CONTENT'),
527 'HTML' => '<input type="hidden" data-bx-editor-tool-input="item" value="">' . ob_get_clean()
528 );
529
530 ob_start();
531 ?>
532 <script type="text/template" id="template-social-item">
533 <table style="background-color: #E9E9E9;">
534 <tr>
535 <td><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_ADDRESS')?></td>
536 <td>
537 <input class="href" type="text" value="#href#">
538 <select class="preset">
539 <option value=""><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_SELECT')?></option>
540 <option value="http://#SERVER_NAME#/"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_OURSITE')?></option>
541 <?if (self::isAvailableRussian()):?>
542 <option value="http://vk.com/"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_VK')?></option>
543 <option value="http://ok.ru/"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_OK')?></option>
544 <?endif;?>
545 <option value="http://facebook.com/"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_FACEBOOK')?></option>
546 <option value="http://instagram.com/"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_INSTAGRAM')?></option>
547 <option value="http://twitter.com/"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_TWITTER')?></option>
548 <option value="http://"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_SITE')?></option>
549 <option value="mailto:"><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_EMAIL')?></option>
550 </select>
551 </td>
552 </tr>
553 <tr>
554 <td><?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_NAME')?></td>
555 <td>
556 <input class="name" type="text" value="#name#">
557 <input class="delete" type="button" value="<?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_BTN_DELETE')?>">
558 </td>
559 </tr>
560 </table>
561 <br/>
562 </script>
563 <div class="container"></div>
564 <input class="add" type="button" value="<?=Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT_BTN_ADD')?>">
565 <?
566 $resultList[] = array(
567 'GROUP' => 'cont',
568 'ID' => 'social_content',
569 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_SOCIAL_CONTENT'),
570 'HTML' => '<input type="hidden" data-bx-editor-tool-input="item" value="">' . ob_get_clean()
571 );
572
573 $resultList[] = array(
574 'GROUP' => 'cont',
575 'ID' => 'button_caption',
576 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BUTTON_CAPTION'),
577 'HTML' => Tools::getControlInput(),
578 );
579
580 $resultList[] = array(
581 'GROUP' => 'style',
582 'ID' => 'font-size',
583 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_SIZE'),
584 'HTML' => Tools::getControlFontSize(),
585 );
586
587 $resultList[] = array(
588 'GROUP' => 'style',
589 'ID' => 'text-align',
590 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
591 'HTML' => Tools::getControlTextAlign(),
592 );
593
594 $resultList[] = array(
595 'GROUP' => 'style',
596 'ID' => 'border',
597 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BORDER'),
598 'HTML' => '<input type="hidden" data-bx-editor-tool-input="item" id="block_editor_style_border">
599 <select id="block_editor_style_border_style">
600 <option value="">' . Loc::getMessage('BLOCK_EDITOR_COMMON_NO') . '</option>
601 <option value="solid">' . Loc::getMessage('BLOCK_EDITOR_TOOL_BORDER_SOLID') . '</option>
602 <option value="dashed">' . Loc::getMessage('BLOCK_EDITOR_TOOL_BORDER_DASHED') . '</option>
603 <option value="dotted">' . Loc::getMessage('BLOCK_EDITOR_TOOL_BORDER_DOTTED') . '</option>
604 </select>
605 <select id="block_editor_style_border_width" style="width: 80px; min-width: 80px;">
606 <option value="">' . Loc::getMessage('BLOCK_EDITOR_COMMON_NO') . '</option>
607 <option value="1px">1px</option>
608 <option value="2px">2px</option>
609 <option value="3px">3px</option>
610 <option value="4px">4px</option>
611 <option value="5px">5px</option>
612 <option value="6px">6px</option>
613 <option value="7px">7px</option>
614 </select>
615 <input id="block_editor_style_border_color" type="hidden" class="bx-editor-color-picker">
616 <span class="bx-editor-color-picker-view"></span>
617 <span class="bx-editor-color-picker-text">' . Loc::getMessage('BLOCK_EDITOR_TOOLS_COLOR') .'</span>
618 ',
619 );
620
621 $resultList[] = array(
622 'GROUP' => 'style',
623 'ID' => 'background-color',
624 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BACKGROUND_COLOR'),
625 'HTML' => Tools::getControlColor(),
626 );
627
628 $resultList[] = array(
629 'GROUP' => 'style',
630 'ID' => 'border-radius',
631 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BORDER_RADIUS'),
633 );
634
635 $resultList[] = array(
636 'GROUP' => 'style',
637 'ID' => 'color',
638 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
639 'HTML' => Tools::getControlColor(),
640 );
641
642 $resultList[] = array(
643 'GROUP' => 'style',
644 'ID' => 'font-family',
645 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_FAMILY'),
646 'HTML' => Tools::getControlFontFamily(),
647 );
648
649 $resultList[] = array(
650 'GROUP' => 'prop',
651 'ID' => 'align',
652 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_ALIGN'),
653 'HTML' => Tools::getControlTextAlign(),
654 );
655
656 $resultList[] = array(
657 'GROUP' => 'style',
658 'ID' => 'text-decoration',
659 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_DECORATION'),
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' => 'prop',
672 'ID' => 'imagetextalign',
673 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_IMAGETEXTALIGN'),
674 'HTML' => Tools::getControlSelect(array(
675 'left' => Loc::getMessage('BLOCK_EDITOR_CTRL_ALIGN_LEFT'),
676 'right' => Loc::getMessage('BLOCK_EDITOR_CTRL_ALIGN_RIGHT')
677 ), false)
678 );
679
680 $resultList[] = array(
681 'GROUP' => 'prop',
682 'ID' => 'imagetextpart',
683 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_IMAGETEXTPART'),
684 'HTML' => Tools::getControlSelect(
685 array(
686 '1/4' => Loc::getMessage('BLOCK_EDITOR_TOOL_IMAGETEXTPART14'),
687 '1/3' => Loc::getMessage('BLOCK_EDITOR_TOOL_IMAGETEXTPART13'),
688 '1/2' => Loc::getMessage('BLOCK_EDITOR_TOOL_IMAGETEXTPART12'),
689 '2/3' => Loc::getMessage('BLOCK_EDITOR_TOOL_IMAGETEXTPART23')
690 ),
691 false)
692 );
693
694 $resultList[] = array(
695 'GROUP' => 'prop',
696 'ID' => 'height',
697 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_HEIGHT'),
698 'HTML' => Tools::getControlInput(),
699 );
700
701 $resultList[] = array(
702 'GROUP' => 'prop',
703 'ID' => 'margin-top',
704 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_TOP'),
706 );
707
708 $resultList[] = array(
709 'GROUP' => 'prop',
710 'ID' => 'margin-bottom',
711 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_BOTTOM'),
713 );
714
715 $resultList[] = array(
716 'GROUP' => 'prop',
717 'ID' => 'groupimage-view',
718 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW'),
719 'HTML' => Tools::getControlSelect(
720 array(
721 '' => Loc::getMessage('BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW_2COL'),
722 '1' => Loc::getMessage('BLOCK_EDITOR_TOOL_GROUPIMAGE_VIEW_1COL')
723 ),
724 false
725 ),
726 );
727
728 $resultList[] = array(
729 'GROUP' => 'prop',
730 'ID' => 'column-count',
731 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_COLUMN_COUNT'),
732 'HTML' => Tools::getControlSelect(array('1' => '1', '2' => '2', '3' => '3'), false),
733 );
734
735 $resultList[] = array(
736 'GROUP' => 'prop',
737 'ID' => 'paddings',
738 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_PADDINGS'),
739 'HTML' => Tools::getControlSelect(
740 array(
741 'Y' => Loc::getMessage('BLOCK_EDITOR_TOOL_PADDINGS_STANDARD'),
742 'N' => Loc::getMessage('BLOCK_EDITOR_TOOL_PADDINGS_WITHOUT')
743 ),
744 false
745 ),
746 );
747
748 $resultList[] = array(
749 'GROUP' => 'prop',
750 'ID' => 'wide',
751 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_WIDE'),
752 'HTML' => Tools::getControlSelect(
753 array(
754 'N' => Loc::getMessage('BLOCK_EDITOR_TOOL_WIDE_N'),
755 'Y' => Loc::getMessage('BLOCK_EDITOR_TOOL_WIDE_Y')
756 )
757 , false
758 ),
759 );
760
761 $resultList[] = array(
762 'GROUP' => 'style',
763 'ID' => 'bx-stylist-bgcolor',
764 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_BACKGROUND_COLOR'),
765 'HTML' => Tools::getControlColor(),
766 );
767
768 $resultList[] = array(
769 'GROUP' => 'style',
770 'ID' => 'bx-stylist-padding-top',
771 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_TOP'),
773 );
774
775 $resultList[] = array(
776 'GROUP' => 'style',
777 'ID' => 'bx-stylist-padding-bottom',
778 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_MARGIN_BOTTOM'),
780 );
781
782 $resultList[] = array(
783 'GROUP' => 'style',
784 'ID' => 'bx-stylist-text-color',
785 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
786 'HTML' => Tools::getControlColor(),
787 );
788
789 $resultList[] = array(
790 'GROUP' => 'style',
791 'ID' => 'bx-stylist-text-font-family',
792 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_FAMILY'),
793 'HTML' => Tools::getControlFontFamily(),
794 );
795
796 $resultList[] = array(
797 'GROUP' => 'style',
798 'ID' => 'bx-stylist-text-font-size',
799 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_SIZE'),
800 'HTML' => Tools::getControlFontSize(),
801 );
802
803 $resultList[] = array(
804 'GROUP' => 'style',
805 'ID' => 'bx-stylist-text-font-weight',
806 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
807 'HTML' => Tools::getControlFontWeight(),
808 );
809
810 $resultList[] = array(
811 'GROUP' => 'style',
812 'ID' => 'bx-stylist-text-line-height',
813 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_LINE_HEIGHT'),
814 'HTML' => Tools::getControlLineHeight(),
815 );
816
817 $resultList[] = array(
818 'GROUP' => 'style',
819 'ID' => 'bx-stylist-text-text-align',
820 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_TEXT') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
821 'HTML' => Tools::getControlTextAlign(),
822 );
823
824 $resultList[] = array(
825 'GROUP' => 'style',
826 'ID' => 'bx-stylist-a-color',
827 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_LINK') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
828 'HTML' => Tools::getControlColor(),
829 );
830
831 $resultList[] = array(
832 'GROUP' => 'style',
833 'ID' => 'bx-stylist-a-font-weight',
834 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_LINK') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
835 'HTML' => Tools::getControlFontWeight(),
836 );
837
838 $resultList[] = array(
839 'GROUP' => 'style',
840 'ID' => 'bx-stylist-a-text-decoration',
841 'NAME' => Loc::getMessage('BLOCK_EDITOR_TOOL_STYLIST_LINK') . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_DECORATION'),
843 );
844
845 for($i = 1; $i <= 4; $i++)
846 {
847 $resultList[] = array(
848 'GROUP' => 'style',
849 'ID' => 'bx-stylist-h' . $i . '-color',
850 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_COLOR'),
851 'HTML' => Tools::getControlColor(),
852 );
853
854 $resultList[] = array(
855 'GROUP' => 'style',
856 'ID' => 'bx-stylist-h' . $i . '-font-size',
857 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_SIZE'),
858 'HTML' => Tools::getControlFontSize(),
859 );
860
861 $resultList[] = array(
862 'GROUP' => 'style',
863 'ID' => 'bx-stylist-h' . $i . '-font-weight',
864 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_FONT_WEIGHT'),
865 'HTML' => Tools::getControlFontWeight(),
866 );
867
868 $resultList[] = array(
869 'GROUP' => 'style',
870 'ID' => 'bx-stylist-h' . $i . '-line-height',
871 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_LINE_HEIGHT'),
872 'HTML' => Tools::getControlLineHeight(),
873 );
874
875 $resultList[] = array(
876 'GROUP' => 'style',
877 'ID' => 'bx-stylist-h' . $i . '-text-align',
878 'NAME' => 'H' . $i . ' ' . Loc::getMessage('BLOCK_EDITOR_TOOL_TEXT_ALIGN'),
879 'HTML' => Tools::getControlTextAlign(),
880 );
881 }
882
883 return $resultList;
884 }
885
893 public function getUI($id, array $values)
894 {
895 if(!array_key_exists($id, $this->uiPatterns) || trim($this->uiPatterns[$id]) == '')
896 {
897 return '';
898 }
899
900 $placeholders = array_keys($values);
901 $placeholders = '#' . implode('#,#', $placeholders) . '#';
902 $placeholders = explode(',', $placeholders);
903
904 return str_replace($placeholders, array_values($values), $this->uiPatterns[$id]);
905 }
906
912 public function showEditor()
913 {
914 $textArea = '';
915 $panels = '';
916 $tabs = '';
917 $blocks = '';
918 $tools = '';
919 $devices = '';
920
921
922 foreach(array_chunk($this->blocks, static::BLOCK_COUNT_PER_PAGE) as $blocksPerPage)
923 {
924 $blocksForPage = '';
925 foreach($blocksPerPage as $block)
926 {
927 $blocksForPage .= $this->getUI('block', array(
928 'type_class' => htmlspecialcharsbx($block['IS_COMPONENT'] ? 'component' : 'blockcomponent'),
929 'code_class' => htmlspecialcharsbx(str_replace(array(':', '.'), array('-', '-'), $block['CODE'])),
930 'type' => htmlspecialcharsbx($block['TYPE']),
931 'code' => htmlspecialcharsbx($block['CODE']),
932 'name' => htmlspecialcharsbx($block['NAME']),
933 'desc' => htmlspecialcharsbx($block['DESC']),
934 ));
935 }
936
937 $blocks .= $this->getUI('block_page', array('blocks' => $blocksForPage));
938 }
939
940 foreach($this->tools as $tool)
941 {
942 $tools .= $this->getUI('tool', array(
943 'group' => htmlspecialcharsbx($tool['GROUP']),
944 'id' => htmlspecialcharsbx($tool['ID']),
945 'name' => htmlspecialcharsbx($tool['NAME']),
946 'html' => $tool['HTML'],
947 ));
948 }
949
950 foreach($this->previewModes as $mode)
951 {
952 $devices .= $this->getUI('device', array(
953 'MESS_NAME' => mb_strtoupper(htmlspecialcharsbx($mode['NAME'])),
954 'class' => htmlspecialcharsbx($mode['CLASS']),
955 'width' => htmlspecialcharsbx($mode['WIDTH']),
956 'height' => htmlspecialcharsbx($mode['HEIGHT']),
957 ));
958 }
959
960
961 if(!$this->ownResultId)
962 {
963 $this->ownResultId = 'bx-block-editor-result-' . htmlspecialcharsbx($this->id);
964 $textArea = '<textarea name="' . htmlspecialcharsbx($this->id) . '" id="' . htmlspecialcharsbx($this->ownResultId)
965 .'" style="width:800px;height:900px; display: none;"></textarea>';
966 }
967
968 foreach($this->tabs as $tabCode => $tab)
969 {
970 if(!isset($this->uiPatterns['panel-' . $tabCode]))
971 {
972 continue;
973 }
974
975 $tabs .= $this->getUI('tab', array(
976 'code' => htmlspecialcharsbx($tabCode),
977 'name' => htmlspecialcharsbx($tab['NAME']),
978 'tab_active' => ($tab['ACTIVE'] ? $this->getUI('tab_active', array()) : '')
979 ));
980
981 $panel = $this->getUI('panel-' . $tabCode, array(
982 'id' => htmlspecialcharsbx($this->id),
983 'blocks' => $blocks,
984 'tools' => $tools,
985 'devices' => $devices,
986 'nav-display' => count($this->blocks) <= static::BLOCK_COUNT_PER_PAGE ? 'bx-block-hide' : '',
987 'MESS_ACCESS_DENIED' => Loc::getMessage('ACCESS_DENIED'),
988 'MESS_STYLES' => Loc::getMessage('BLOCK_EDITOR_UI_STYLES'),
989 'MESS_BLOCKS' => Loc::getMessage('BLOCK_EDITOR_UI_BLOCKS'),
990 'MESS_TOOL_CONTENT' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_CONTENT'),
991 'MESS_TOOL_STYLES' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_STYLES'),
992 'MESS_TOOL_SETTINGS' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_SETTINGS'),
993 'MESS_TOOL_EMPTY' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_EMPTY'),
994 'MESS_TOOL_SAVE' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_SAVE'),
995 'MESS_TOOL_SAVE_TITLE' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_SAVE_TITLE'),
996 'MESS_TOOL_CANCEL' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_CANCEL'),
997 'MESS_TOOL_CANCEL_TITLE' => Loc::getMessage('BLOCK_EDITOR_UI_TOOL_CANCEL_TITLE'),
998 ));
999
1000 $panels .= $this->getUI('panel', array(
1001 'code' => htmlspecialcharsbx($tabCode),
1002 'panel_hidden' => (!$tab['ACTIVE'] ? $this->getUI('panel_hidden', array()) : ''),
1003 'html' => $panel
1004 ));
1005 }
1006
1007 return $this->getUI('main', array(
1008 'TEXTAREA' => $textArea,
1009 'id' => htmlspecialcharsbx($this->id),
1010 'tabs' => $tabs,
1011 'panels' => $panels,
1012 'MESS_BTN_MAX' => Loc::getMessage('BLOCK_EDITOR_UI_BTN_MAX'),
1013 'MESS_BTN_MIN' => Loc::getMessage('BLOCK_EDITOR_UI_BTN_MIN'),
1014 'MESS_BTN_HTML_COPY' => Loc::getMessage('BLOCK_EDITOR_UI_BTN_HTML_COPY'),
1015 ));
1016 }
1017
1023 public function show()
1024 {
1025 \CJSCore::RegisterExt('block_editor', array(
1026 'js' => array(
1027 '/bitrix/js/main/core/core_dragdrop.js',
1028 '/bitrix/js/fileman/block_editor/dialog.js',
1029 '/bitrix/js/fileman/block_editor/helper.js',
1030 '/bitrix/js/fileman/block_editor/editor.js',
1031 ),
1032 'css' => '/bitrix/js/fileman/block_editor/dialog.css',
1033 'rel' => ['ui.design-tokens', 'ui.fonts.opensans'],
1034 'lang' => '/bitrix/modules/fileman/lang/' . LANGUAGE_ID . '/js_block_editor.php',
1035 ));
1036 \CJSCore::Init(array("block_editor", "color_picker", "clipboard"));
1037
1038 static $isBlockEditorManagerInited = false;
1039 $editorBlockTypeListByCode = array();
1040 if(!$isBlockEditorManagerInited)
1041 {
1042 foreach($this->blocks as $block)
1043 {
1044 $editorBlockTypeListByCode[$block['CODE']] = $block;
1045 }
1046 }
1047
1048 $jsCreateParams = array(
1049 'id' => $this->id,
1050 'url' => $this->url,
1051 'previewUrl' => $this->previewUrl,
1052 'saveFileUrl' => $this->saveFileUrl,
1053 'templateType' => $this->templateType,
1054 'templateId' => $this->templateId,
1055 'isTemplateMode' => $this->isTemplateMode,
1056 'site' => $this->site,
1057 'charset' => $this->charset
1058 );
1059
1060
1061 $result = '';
1062 if(!$isBlockEditorManagerInited)
1063 {
1064 $result .= 'BX.BlockEditorManager.setBlockList(' . \CUtil::PhpToJSObject($editorBlockTypeListByCode) . ");\n";
1065 }
1066
1067 $result .= "var blockEditorParams = " . \CUtil::PhpToJSObject($jsCreateParams) . ";\n";
1068 $result .= "blockEditorParams['context'] = BX('bx-block-editor-container-" . htmlspecialcharsbx($this->id) . "');\n";
1069 $result .= "blockEditorParams['iframe'] = BX('bx-block-editor-iframe-" . htmlspecialcharsbx($this->id) . "');\n";
1070 $result .= "blockEditorParams['resultNode'] = BX('" . htmlspecialcharsbx($this->ownResultId) . "');\n";
1071 $result .= "BX.BlockEditorManager.create(blockEditorParams);\n";
1072
1073 $result = "\n" . '<script type="text/javascript">BX.ready(function(){' . "\n" . $result . '})</script>' . "\n";
1074 $result = $this->showEditor() . $result;
1075
1076
1077 $isBlockEditorManagerInited = true;
1078
1079 return $result;
1080 }
1081
1089 public static function getHtmlForEditor($html, $charset = null)
1090 {
1091 $phpList = \PHPParser::ParseFile($html);
1092 foreach($phpList as $php)
1093 {
1094 $phpFormatted = htmlspecialcharsbx(str_replace(["\r", "\n"], "", $php[2]));
1095 $id = 'bx_block_php_' . mt_rand();
1096 $surrogate = '<span id="' . $id . '" ' . self::BLOCK_PHP_ATTR . '="' . ($phpFormatted) . '" class="bxhtmled-surrogate" title=""></span>';
1097 $html = str_replace($php[2], $surrogate, $html);
1098 }
1099
1100 if(!$charset)
1101 {
1102 $charset = Application::getInstance()->getContext()->getCulture()->getCharset();
1103 $charset = 'UTF-8';
1104 }
1105
1106 $charsetPlaceholder = '#CHARSET#';
1107 $html = static::replaceCharset($html, $charsetPlaceholder);
1108 $html = str_replace($charsetPlaceholder, HtmlFilter::encode($charset), $html);
1109 $html = Sanitizer::clean($html);
1110
1111 return $html;
1112 }
1113
1122 public static function replaceCharset($html, $charset = '#CHARSET#', $add = false)
1123 {
1124 $html = preg_replace(
1125 '/(<meta .*?charset=["\']+?)([^"\']+?)(["\']+?.*?>)/i',
1126 '$1' . $charset . '$3',
1127 $html
1128 );
1129
1130 $html = preg_replace(
1131 '/(<meta .*?content=["\']+?[^;]+?;[ ]*?charset=)([^"\']*?)(["\']+?.*?>)/i',
1132 '$1' . $charset . '$3', $html, 1, $replaceCount
1133 );
1134 if($replaceCount === 0 && $add)
1135 {
1136 $html = preg_replace(
1137 '/(<head.*?>)/i',
1138 '$1<meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '">',
1139 $html
1140 );
1141 }
1142
1143 return $html;
1144 }
1145
1157 public static function fillTemplateBySliceContent($template, $string, $encoding = null)
1158 {
1159 return Content\Engine::fillHtmlTemplate($template, $string, $encoding);
1160 }
1161
1172 public static function fillDocumentBySliceContent(Document $document, $string, $encoding = null)
1173 {
1174 return Content\Engine::create($document)->setEncoding($encoding)->setContent($string)->fill();
1175 }
1176
1183 public static function isContentSupported($content)
1184 {
1185 if(!$content || mb_strpos($content, Content\Engine::BLOCK_PLACE_ATTR) === false)
1186 {
1187 return false;
1188 }
1189 else
1190 {
1191 return true;
1192 }
1193 }
1194
1201 public static function isHtmlDocument($content)
1202 {
1203 $result = true;
1204 $content = mb_strtoupper($content);
1205 if(mb_strpos($content, '<HTML') === false)
1206 {
1207 $result = false;
1208 }
1209 if(mb_strpos($content, '</HTML') === false)
1210 {
1211 $result = false;
1212 }
1213 if(mb_strpos($content, '<BODY') === false)
1214 {
1215 $result = false;
1216 }
1217
1218 return $result;
1219 }
1220
1227 public function setComponentFilter(array $componentFilter = null)
1228 {
1229 $this->componentFilter = $componentFilter;
1230 }
1231
1232 protected function getComponentList()
1233 {
1234 return static::getComponentListPlain(static::getComponentTree());
1235 }
1236
1237 protected function getComponentTree()
1238 {
1239 $util = new \CComponentUtil;
1240
1241 return $util->GetComponentsTree(false, false, $this->componentFilter);
1242 }
1243
1244 protected function getComponentListPlain($list)
1245 {
1246 $result = array();
1247 $path = null;
1248
1249 if(!is_array($list))
1250 {
1251 return $result;
1252 }
1253
1254 if(isset($list['@']))
1255 {
1256 $path = $list['@'];
1257 }
1258
1259 if(isset($list['*']))
1260 {
1261 $componentList = array();
1262 foreach($list['*'] as $componentName => $componentData)
1263 {
1264 $componentData['TREE_PATH'] = array($path);
1265 $componentList[$componentName] = $componentData;
1266 }
1267 return $componentList;
1268 }
1269
1270 if(isset($list['#']))
1271 {
1272 foreach($list['#'] as $key => $item)
1273 {
1274 $resultItem = static::getComponentListPlain($item);
1275 if(is_array($resultItem) && is_array($path))
1276 {
1277 foreach($resultItem as $componentName => $componentData)
1278 {
1279 if(!isset($componentData['TREE_PATH']))
1280 {
1281 $componentData['TREE_PATH'] = array();
1282 }
1283 $resultItem[$componentName]['TREE_PATH'] = array_merge(array($path), $componentData['TREE_PATH']);
1284 }
1285 }
1286
1287 $result = array_merge($result, $resultItem);
1288 }
1289 }
1290
1291 return $result;
1292 }
1293
1294}
setComponentFilter(array $componentFilter=null)
Definition editor.php:1227
setBlockList(array $blocks)
Definition editor.php:266
static isContentSupported($content)
Definition editor.php:1183
static isHtmlDocument($content)
Definition editor.php:1201
static replaceCharset($html, $charset='#CHARSET#', $add=false)
Definition editor.php:1122
setToolList(array $tools)
Definition editor.php:328
static createInstance($params)
Definition editor.php:218
getUI($id, array $values)
Definition editor.php:893
static getHtmlForEditor($html, $charset=null)
Definition editor.php:1089
static fillDocumentBySliceContent(Document $document, $string, $encoding=null)
Definition editor.php:1172
static fillTemplateBySliceContent($template, $string, $encoding=null)
Definition editor.php:1157
static getControlTextDecoration()
Definition tools.php:89
static getControlLineHeight()
Definition tools.php:148
static getControlSelect(array $optionList, $haveDefault=true)
Definition tools.php:27
static getControlPaddingBottoms()
Definition tools.php:57
static getControlFontWeight()
Definition tools.php:165
static getControlBorderRadius()
Definition tools.php:74
static getControlFontFamily()
Definition tools.php:130
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29