1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
mailblock.php
См. документацию.
1<?php
8namespace Bitrix\Sender\Preset;
9
10use Bitrix\Main\Entity;
11use Bitrix\Main\EventResult;
12use Bitrix\Main\Event;
13use Bitrix\Main\IO\File;
14use Bitrix\Main\Localization\Loc;
15
16Loc::loadMessages(__FILE__);
17
25{
29 public static function getListByType()
30 {
31 $resultTemplateList = array();
32 $arTemplateList = static::getList();
33 foreach($arTemplateList as $template)
34 $resultTemplateList[$template['TYPE']][] = $template;
35
36 return $resultTemplateList;
37 }
38
42 public static function getList()
43 {
44 $resultList = array();
45 $event = new Event('sender', 'OnPresetMailBlockList');
46 $event->send();
47
48 foreach ($event->getResults() as $eventResult)
49 {
50 if ($eventResult->getType() == EventResult::ERROR)
51 {
52 continue;
53 }
54
55 $eventResultParameters = $eventResult->getParameters();
56
57 if (!empty($eventResultParameters))
58 {
59 $resultList = array_merge($resultList, $eventResultParameters);
60 }
61 }
62
63 return $resultList;
64 }
65
69 public static function getBlockForVisualEditor()
70 {
72 'items' => array(),
73 'groups' => array(),
74 'rootDefaultFilename' => ''
75 );
76
77 $arGroupExists = array();
78 $arBlocksByType = static::getListByType();
79 foreach($arBlocksByType as $type => $arBlockList)
80 {
81 foreach($arBlockList as $blockNum => $arBlock)
82 {
83 $name = 'mailblock'.str_pad($blockNum+1, 4, '0', STR_PAD_LEFT);
84 $key = $arBlock['TYPE'].'/'.$name;
85 $arResult['items'][$key] = array(
86 'name' => $name,
87 'path' => $arBlock['TYPE'],
88 'title' => $arBlock['NAME'],
89 'thumb' => '',
90 'code' => $arBlock['HTML'],
91 'description' => empty($arBlock['DESC']) ? '' : $arBlock['DESC'],
92 'template' => '',
93 'level' => '',
94 'parent' => $arBlock['TYPE'],
95 );
96
97 if(!in_array($arBlock['TYPE'], $arGroupExists))
98 {
99 $arResult['groups'][] = array(
100 'path' => '',
101 'name' => $arBlock['TYPE'],
102 'level' => '0',
103 'default_name' => 'mailblockgroup' . (count($arGroupExists) + 1)
104 );
105 $arGroupExists[] = $arBlock['TYPE'];
106 }
107
108 } // foreach $arBlockList
109
110 } // foreach $arBlocksByType
111
112 if(isset($arResult['groups'][0]))
113 $arResult['rootDefaultFilename'] = $arResult['groups'][0]['default_name'];
114
115 return $arResult;
116 }
117}
$type
Определения options.php:106
$arResult
Определения generate_coupon.php:16
Определения event.php:5
static getBlockForVisualEditor()
Определения mailblock.php:69
static getListByType()
Определения mailblock.php:29
static getList()
Определения mailblock.php:42
$template
Определения file_edit.php:49
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
$event
Определения prolog_after.php:141
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