Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
toolavailabilitymanager.php
1
<?php
2
3
namespace
Bitrix\Landing\Restriction
;
4
5
use Bitrix\Intranet\Settings\Tools\ToolsManager;
6
use
Bitrix\Main\Loader
;
7
8
9
class
ToolAvailabilityManager
10
{
11
private
bool
$canUseIntranetToolsManager;
12
13
public
function
__construct
()
14
{
15
$this->canUseIntranetToolsManager = (
16
Loader::includeModule(
'intranet'
)
17
&& class_exists(
'\Bitrix\Intranet\Settings\Tools\ToolsManager'
)
18
);
19
}
20
21
public
static
function
getInstance
(): self
22
{
23
return
new
self
();
24
}
25
26
public
function
check
(
string
$toolId): bool
27
{
28
if
($this->canUseIntranetToolsManager)
29
{
30
return
ToolsManager::getInstance()->checkAvailabilityByToolId($toolId);
31
}
32
33
return
true
;
34
}
35
36
public
function
getStubComponentContent
(
string
$sliderCode): string
37
{
38
$params = [];
39
40
if
(!empty($sliderCode))
41
{
42
$params[
'SLIDER_CODE'
] = $sliderCode;
43
}
44
45
ob_start();
46
global $APPLICATION;
47
$APPLICATION->IncludeComponent(
48
'bitrix:intranet.tool.inaccessibility'
,
49
''
,
50
$params,
51
null
,
52
[
'HIDE_ICONS'
=>
'Y'
],
53
);
54
55
return
ob_get_clean();
56
}
57
}
Bitrix\Landing\Restriction\ToolAvailabilityManager
Definition
toolavailabilitymanager.php:10
Bitrix\Landing\Restriction\ToolAvailabilityManager\__construct
__construct()
Definition
toolavailabilitymanager.php:13
Bitrix\Landing\Restriction\ToolAvailabilityManager\getInstance
static getInstance()
Definition
toolavailabilitymanager.php:21
Bitrix\Landing\Restriction\ToolAvailabilityManager\getStubComponentContent
getStubComponentContent(string $sliderCode)
Definition
toolavailabilitymanager.php:36
Bitrix\Landing\Restriction\ToolAvailabilityManager\check
check(string $toolId)
Definition
toolavailabilitymanager.php:26
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Landing\Restriction
Definition
block.php:2
modules
landing
lib
restriction
toolavailabilitymanager.php
Создано системой
1.10.0