Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
userfieldaccess.php
1
<?php
2
3
namespace
Bitrix\Catalog\UserField
;
4
5
use
Bitrix\Catalog\Controller\Controller
;
6
use
Bitrix\Catalog\Document\StoreDocumentTableManager
;
7
use
Bitrix\Catalog\StoreTable
;
8
use
Bitrix\Main\Loader
;
9
10
class
UserFieldAccess
extends
\Bitrix\Main\UserField\UserFieldAccess
11
{
12
protected
function
getAvailableEntityIds
(): array
13
{
14
$iblockEntities = array_map(fn($item):
string
=>
'IBLOCK_'
. $item .
'_SECTION'
, static::getIBlockList());
15
$storeDocsEntities = array_values(StoreDocumentTableManager::getUfEntityIds());
16
17
return
[
18
...$iblockEntities,
19
...$storeDocsEntities,
20
StoreTable::getUfId
(),
21
];
22
}
23
24
protected
static
function
getIBlockList
(): array
25
{
26
Loader::includeModule(
'catalog'
);
27
Loader::includeModule(
'iblock'
);
28
29
$list = [];
30
$filter = [];
31
32
$r = \CCatalog::GetList();
33
while
($l = $r->fetch())
34
{
35
$filter[
'ID'
] ??= [];
36
$filter[
'ID'
][] = $l[
'IBLOCK_ID'
];
37
}
38
39
$filter[
'ACTIVE'
] =
'Y'
;
40
$filter[
'OPERATION'
] = Controller::IBLOCK_EDIT;
41
42
$iterator = \CIBlock::GetList([
'ID'
=>
'ASC'
], $filter);
43
while
($iblock = $iterator->Fetch())
44
{
45
$list[] = (int)$iblock[
'ID'
];
46
}
47
48
return
$list;
49
}
50
51
public
function
getRestrictedTypes
(): array
52
{
53
return
array_merge(
54
parent::getRestrictedTypes(),
55
[
56
'video'
,
57
'vote'
,
58
'url_preview'
,
59
'string_formatted'
,
60
'disk_file'
,
61
'disk_version'
,
62
]
63
);
64
}
65
}
Bitrix\Catalog\Controller\Controller
Definition
controller.php:19
Bitrix\Catalog\Document\StoreDocumentTableManager
Definition
storedocumenttablemanager.php:14
Bitrix\Catalog\StoreTable
Definition
store.php:55
Bitrix\Catalog\StoreTable\getUfId
static getUfId()
Definition
store.php:263
Bitrix\Catalog\UserField\UserFieldAccess
Definition
userfieldaccess.php:11
Bitrix\Catalog\UserField\UserFieldAccess\getRestrictedTypes
getRestrictedTypes()
Definition
userfieldaccess.php:51
Bitrix\Catalog\UserField\UserFieldAccess\getAvailableEntityIds
getAvailableEntityIds()
Definition
userfieldaccess.php:12
Bitrix\Catalog\UserField\UserFieldAccess\getIBlockList
static getIBlockList()
Definition
userfieldaccess.php:24
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\UserField\UserFieldAccess
Definition
userfieldaccess.php:12
Bitrix\Catalog\UserField
Definition
userfieldaccess.php:3
modules
catalog
lib
userfield
userfieldaccess.php
Создано системой
1.10.0