1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
type.php
См. документацию.
1
<?php
2
namespace
Bitrix\Landing\Node;
3
4
class
Type
5
{
6
const
COMPONENT
=
'component'
;
7
const
MEDIA
=
'embed'
;
8
const
ICON
=
'icon'
;
9
const
IMAGE
=
'img'
;
10
const
LINK
=
'link'
;
11
const
MAP
=
'map'
;
12
const
TEXT
=
'text'
;
13
const
STYLE_IMAGE
=
'styleimg'
;
14
15
protected
static
$classes
= [];
16
22
public
static
function
getClassName(
string
$type
): string
23
{
24
$type
= mb_strtolower(
$type
);
25
26
if
(
$type
===
''
||
$type
===
'type'
)
27
{
28
throw
new \Bitrix\Main\ArgumentTypeException(
29
'Invalid node type'
30
);
31
}
32
33
if
(isset(self::$classes[
$type
]))
34
{
35
return
self::$classes[
$type
];
36
}
37
38
$class = __NAMESPACE__ .
'\\'
.
$type
;
39
40
// check custom classes
41
$event
= new \Bitrix\Main\Event(
42
'landing'
,
43
'onGetNodeClass'
,
44
[
45
'type'
=>
$type
46
]
47
);
48
$event
->send();
50
foreach
(
$event
->getResults() as
$result
)
51
{
52
if
(
$result
->getType() != \
Bitrix
\
Main
\EventResult::ERROR)
53
{
54
if
(
55
($modified =
$result
->getModified()) &&
56
isset($modified[
'class'
]) &&
57
is_subclass_of($modified[
'class'
],
'\\Bitrix\\Landing\\Node'
)
58
)
59
{
60
$class = $modified[
'class'
];
61
}
62
}
63
}
64
65
self::$classes[
$type
] = $class;
66
67
return
self::$classes[
$type
];
68
}
69
}
$type
$type
Определения
options.php:106
Bitrix\Landing\Node\Type\MAP
const MAP
Определения
type.php:11
Bitrix\Landing\Node\Type\MEDIA
const MEDIA
Определения
type.php:7
Bitrix\Landing\Node\Type\ICON
const ICON
Определения
type.php:8
Bitrix\Landing\Node\Type\$classes
static $classes
Определения
type.php:15
Bitrix\Landing\Node\Type\TEXT
const TEXT
Определения
type.php:12
Bitrix\Landing\Node\Type\STYLE_IMAGE
const STYLE_IMAGE
Определения
type.php:13
Bitrix\Landing\Node\Type\COMPONENT
const COMPONENT
Определения
type.php:6
Bitrix\Landing\Node\Type\LINK
const LINK
Определения
type.php:10
Bitrix\Landing\Node\Type\IMAGE
const IMAGE
Определения
type.php:9
$result
$result
Определения
get_property_values.php:14
Bitrix\Main\Type
Определения
collection.php:2
Bitrix\Main
Bitrix
$event
$event
Определения
prolog_after.php:141
bitrix
modules
landing
lib
node
type.php
Создано системой
1.14.0