1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Collector.php
См. документацию.
1<?php
2declare(strict_types=1);
3
5
10
17{
18 public const SECTIONS = [
19 'MENU' => 'menu',
20 'COVER' => 'cover',
21 'TITLE' => 'title',
22 'TEXT_IMAGE' => 'textImage',
23 'TARIFFS' => 'tariffs',
24 'TEAM' => 'team',
25 'FEEDBACK' => 'feedback',
26 'FORM' => 'crmForm',
27 'SEPARATORS' => 'separators',
28 ];
29
30 private const BG_TYPES = [
31 'TRANSPARENT' => 'transparent',
32 'PRIMARY' => 'primary',
33 'IMAGE' => 'image',
34 ];
35
36 private const BG_SEPARATOR_TYPES = [
37 'TYPE_1' => 'transparentToPrimary',
38 'TYPE_2' => 'primaryToTransparent',
39 ];
40
41 private const JUST_ONCE_SECTIONS = [
42 self::SECTIONS['TARIFFS'],
43 self::SECTIONS['TEAM'],
44 ];
45
46 private const SEPARATOR_CREATION_PROBABILITY = 70;
47
51 private array $blocks = [];
52
56 private array $addedSections = [];
57
69 public function getBlocks(): array
70 {
71 if (!empty($this->blocks))
72 {
73 return $this->blocks;
74 }
75
76 $this->addRandomBlock(self::SECTIONS['MENU']);
77 $this->addRandomBlock(self::SECTIONS['COVER']);
78 $this->addRandomBlock(self::SECTIONS['TEXT_IMAGE']);
79 $this->addRandomBlock(self::SECTIONS['TEXT_IMAGE']);
80 $this->addRandomBlock($this->getRandomFromSections([
81 self::SECTIONS['TARIFFS'],
82 self::SECTIONS['TEXT_IMAGE'],
83 self::SECTIONS['TEAM'],
84 ]));
85 $this->addRandomBlock($this->getRandomFromSections([
86 self::SECTIONS['TEXT_IMAGE'],
87 self::SECTIONS['TARIFFS'],
88 self::SECTIONS['FEEDBACK'],
89 self::SECTIONS['TEAM'],
90 ]));
91 $this->addRandomBlock(self::SECTIONS['FORM']);
92
93 $this->finalize();
94
95 return $this->blocks;
96 }
97
98 public static function getSeparatorsHeight(): array
99 {
100 return [
101 '26.2.separator' => [
102 'heightClass' => 'g-height-70--md',
103 ],
104 '26.3.separator' => [
105 'heightClass' => 'g-height-70--md',
106 ],
107 '26.4.separator' => [
108 'heightClass' => 'g-height-70--md',
109 ],
110 '26.5.separator' => [
111 'heightClass' => 'g-height-70--md',
112 ],
113 ];
114 }
115
123 public static function getStylesDataForBlockWithPrimaryBg(string $codeBlock): ?array
124 {
125 $sharedStyles = [
126 'title' => [
127 'property' => ['--color'],
128 'styleValue' => ['colorsHeadersTheme'],
129 ],
130 'text' => [
131 'property' => ['--color'],
132 'styleValue' => ['colorsTextsTheme'],
133 ],
134 'border' => [
135 'property' => ['--border-color'],
136 'styleValue' => ['colorsTextsTheme'],
137 ],
138 ];
139
140 $blocksStylesData = [
141 '04.7.one_col_fix_with_title_and_text_2' => [
142 '.landing-block-node-inner' => $sharedStyles['border'],
143 '.landing-block-node-subtitle' => $sharedStyles['text'],
144 '.landing-block-node-title' => $sharedStyles['title'],
145 '.landing-block-node-text' => $sharedStyles['text'],
146 ],
147 '04.1.one_col_fix_with_title' => [
148 '.landing-block-node-inner' => $sharedStyles['border'],
149 '.landing-block-node-subtitle' => $sharedStyles['text'],
150 '.landing-block-node-title' => $sharedStyles['title'],
151 ],
152 '08.4.fix_title_and_text' => [
153 '.landing-block-node-title' => [
154 'property' => ['--color', '--border-color'],
155 'styleValue' => ['colorsHeadersTheme', 'colorsTextsTheme'],
156 ],
157 '.landing-block-node-text' => $sharedStyles['text'],
158 ],
159 '27.one_col_fix_title_and_text_2' => [
160 '.landing-block-node-title' => $sharedStyles['title'],
161 '.landing-block-node-text' => $sharedStyles['text'],
162 ],
163 '27.3.one_col_fix_title' => [
164 '.landing-block-node-title' => $sharedStyles['title'],
165 ],
166 '20.3.four_cols_fix_img_title_text' => [
167 '.landing-block-node-title' => $sharedStyles['title'],
168 '.landing-block-node-text' => $sharedStyles['text'],
169 ],
170 '20.2.three_cols_fix_img_title_text' => [
171 '.landing-block-node-title' => $sharedStyles['title'],
172 '.landing-block-node-text' => $sharedStyles['text'],
173 ],
174 '31.4.two_cols_img_text_fix' => [
175 '.landing-block-node-title' => $sharedStyles['title'],
176 '.landing-block-node-text' => $sharedStyles['text'],
177 ],
178 '31.3.two_cols_text_img_fix' => [
179 '.landing-block-node-title' => $sharedStyles['title'],
180 '.landing-block-node-text' => $sharedStyles['text'],
181 ],
182 '19.2.features_with_img' => [
183 '.landing-block-node-card-icon-border' => $sharedStyles['title'],
184 '.landing-block-node-subtitle' => $sharedStyles['title'],
185 '.landing-block-node-title' => $sharedStyles['title'],
186 '.landing-block-node-text' => $sharedStyles['text'],
187 '.landing-block-node-card-title' => $sharedStyles['title'],
188 '.landing-block-node-card-text' => $sharedStyles['text'],
189 ],
190 '19.2.features_with_img_right' => [
191 '.landing-block-node-card-icon-border' => $sharedStyles['title'],
192 '.landing-block-node-subtitle' => $sharedStyles['title'],
193 '.landing-block-node-title' => $sharedStyles['title'],
194 '.landing-block-node-text' => $sharedStyles['text'],
195 '.landing-block-node-card-title' => $sharedStyles['title'],
196 '.landing-block-node-card-text' => $sharedStyles['text'],
197 ],
198 '09.1.two_cols_fix_text_and_image_slider_2' => [
199 '.landing-block-node-header' => $sharedStyles['border'],
200 '.landing-block-node-subtitle' => $sharedStyles['title'],
201 '.landing-block-node-title' => $sharedStyles['title'],
202 '.landing-block-node-text' => $sharedStyles['text'],
203 ],
204 '09.1.two_cols_fix_text_and_image_slider' => [
205 '.landing-block-node-header' => $sharedStyles['border'],
206 '.landing-block-node-subtitle' => $sharedStyles['title'],
207 '.landing-block-node-title' => $sharedStyles['title'],
208 '.landing-block-node-text' => $sharedStyles['text'],
209 ],
210 '18.two_cols_fix_img_text_button' => [
211 '.landing-block-node-title' => $sharedStyles['title'],
212 '.landing-block-node-text' => $sharedStyles['text'],
213 '.landing-block-node-button' => [
214 'property' => ['--color', '--color-hover', '--button-color'],
215 'styleValue' => ['colorsTextsTheme', 'var(--primary)', 'colorsTextsTheme'],
216 ],
217 ],
218 '19.4.features_with_img' => [
219 '.landing-block-node-subtitle' => $sharedStyles['title'],
220 '.landing-block-node-title' => $sharedStyles['title'],
221 '.landing-block-node-text' => $sharedStyles['text'],
222 ],
223 '19.4.features_with_img_left' => [
224 '.landing-block-node-subtitle' => $sharedStyles['title'],
225 '.landing-block-node-title' => $sharedStyles['title'],
226 '.landing-block-node-text' => $sharedStyles['text'],
227 ],
228 '11.2.three_cols_fix_tariffs_with_img' => [
229 '.landing-block-node-title' => [
230 'property' => ['--color', '--border-color'],
231 'styleValue' => ['colorsHeadersTheme', 'colorsHeadersTheme'],
232 ],
233 '.landing-block-node-text' => $sharedStyles['text'],
234 ],
235 '28.personal_slider_2' => [
236 '.landing-block-node-person-name' => $sharedStyles['title'],
237 '.landing-block-node-person-post' => $sharedStyles['title'],
238 '.landing-block-node-person-text' => $sharedStyles['text'],
239 '.landing-block-node-person-link' => $sharedStyles['text'],
240 ],
241 '44.6.two_columns_with_peoples' => [
242 '.landing-block-node-card-name' => $sharedStyles['title'],
243 '.landing-block-node-card-post' => $sharedStyles['title'],
244 '.landing-block-node-card-text' => $sharedStyles['text'],
245 ],
246 ];
247
248 return $blocksStylesData[$codeBlock] ?? null;
249 }
250
251 public static function getMenuItemsNodeCode($code): ?string
252 {
253 $menuBlocksData = [
254 '0.menu_14_music' => '.landing-block-node-menu-list-item-link',
255 '0.menu_19_travel' => '.landing-block-node-menu-list-item-link',
256 '0.menu_05' => '.landing-block-node-menu-list-item-link',
257 ];
258
259 return $menuBlocksData[$code] ?? null;
260 }
261
262 public static function getMenuCardsNodeCode($code): ?string
263 {
264 $menuBlocksData = [
265 '0.menu_14_music' => '.landing-block-node-menu-list-item',
266 '0.menu_19_travel' => '.landing-block-node-menu-list-item',
267 '0.menu_05' => '.landing-block-node-menu-list-item',
268 ];
269
270 return $menuBlocksData[$code] ?? null;
271 }
272
273 public static function getAvatarNodes($codeBlock): array
274 {
275 $blocksWithAvatarNodes = [
276 '20.4.text_3cols_with_bottom_information' => [
277 'imgNodeCode' => '.landing-block-node-author-img',
278 'textNodeCode' => '.landing-block-node-author',
279 ],
280 '23.big_carousel_blocks' => [
281 'imgNodeCode' => '.landing-block-node-img',
282 'textNodeCode' => '.landing-block-node-title',
283 ],
284 '28.personal_slider_2' => [
285 'imgNodeCode' => '.landing-block-node-person-photo',
286 'textNodeCode' => '.landing-block-node-person-name',
287 ],
288 '28.2.team' => [
289 'imgNodeCode' => '.landing-block-node-employee-photo',
290 'textNodeCode' => '.landing-block-node-employee-name',
291 ],
292 '43.3.cover_with_feedback' => [
293 'imgNodeCode' => '.landing-block-node-card-photo',
294 'textNodeCode' => '.landing-block-node-card-name',
295 ],
296 '43.5.cover_with_feedback_2' => [
297 'imgNodeCode' => '.landing-block-node-card-photo',
298 'textNodeCode' => '.landing-block-node-card-name',
299 ],
300 '44.6.two_columns_with_peoples' => [
301 'imgNodeCode' => '.landing-block-node-card-photo',
302 'textNodeCode' => '.landing-block-node-card-name',
303 ],
304 ];
305
306 return $blocksWithAvatarNodes[$codeBlock] ?? [];
307 }
308
309 public static function getTitleNodes($codeBlock): ?array
310 {
311 $blocksTitlesNodes = [
312 '04.1.one_col_fix_with_title' => [
313 '.landing-block-node-inner',
314 ],
315 '04.7.one_col_fix_with_title_and_text_2' => [
316 '.landing-block-node-inner',
317 ],
318 '08.4.fix_title_and_text' => [
319 '.landing-block-node-title',
320 ],
321 '09.1.two_cols_fix_text_and_image_slider' => [
322 '.landing-block-node-header',
323 ],
324 '09.1.two_cols_fix_text_and_image_slider_2' => [
325 '.landing-block-node-header',
326 ],
327 '11.2.three_cols_fix_tariffs_with_img' => [
328 '.landing-block-node-title',
329 ],
330 '27.one_col_fix_title_and_text_2' => [
331 '.landing-block-node-title',
332 ],
333 '27.3.one_col_fix_title' => [
334 '.landing-block-node-title',
335 ],
336 '28.2.team' => [
337 '.landing-block-node-title',
338 ],
339 ];
340
341 return $blocksTitlesNodes[$codeBlock] ?? [];
342 }
343
344 public static function getImgNodesUsePreviewImage(): array
345 {
346 return [
347 '01.big_with_text_3' => [
348 '.landing-block-node-img',
349 ],
350 '01.big_with_text_3_1' => [
351 '.landing-block-node-img',
352 ],
353 '41.3.announcement_with_slider' => [
354 '.landing-block-node-bgimg',
355 ],
356 ];
357 }
358
359 private function finalize(): void
360 {
361 $this->pasteTitleBlocks();
362 $this->applyBgTypeToNextBlock();
363 $this->pasteSeparatorBlocks();
364 }
365
373 private function addRandomBlock(string $section): void
374 {
375 $allowedBlocks = $this->getAllowedBlocks();
376
377 if (!$this->isValidSection($section, $allowedBlocks))
378 {
379 return;
380 }
381
382 $code = $this->getRandomElement(array_keys($allowedBlocks[$section]));
383 $bgType = $this->getRandomElement($allowedBlocks[$section][$code]['bgType']);
384
385 if (!$code || !$bgType)
386 {
387 return;
388 }
389
390 $block = self::createBlock($code, $section, $bgType);
391
392 $this->blocks[] = $block;
393 $this->addedSections[] = $section;
394 }
395
396 private function isValidSection(string $section, array $allowedBlocks): bool
397 {
398 if (!isset($allowedBlocks[$section]))
399 {
400 return false;
401 }
402
403 return true;
404 }
405
413 private function getRandomElement(array $variants): ?string
414 {
415 if (empty($variants))
416 {
417 return null;
418 }
419
420 return $variants[array_rand($variants)];
421 }
422
423 private static function createBlock(string $code, string $section, string $bgType): Data\Block
424 {
425 $block = new Data\Block($code, $section, $bgType);
426 self::createNodesInBlock($block);
427
428 return $block;
429 }
430
431 private static function createNodesInBlock(Data\Block $block): void
432 {
433 $blockCode = $block->getCode();
434 $manifest = Block::getManifestFile($blockCode);
435 if (!isset($manifest['nodes']))
436 {
437 return;
438 }
439
440 $nodes = $manifest['nodes'];
441 $blockContent = Block::getContentFromRepository($blockCode);
442
443 foreach ($nodes as $code => $node)
444 {
445 $nodeCode = ltrim($code, '.');
446 $countElements = substr_count($blockContent, $nodeCode . ' ');
447 $countElements += substr_count($blockContent, $nodeCode . '"');
448 $node['placeholders'] = array_fill(0, $countElements, '');
449 if (in_array($code, self::getAvatarNodes($blockCode), true))
450 {
451 $node['isAvatarNode'] = true;
452 }
453 if ($node['type'] === 'img' && !$block->isMenu())
454 {
455 $dataImages = Operator::getSizeDataImagesBySelector($code, $blockContent);
456 $node['sizeData'] = $dataImages;
457 $defaultSrcData = Operator::getDefaultSrc($dataImages);
458 $node['defaultSrc'] = $defaultSrcData['src'];
459 if ($node['create2xByDefault'] === false)
460 {
461 $node['defaultSrc2x'] = $node['defaultSrc'];
462 }
463 else
464 {
465 $node['defaultSrc2x'] = $defaultSrcData['src2x'];
466 }
467 }
468
469 $type = NodeType::from($node['type'] ?? '');
470 $createdNode = Node::create($type, $code, $node);
471 if ($createdNode)
472 {
473 $block->addNode($createdNode);
474 }
475 }
476 }
477
483 private function pasteSeparatorBlocks(): void
484 {
485 $separatorsGroup = $this->getRandomSeparatorsGroup($this->getAllowedBlocks());
486
487 if (!$separatorsGroup)
488 {
489 return;
490 }
491
492 $blocksListWithSeparators = [];
493 $previousBgType = null;
494 $previousSectionIsMenu = false;
495
496 foreach ($this->blocks as $block)
497 {
498 $currentBgType = $block->getBgType();
499 $randomSeparatorProbability = rand(1, 100);
500
501 if (
502 $randomSeparatorProbability <= self::SEPARATOR_CREATION_PROBABILITY
503 && !$previousSectionIsMenu
504 && $this->shouldAddSeparator($previousBgType, $currentBgType)
505 )
506 {
507 $blocksListWithSeparators[] = $this->createSeparatorBlock($separatorsGroup, $currentBgType);
508 }
509
510 $blocksListWithSeparators[] = $block;
511 $previousBgType = $currentBgType;
512 $previousSectionIsMenu = $block->isMenu();
513 }
514
515 $this->blocks = $blocksListWithSeparators;
516 }
517
523 private function pasteTitleBlocks(): void
524 {
525 $allowedBlocks = $this->getAllowedBlocks();
526 $blocksListWithSeparators = [];
527 foreach ($this->blocks as $block)
528 {
529 if ($this->isNeedTitles($block->getCode()))
530 {
531 $code = $this->getRandomElement(array_keys($allowedBlocks[self::SECTIONS['TITLE']]));
532 $preferredBgType = $block->getBgType();
533 if (in_array($preferredBgType, $allowedBlocks[self::SECTIONS['TITLE']][$code]['bgType'], true))
534 {
535 $bgType = $preferredBgType;
536 }
537 else
538 {
539 $bgType = $this->getRandomElement($allowedBlocks[self::SECTIONS['TITLE']][$code]['bgType']);
540 }
541 $blocksListWithSeparators[] = $this->createTitleBlock($code, $bgType);
542 }
543 $blocksListWithSeparators[] = $block;
544 }
545 $this->blocks = $blocksListWithSeparators;
546 }
547
556 private function shouldAddSeparator(?string $previousBgType, string $currentBgType): bool
557 {
558 return ($currentBgType === self::BG_TYPES['PRIMARY'] && $previousBgType === self::BG_TYPES['TRANSPARENT'])
559 || ($currentBgType === self::BG_TYPES['TRANSPARENT'] && $previousBgType === self::BG_TYPES['PRIMARY']);
560 }
561
570 private function createSeparatorBlock(array $separatorsGroup, string $currentBgType): Data\Block
571 {
572 $separatorCode = $separatorsGroup[array_rand($separatorsGroup)];
573 $bgTypeIsPrimary = $currentBgType === self::BG_TYPES['PRIMARY'];
574 $separatorBg = $bgTypeIsPrimary ? self::BG_SEPARATOR_TYPES['TYPE_1'] : self::BG_SEPARATOR_TYPES['TYPE_2'];
575
576 $separatorBlock = new Data\Block($separatorCode, self::SECTIONS['SEPARATORS'], $separatorBg);
577 $nodes = Block::getManifestFile($separatorCode)['nodes'];
578
579 foreach ($nodes as $key => $node)
580 {
581 if (isset($node['type']))
582 {
583 $type = NodeType::from($node['type']);
584 $node = Node::create($type, $key, $node);
585 if ($node)
586 {
587 $separatorBlock->addNode($node);
588 }
589 }
590 }
591
592 return $separatorBlock;
593 }
594
603 private function createTitleBlock(string $code, string $bgType): Data\Block
604 {
605 return self::createBlock($code, self::SECTIONS['TITLE'], $bgType);
606 }
607
615 private function getRandomSeparatorsGroup(array $allowedBlocks): ?array
616 {
617 if (empty($allowedBlocks[self::SECTIONS['SEPARATORS']]))
618 {
619 return null;
620 }
621
622 return $allowedBlocks[self::SECTIONS['SEPARATORS']][array_rand($allowedBlocks[self::SECTIONS['SEPARATORS']])];
623 }
624
631 private function applyBgTypeToNextBlock(): void
632 {
633 $blocksCount = count($this->blocks);
634 foreach ($this->blocks as $index => $block)
635 {
636 if ($this->canApplyBgTypeToNextBlock($block, $index, $blocksCount))
637 {
638 $this->setBgTypeToNextBlock($block, $index);
639 }
640 }
641 }
642
652 private function canApplyBgTypeToNextBlock(Data\Block $block, int $index, int $blocksCount): bool
653 {
654 $allowedBlocks = $this->getAllowedBlocks();
655 if (
656 $index + 1 > $blocksCount
657 || (
658 $block->getSection() !== self::SECTIONS['TITLE']
659 && $block->getCode() !== '41.3.announcement_with_slider'
660 )
661 )
662 {
663 return false;
664 }
665
666 if (isset($this->blocks[$index + 1]))
667 {
668 $nextBlock = $this->blocks[$index + 1];
669 $nextSection = $nextBlock->getSection();
670 $nextCode = $nextBlock->getCode();
671
672 return isset($allowedBlocks[$nextSection][$nextCode]['bgType'])
673 && in_array($block->getBgType(), $allowedBlocks[$nextSection][$nextCode]['bgType'], true);
674 }
675
676 return false;
677 }
678
685 private function setBgTypeToNextBlock(Data\Block $block, int $index): void
686 {
687 $nextBlock = $this->blocks[$index + 1];
688 $nextBlock->setBgType($block->getBgType());
689 }
690
698 private function getRandomFromSections(array $sections): string
699 {
700 $sections = array_filter(
701 $sections, function($section) {
702 if (!in_array($section, self::JUST_ONCE_SECTIONS, true))
703 {
704 return true;
705 }
706
707 return !in_array($section, $this->addedSections, true);
708 }
709 );
710
711 return $sections[array_rand($sections)];
712 }
713
719 private function getAllowedBlocks(): array
720 {
721 $typeGroups = [
722 'notImage' => [self::BG_TYPES['TRANSPARENT'], self::BG_TYPES['PRIMARY']],
723 ];
724
725 return [
726 self::SECTIONS['MENU'] => [
727 '0.menu_05' => [
728 'bgType' => $typeGroups['notImage'],
729 ],
730 '0.menu_14_music' => [
731 'bgType' => $typeGroups['notImage'],
732 ],
733 '0.menu_19_travel' => [
734 'bgType' => $typeGroups['notImage'],
735 ],
736 ],
737 self::SECTIONS['COVER'] => [
738 '01.big_with_text_3' => [
739 'bgType' => [self::BG_TYPES['IMAGE']],
740 ],
741 '01.big_with_text_3_1' => [
742 'bgType' => [self::BG_TYPES['IMAGE']],
743 ],
744 '41.3.announcement_with_slider' => [
745 'bgType' => $typeGroups['notImage'],
746 ],
747 ],
748 self::SECTIONS['TITLE'] => [
749 '04.1.one_col_fix_with_title' => [
750 'bgType' => $typeGroups['notImage'],
751 ],
752 '04.7.one_col_fix_with_title_and_text_2' => [
753 'bgType' => $typeGroups['notImage'],
754 ],
755 '08.4.fix_title_and_text' => [
756 'bgType' => $typeGroups['notImage'],
757 ],
758 '27.one_col_fix_title_and_text_2' => [
759 'bgType' => $typeGroups['notImage'],
760 ],
761 '27.3.one_col_fix_title' => [
762 'bgType' => $typeGroups['notImage'],
763 ],
764 ],
765 self::SECTIONS['TEXT_IMAGE'] => [
766 '01.big_with_text_2' => [
767 'bgType' => [self::BG_TYPES['IMAGE']],
768 ],
769 '09.1.two_cols_fix_text_and_image_slider' => [
770 'bgType' => $typeGroups['notImage'],
771 ],
772 '09.1.two_cols_fix_text_and_image_slider_2' => [
773 'bgType' => $typeGroups['notImage'],
774 ],
775 '18.two_cols_fix_img_text_button' => [
776 'bgType' => $typeGroups['notImage'],
777 ],
778 '19.2.features_with_img' => [
779 'bgType' => $typeGroups['notImage'],
780 ],
781 '19.2.features_with_img_right' => [
782 'bgType' => $typeGroups['notImage'],
783 ],
784 '19.4.features_with_img' => [
785 'bgType' => $typeGroups['notImage'],
786 ],
787 '19.4.features_with_img_left' => [
788 'bgType' => $typeGroups['notImage'],
789 ],
790 '20.2.three_cols_fix_img_title_text' => [
791 'bgType' => $typeGroups['notImage'],
792 ],
793 '20.3.four_cols_fix_img_title_text' => [
794 'bgType' => $typeGroups['notImage'],
795 ],
796 '20.4.text_3cols_with_bottom_information' => [
797 'bgType' => $typeGroups['notImage'],
798 ],
799 '31.3.two_cols_text_img_fix' => [
800 'bgType' => $typeGroups['notImage'],
801 ],
802 '31.4.two_cols_img_text_fix' => [
803 'bgType' => $typeGroups['notImage'],
804 ],
805 '32.3.img_grid_1_2cols_1' => [
806 'bgType' => $typeGroups['notImage'],
807 ],
808 '32.5.img_grid_3cols_1' => [
809 'bgType' => $typeGroups['notImage'],
810 ],
811 '32.10.img_grid_2cols_3' => [
812 'bgType' => $typeGroups['notImage'],
813 ],
814 '32.11.img_grid_4cols_4' => [
815 'bgType' => $typeGroups['notImage'],
816 ],
817 '32.15.img_one_big_full' => [
818 'bgType' => $typeGroups['notImage'],
819 ],
820 '40.2.two_cols_carousel' => [
821 'bgType' => $typeGroups['notImage'],
822 ],
823 '40.6.two_img_top_bottom' => [
824 'bgType' => $typeGroups['notImage'],
825 ],
826 ],
827 self::SECTIONS['FEEDBACK'] => [
828 '23.big_carousel_blocks' => [
829 'bgType' => $typeGroups['notImage'],
830 ],
831 '43.3.cover_with_feedback' => [
832 'bgType' => [self::BG_TYPES['IMAGE']],
833 ],
834 '43.5.cover_with_feedback_2' => [
835 'bgType' => [self::BG_TYPES['IMAGE']],
836 ],
837 ],
838 self::SECTIONS['TARIFFS'] => [
839 '11.2.three_cols_fix_tariffs_with_img' => [
840 'bgType' => $typeGroups['notImage'],
841 ],
842 '44.7.three_columns_with_img_and_price' => [
843 'bgType' => $typeGroups['notImage'],
844 ],
845 ],
846 self::SECTIONS['TEAM'] => [
847 '28.personal_slider_2' => [
848 'bgType' => $typeGroups['notImage'],
849 ],
850 '28.2.team' => [
851 'bgType' => [self::BG_TYPES['IMAGE']],
852 ],
853 '44.6.two_columns_with_peoples' => [
854 'bgType' => $typeGroups['notImage'],
855 ],
856 ],
857 self::SECTIONS['FORM'] => [
858 '33.1.form_1_transparent_black_left_text' => [
859 'bgType' => [self::BG_TYPES['IMAGE']],
860 ],
861 '33.2.form_1_transparent_black_right_text' => [
862 'bgType' => [self::BG_TYPES['IMAGE']],
863 ],
864 '33.10.form_2_light_left_text' => [
865 'bgType' => [self::BG_TYPES['TRANSPARENT']],
866 ],
867 '33.12.form_2_light_right_text' => [
868 'bgType' => [self::BG_TYPES['TRANSPARENT']],
869 ],
870 ],
871 self::SECTIONS['SEPARATORS'] => [
872 ['26.2.separator', '26.3.separator'],
873 ['26.4.separator', '26.5.separator'],
874 ['26.6.separator_waves'],
875 ],
876 ];
877 }
878
879 private function isNeedTitles($codeBlock): bool
880 {
881 $blockCodesWhichNeedTitles = [
882 '20.2.three_cols_fix_img_title_text',
883 '20.3.four_cols_fix_img_title_text',
884 '20.4.text_3cols_with_bottom_information',
885 '32.3.img_grid_1_2cols_1',
886 '32.5.img_grid_3cols_1',
887 '32.10.img_grid_2cols_3',
888 '32.11.img_grid_4cols_4',
889 '32.15.img_one_big_full',
890 '40.2.two_cols_carousel',
891 '40.6.two_img_top_bottom',
892 '23.big_carousel_blocks',
893 '44.7.three_columns_with_img_and_price',
894 '28.personal_slider_2',
895 '44.6.two_columns_with_peoples',
896 ];
897
898 if (in_array($codeBlock, $blockCodesWhichNeedTitles, true))
899 {
900 return true;
901 }
902
903 return false;
904 }
905}
$type
Определения options.php:106
static getImgNodesUsePreviewImage()
Определения Collector.php:344
static getMenuItemsNodeCode($code)
Определения Collector.php:251
static getStylesDataForBlockWithPrimaryBg(string $codeBlock)
Определения Collector.php:123
static getMenuCardsNodeCode($code)
Определения Collector.php:262
static getTitleNodes($codeBlock)
Определения Collector.php:309
static getAvatarNodes($codeBlock)
Определения Collector.php:273
static getDefaultSrc(array $dataImages)
Определения Operator.php:130
static getSizeDataImagesBySelector(string $selector, string $blockContent)
Определения Operator.php:115
create()
Определения directoryentry.php:12
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
if(empty($signedUserToken)) $key
Определения quickway.php:257
</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