66 public static function getList(array $parameters = array())
68 $selector = Templates\Selector::create();
69 if (isset($parameters[0]))
71 $selector->withTypeId($parameters[0]);
73 if (isset($parameters[1]))
75 $selector->withId($parameters[1]);
77 return $selector->withDefaultMessageCode()->getList();
89 static $templateListByType;
91 if(!$templateListByType)
92 $templateListByType = \Bitrix\Sender\Preset\Template::getListByType();
94 $templateTypeList = \Bitrix\Sender\Preset\Template::getTypeList();
100 letterManager =
new SenderLetterManager;
101 if(!letterManager.get(
'<?=$containerId?>'))
103 letterManager.add(
'<?=$containerId?>', {
'container': BX(
'<?=$containerId?>')});
107 <div
class=
"sender-template-cont">
109 <table style=
"width: 100%;">
111 <td style=
"vertical-align: top;">
112 <div
class=
"sender-template-type-selector">
114 $firstTemplateType =
null;
115 foreach($templateTypeList as $templateType => $templateTypeName):
116 if(!$firstTemplateType) $firstTemplateType = $templateType;
118 <div
class=
"sender-template-type-selector-button sender-template-type-selector-button-type-<?=$templateType?>"
119 data-bx-sender-tmpl-type=
"<?=htmlspecialcharsbx($templateType)?>">
120 <?=$templateTypeName?>
125 <td style=
"vertical-align: top; width: 100%;">
126 <div
class=
"sender-template-list-container">
127 <?
foreach($templateTypeList as $templateType => $templateTypeName):?>
128 <div
id=
"sender-template-list-type-container-<?=$templateType?>" class=
"sender-template-list-type-container sender-template-list-type-container-<?=$templateType?>" style=
"display: none;">
130 if(isset($templateListByType[$templateType]))
131 foreach($templateListByType[$templateType] as $templateNum => $template):
134 <div
class=
"sender-template-list-type-block">
135 <div
class=
"sender-template-list-type-block-caption sender-template-list-block-selector"
136 data-bx-sender-tmpl-version=
"<?=($isContentForBlockEditor?'block':'visual')?>"
137 data-bx-sender-tmpl-name=
"<?=htmlspecialcharsbx($template['NAME'])?>"
138 data-bx-sender-tmpl-type=
"<?=htmlspecialcharsbx($template['TYPE'])?>"
139 data-bx-sender-tmpl-code=
"<?=htmlspecialcharsbx($template['ID'])?>"
140 data-bx-sender-tmpl-lang=
"<?=LANGUAGE_ID?>">
141 <a
class=
"sender-link-email" href=
"javascript: void(0);">
142 <?=htmlspecialcharsbx($template[
'NAME'])?>
144 <?
if(!$isContentForBlockEditor):?>
146 <span style=
"font-size: 10px;"><?=
Loc::getMessage(
'SENDER_PRESET_TEMPLATE_OLD_EDITOR')?></span>
149 <div
class=
"sender-template-list-type-block-img sender-template-list-block-selector"
150 data-bx-sender-tmpl-version=
"<?=($isContentForBlockEditor?'block':'visual')?>"
151 data-bx-sender-tmpl-name=
"<?=htmlspecialcharsbx($template['NAME'])?>"
152 data-bx-sender-tmpl-type=
"<?=htmlspecialcharsbx($template['TYPE'])?>"
153 data-bx-sender-tmpl-code=
"<?=htmlspecialcharsbx($template['ID'])?>"
154 data-bx-sender-tmpl-lang=
"<?=LANGUAGE_ID?>">
155 <?
if(!empty($template[
'ICON'])):?>
156 <img src=
"<?=$template['ICON']?>">
159 <?
if(!empty($template[
'HTML'])):?>
160 <div
class=
"sender-template-message-preview-btn"
161 data-bx-sender-tmpl-name=
"<?=htmlspecialcharsbx($template['NAME'])?>"
162 data-bx-sender-tmpl-type=
"<?=htmlspecialcharsbx($template['TYPE'])?>"
163 data-bx-sender-tmpl-code=
"<?=htmlspecialcharsbx($template['ID'])?>"
164 data-bx-sender-tmpl-lang=
"<?=LANGUAGE_ID?>">
165 <a
class=
"sender-link-email " href=
"javascript: void(0);"><?=
Loc::getMessage(
'SENDER_PRESET_TEMPLATE_BTN_PREVIEW')?></a>
170 <?
if(empty($templateListByType[$templateType])):?>
171 <div
class=
"sender-template-list-type-blockempty">
179 <td style=
"vertical-align: top;">
180 <span
class=
"sender-template-btn-close" title=
"<?=Loc::getMessage('SENDER_PRESET_TEMPLATE_BTN_CLOSE')?>"></span>
187 return ob_get_clean();