Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
blockcontent.php
1
<?
8
namespace
Bitrix\Fileman\Block\Content
;
9
10
use
Bitrix\Main\Localization\Loc
;
11
12
Loc::loadMessages
(__FILE__);
13
14
class
BlockContent
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
}
Bitrix\Fileman\Block\Content\BlockContent
Definition
blockcontent.php:15
Bitrix\Fileman\Block\Content\BlockContent\__construct
__construct()
Definition
blockcontent.php:21
Bitrix\Fileman\Block\Content\BlockContent\getBlocks
getBlocks()
Definition
blockcontent.php:40
Bitrix\Fileman\Block\Content\BlockContent\TYPE_STYLES
CONST TYPE_STYLES
Definition
blockcontent.php:16
Bitrix\Fileman\Block\Content\BlockContent\getStyles
getStyles()
Definition
blockcontent.php:35
Bitrix\Fileman\Block\Content\BlockContent\$list
$list
Definition
blockcontent.php:19
Bitrix\Fileman\Block\Content\BlockContent\getList
getList()
Definition
blockcontent.php:56
Bitrix\Fileman\Block\Content\BlockContent\add
add($type, $place, $value)
Definition
blockcontent.php:26
Bitrix\Fileman\Block\Content\BlockContent\filterListByType
filterListByType($type)
Definition
blockcontent.php:61
Bitrix\Fileman\Block\Content\BlockContent\TYPE_BLOCKS
CONST TYPE_BLOCKS
Definition
blockcontent.php:17
Bitrix\Fileman\Block\Content\BlockContent\setList
setList(array $list)
Definition
blockcontent.php:45
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Fileman\Block\Content
Definition
blockcontent.php:8
modules
fileman
lib
block
content
blockcontent.php
Создано системой
1.10.0