Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
link.php
1
<?php
2
3
4
namespace
Bitrix\Sale\Exchange\Integration\Admin
;
5
6
7
class
Link
8
{
9
private
static
$instance =
null
;
10
protected
$type
;
11
12
public
function
__construct
()
13
{
14
$this->type = static::resolveModeType();
15
}
16
17
public
function
getType
()
18
{
19
return
$this->type
;
20
}
21
22
protected
function
resolveModeType
()
23
{
24
$fields = new \Bitrix\Sale\Internals\Fields(
25
\
Bitrix
\Main\
Context::getCurrent
()->getRequest()->toArray());
26
27
if
($this->
isRestAppLayoutMode
($fields))
28
{
29
$type
=
ModeType::APP_LAYOUT_TYPE
;
30
}
31
else
32
{
33
$type
=
ModeType::DEFAULT_TYPE
;
34
}
35
36
return
$type
;
37
}
38
39
protected
function
isRestAppLayoutMode
(\
Bitrix
\
Sale
\Internals\
Fields
$fields)
40
{
41
return
$fields->get(
'restAppLayoutMode'
) ==
'Y'
;
42
}
43
44
public
function
create
()
45
{
46
return
Factory::create
($this->
getType
());
47
}
48
49
public
static
function
getInstance
()
50
{
51
if
(self::$instance ===
null
)
52
{
53
self::$instance =
new
static
();
54
}
55
return
self::$instance;
56
}
57
}
Bitrix\Main\Context\getCurrent
static getCurrent()
Definition
context.php:241
Bitrix\Sale\Exchange\Integration\Admin\Factory\create
static create($type)
Definition
factory.php:7
Bitrix\Sale\Exchange\Integration\Admin\Link
Definition
link.php:8
Bitrix\Sale\Exchange\Integration\Admin\Link\__construct
__construct()
Definition
link.php:12
Bitrix\Sale\Exchange\Integration\Admin\Link\create
create()
Definition
link.php:44
Bitrix\Sale\Exchange\Integration\Admin\Link\resolveModeType
resolveModeType()
Definition
link.php:22
Bitrix\Sale\Exchange\Integration\Admin\Link\getType
getType()
Definition
link.php:17
Bitrix\Sale\Exchange\Integration\Admin\Link\$type
$type
Definition
link.php:10
Bitrix\Sale\Exchange\Integration\Admin\Link\getInstance
static getInstance()
Definition
link.php:49
Bitrix\Sale\Exchange\Integration\Admin\Link\isRestAppLayoutMode
isRestAppLayoutMode(\Bitrix\Sale\Internals\Fields $fields)
Definition
link.php:39
Bitrix\Sale\Exchange\Integration\Admin\ModeType\APP_LAYOUT_TYPE
const APP_LAYOUT_TYPE
Definition
modetype.php:7
Bitrix\Sale\Exchange\Integration\Admin\ModeType\DEFAULT_TYPE
const DEFAULT_TYPE
Definition
modetype.php:6
Bitrix\Sale\Internals\Fields
Definition
fields.php:6
Bitrix\Sale\Exchange\Integration\Admin
Definition
applayoutlink.php:2
Bitrix
Sale
modules
sale
lib
exchange
integration
admin
link.php
Создано системой
1.10.0