Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
collection.php
1<?php
2
4
6
8{
9 public const TEMPLATE_PLAIN = 'plain';
10 public const TEMPLATE_NEWS = 'news';
11 public const TEMPLATE_NOTIFY = 'notify';
12 public const TEMPLATE_IMPORTANT = 'important';
13 public const TEMPLATE_ALERT = 'alert';
14
15 public static function getTemplateList(): array
16 {
17 return [
18 static::TEMPLATE_PLAIN => Loc::getMessage('IM_BIZPROC_MESSAGE_COLLECTION_PlAIN'),
19 static::TEMPLATE_NEWS => Loc::getMessage('IM_BIZPROC_MESSAGE_COLLECTION_NEWS'),
20 static::TEMPLATE_NOTIFY => Loc::getMessage('IM_BIZPROC_MESSAGE_COLLECTION_NOTIFY'),
21 static::TEMPLATE_IMPORTANT => Loc::getMessage('IM_BIZPROC_MESSAGE_COLLECTION_IMPORTANT'),
22 static::TEMPLATE_ALERT => Loc::getMessage('IM_BIZPROC_MESSAGE_COLLECTION_ALERT'),
23 ];
24 }
25
26 public static function makeTemplate(string $type): Template
27 {
28 return match ($type)
29 {
30 static::TEMPLATE_NEWS => new NewsTemplate(),
31 static::TEMPLATE_NOTIFY => new NotifyTemplate(),
32 static::TEMPLATE_IMPORTANT => new ImportantTemplate(),
33 static::TEMPLATE_ALERT => new AlertTemplate(),
34 default => new PlainTemplate(),
35 };
36 }
37}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29