1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
configcomponent.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\UserField;
4
5
use Bitrix\Main\Application;
6
use Bitrix\Main\Error;
7
use Bitrix\Main\ErrorCollection;
8
use Bitrix\Main\Localization\Loc;
9
10
abstract
class
ConfigComponent
extends
\CBitrixComponent
11
{
12
public
const
ERROR_CODE_NO_MODULE_ERROR
=
'UF_CONFIG_NO_MODULE'
;
13
15
protected
$access
;
16
protected
$entityId
=
''
;
17
protected
$moduleId
;
19
protected
$errorCollection
;
20
protected
$userTypes
;
21
22
protected
function
init
(): void
23
{
24
$this->errorCollection =
new
ErrorCollection
();
25
26
$request
=
Application::getInstance
()->getContext()->getRequest();
27
$this->entityId = !empty($this->arParams[
'entityId'
]) ? $this->arParams[
'entityId'
] :
$request
->get(
'entityId'
);
28
$this->moduleId = !empty($this->arParams[
'moduleId'
]) ? $this->arParams[
'moduleId'
] :
$request
->get(
'moduleId'
);
29
30
if
(!$this->moduleId)
31
{
32
$this->errorCollection[] = $this->
getNoModuleError
();
33
return
;
34
}
35
$this->access =
UserFieldAccess::getInstance
($this->moduleId);
36
}
37
38
protected
function
getNoModuleError
():
Error
39
{
40
return
new
Error
(Loc::getMessage(
'MAIN_USER_FIELD_CONFIG_COMPONENT_NO_MODULE_ERROR'
), static::ERROR_CODE_NO_MODULE_ERROR);
41
}
42
43
protected
function
getAccessDeniedError
():
Error
44
{
45
return
new
Error
(Loc::getMessage(
'MAIN_USER_FIELD_CONFIG_COMPONENT_ACCESS_DENIED_ERROR'
), static::ERROR_CODE_NO_MODULE_ERROR);
46
}
47
48
protected
function
getUserTypes
():
array
49
{
50
if
(!$this->userTypes)
51
{
52
global
$USER_FIELD_MANAGER
;
53
$this->userTypes =
$USER_FIELD_MANAGER
->GetUserType();
54
$restrictedTypes = $this->access->getRestrictedTypes();
55
foreach
($restrictedTypes as $typeId)
56
{
57
unset($this->userTypes[$typeId]);
58
}
59
}
60
61
return
$this->userTypes
;
62
}
63
64
protected
function
setTitle
(
string
$title
): void
65
{
66
global
$APPLICATION
;
67
68
$APPLICATION
->SetTitle(
$title
);
69
}
70
}
$APPLICATION
global $APPLICATION
Определения
include.php:80
Bitrix\Main\Application\getInstance
static getInstance()
Определения
application.php:98
Bitrix\Main\ErrorCollection
Определения
errorcollection.php:14
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\UserField\ConfigComponent
Определения
configcomponent.php:11
Bitrix\Main\UserField\ConfigComponent\getAccessDeniedError
getAccessDeniedError()
Определения
configcomponent.php:43
Bitrix\Main\UserField\ConfigComponent\init
init()
Определения
configcomponent.php:22
Bitrix\Main\UserField\ConfigComponent\$errorCollection
$errorCollection
Определения
configcomponent.php:19
Bitrix\Main\UserField\ConfigComponent\setTitle
setTitle(string $title)
Определения
configcomponent.php:64
Bitrix\Main\UserField\ConfigComponent\getUserTypes
getUserTypes()
Определения
configcomponent.php:48
Bitrix\Main\UserField\ConfigComponent\$userTypes
$userTypes
Определения
configcomponent.php:20
Bitrix\Main\UserField\ConfigComponent\getNoModuleError
getNoModuleError()
Определения
configcomponent.php:38
Bitrix\Main\UserField\ConfigComponent\$moduleId
$moduleId
Определения
configcomponent.php:17
Bitrix\Main\UserField\ConfigComponent\$access
$access
Определения
configcomponent.php:15
Bitrix\Main\UserField\ConfigComponent\$entityId
$entityId
Определения
configcomponent.php:16
Bitrix\Main\UserField\ConfigComponent\ERROR_CODE_NO_MODULE_ERROR
const ERROR_CODE_NO_MODULE_ERROR
Определения
configcomponent.php:12
Bitrix\Main\UserField\UserFieldAccess\getInstance
static getInstance(string $moduleId, int $userId=null)
Определения
userfieldaccess.php:28
CBitrixComponent\$request
$request
Определения
component.php:65
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$USER_FIELD_MANAGER
global $USER_FIELD_MANAGER
Определения
attempt.php:6
$title
$title
Определения
pdf.php:123
bitrix
modules
main
lib
userfield
configcomponent.php
Создано системой
1.14.0