33 if($templateType && $templateType !==
'BASE')
37 if($messageCode && !in_array($messageCode, self::getProvidedMessageCodes()))
42 return self::getTemplates($templateId, $messageCode =
null);
45 private static function getProvidedMessageCodes()
54 private static function getTemplates($templateId =
null, $messageCode =
null)
56 $messageCodes = $messageCode ? array($messageCode) : self::getProvidedMessageCodes();
59 foreach ($messageCodes as $messageCode)
61 $textMessageCode = $messageCode;
62 if ($messageCode ===
Message\iBase::CODE_CALL)
64 $textMessageCode = Message\iBase::CODE_SMS;
67 foreach (Texts::getListByType($textMessageCode) as $item)
69 $code = mb_strtolower($messageCode.
"_".$item[
'CODE']);
70 if($templateId && $code !== $templateId)
78 'MESSAGE_CODE' => array($messageCode),
80 'HOT' => $item[
'HOT'],
81 'ICON' => $item[
'ICON'],
83 'NAME' => $item[
'NAME'],
84 'DESC' => $item[
'DESC'],
86 'MESSAGE_TEXT' => array(
87 'CODE' =>
'MESSAGE_TEXT',
88 'VALUE' => $item[
'TEXT'],
static loadMessages($file)