Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
base.php
1<?php
2
4
6
11abstract class Base
12{
13 protected const CACHE_TIME = 86400;
14 private const POSTFIX_MESSAGE_CODE = '.MESSAGE_CODE';
15
22 protected static function changeMessage($data)
23 {
24 if (is_array($data))
25 {
26 foreach ($data as $key => $value)
27 {
28 if (is_array($value))
29 {
30 $data[$key] = static::changeMessage($value);
31 }
32 elseif (mb_strpos($key, self::POSTFIX_MESSAGE_CODE) !== false)
33 {
34 [$code] = explode(self::POSTFIX_MESSAGE_CODE, $key, 2);
35 $message = Loc::getMessage($value);
36 if (!empty($message))
37 {
38 $data[$code] = $message;
39 }
40 }
41 }
42 }
43
44 return $data;
45 }
46}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static changeMessage($data)
Definition base.php:22