Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
intranetbindingmenu.php
1
<?php
2
3
namespace
Bitrix\UI\Buttons
;
4
5
use
Bitrix\Main\Loader
;
6
7
class
IntranetBindingMenu
extends
Button
8
{
9
protected
$componentParameters
= [];
10
protected
$content
;
11
12
public
static
function
isAvailable
(): bool
13
{
14
return
Loader::includeModule(
'intranet'
);
15
}
16
17
public
static
function
createByComponentParameters
(array $parameters): ?self
18
{
19
if
(!static::isAvailable())
20
{
21
return
null
;
22
}
23
24
return
new
static
([
25
'componentParameters'
=> $parameters,
26
]);
27
}
28
29
protected
function
init
(array $params = [])
30
{
31
$this->componentParameters = $params[
'componentParameters'
] ?? [];
32
33
$this->content = $this->
preRender
();
34
}
35
36
protected
function
preRender
(): string
37
{
38
$result =
''
;
39
40
if
(empty($this->componentParameters))
41
{
42
return
$result;
43
}
44
45
global $APPLICATION;
46
ob_start();
47
$APPLICATION->IncludeComponent(
48
'bitrix:intranet.binding.menu'
,
49
''
,
50
$this->componentParameters
51
);
52
$result = ob_get_contents();
53
ob_end_clean();
54
55
return
$result;
56
}
57
58
public
function
render
($jsInit =
true
): string
59
{
60
return
$this->content
;
61
}
62
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\UI\Buttons\Button
Definition
button.php:6
Bitrix\UI\Buttons\IntranetBindingMenu
Definition
intranetbindingmenu.php:8
Bitrix\UI\Buttons\IntranetBindingMenu\createByComponentParameters
static createByComponentParameters(array $parameters)
Definition
intranetbindingmenu.php:17
Bitrix\UI\Buttons\IntranetBindingMenu\$content
$content
Definition
intranetbindingmenu.php:10
Bitrix\UI\Buttons\IntranetBindingMenu\isAvailable
static isAvailable()
Definition
intranetbindingmenu.php:12
Bitrix\UI\Buttons\IntranetBindingMenu\render
render($jsInit=true)
Definition
intranetbindingmenu.php:58
Bitrix\UI\Buttons\IntranetBindingMenu\$componentParameters
$componentParameters
Definition
intranetbindingmenu.php:9
Bitrix\UI\Buttons\IntranetBindingMenu\preRender
preRender()
Definition
intranetbindingmenu.php:36
Bitrix\UI\Buttons\IntranetBindingMenu\init
init(array $params=[])
Definition
intranetbindingmenu.php:29
Bitrix\UI\Buttons
Definition
addbutton.php:3
modules
ui
lib
buttons
intranetbindingmenu.php
Создано системой
1.10.0