Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
blockcontent.php
1<?
9
11
12Loc::loadMessages(__FILE__);
13
15{
16 CONST TYPE_STYLES = 'STYLES';
17 CONST TYPE_BLOCKS = 'BLOCKS';
18
19 protected $list = array();
20
21 public function __construct()
22 {
23
24 }
25
26 public function add($type, $place, $value)
27 {
28 $this->list[] = array(
29 'type' => $type,
30 'place' => $place,
31 'value' => $value,
32 );
33 }
34
35 public function getStyles()
36 {
37 return $this->filterListByType(self::TYPE_STYLES);
38 }
39
40 public function getBlocks()
41 {
42 return $this->filterListByType(self::TYPE_BLOCKS);
43 }
44
45 public function setList(array $list)
46 {
47 $this->list = [];
48 foreach ($list as $item)
49 {
50 $this->add($item['type'], $item['place'], $item['value']);
51 }
52
53 return $this;
54 }
55
56 public function getList()
57 {
58 return $this->list;
59 }
60
61 protected function filterListByType($type)
62 {
63 $result = array();
64 foreach ($this->list as $item)
65 {
66 if ($item['type'] != $type)
67 {
68 continue;
69 }
70
71 //$result[$item['code']] = $item['value'];
72 $result[] = $item;
73 }
74
75 return $result;
76 }
77}
static loadMessages($file)
Definition loc.php:64