Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
display.php
1
<?php
2
7
namespace
Bitrix\Main\UserField
;
8
9
use
Bitrix\Main\UserField\Types\BaseType
;
10
11
class
Display
implements
IDisplay
12
{
13
const
MODE_EDIT
= BaseType::MODE_EDIT;
14
const
MODE_VIEW
= BaseType::MODE_VIEW;
15
16
protected
$userField
;
17
protected
$additionalParameters
= array();
18
protected
$defaultAdditionalParameters
= array(
19
"bVarsFromForm"
=>
false
,
20
);
21
protected
$mode
=
self::MODE_VIEW
;
22
protected
$tpl
=
''
;
23
24
public
function
__construct
(
$mode
= self::MODE_VIEW,
string
$tpl
=
''
)
25
{
26
$this->mode =
$mode
;
27
$this->tpl =
$tpl
;
28
$this->additionalParameters =
$this->defaultAdditionalParameters
;
29
}
30
34
public
function
getField
()
35
{
36
return
$this->userField
;
37
}
38
42
public
function
setField
(array
$userField
)
43
{
44
$this->userField =
$userField
;
45
}
46
47
public
function
setAdditionalParameter
($param, $value, $storeAsDefault =
false
)
48
{
49
$this->additionalParameters[$param] = $value;
50
if
($storeAsDefault)
51
{
52
$this->defaultAdditionalParameters[$param] = $value;
53
}
54
}
55
56
public
function
clear
()
57
{
58
$this->userField =
null
;
59
$this->additionalParameters =
$this->defaultAdditionalParameters
;
60
}
61
62
protected
function
getAdditionalParameters
()
63
{
64
return
$this->additionalParameters
;
65
}
66
67
public
function
display
()
68
{
69
global $USER_FIELD_MANAGER;
70
71
$this->
setAdditionalParameter
(
'mode'
, $this->mode);
72
//$this->setAdditionalParameter('tpl', $this->tpl);
73
74
if
($this->mode === self::MODE_EDIT)
75
{
76
return
$USER_FIELD_MANAGER->GetPublicEdit(
77
$this->
getField
(),
78
$this->
getAdditionalParameters
()
79
);
80
}
81
else
82
{
83
return
$USER_FIELD_MANAGER->GetPublicView(
84
$this->
getField
(),
85
$this->
getAdditionalParameters
()
86
);
87
}
88
}
89
}
Bitrix\Main\UserField\Display
Definition
display.php:12
Bitrix\Main\UserField\Display\$tpl
$tpl
Definition
display.php:22
Bitrix\Main\UserField\Display\$userField
$userField
Definition
display.php:16
Bitrix\Main\UserField\Display\display
display()
Definition
display.php:67
Bitrix\Main\UserField\Display\__construct
__construct($mode=self::MODE_VIEW, string $tpl='')
Definition
display.php:24
Bitrix\Main\UserField\Display\$mode
$mode
Definition
display.php:21
Bitrix\Main\UserField\Display\setField
setField(array $userField)
Definition
display.php:42
Bitrix\Main\UserField\Display\$defaultAdditionalParameters
$defaultAdditionalParameters
Definition
display.php:18
Bitrix\Main\UserField\Display\getField
getField()
Definition
display.php:34
Bitrix\Main\UserField\Display\$additionalParameters
$additionalParameters
Definition
display.php:17
Bitrix\Main\UserField\Display\setAdditionalParameter
setAdditionalParameter($param, $value, $storeAsDefault=false)
Definition
display.php:47
Bitrix\Main\UserField\Display\MODE_EDIT
const MODE_EDIT
Definition
display.php:13
Bitrix\Main\UserField\Display\clear
clear()
Definition
display.php:56
Bitrix\Main\UserField\Display\MODE_VIEW
const MODE_VIEW
Definition
display.php:14
Bitrix\Main\UserField\Display\getAdditionalParameters
getAdditionalParameters()
Definition
display.php:62
Bitrix\Main\UserField\Types\BaseType
Definition
basetype.php:6
Bitrix\Main\UserField\IDisplay
Definition
idisplay.php:6
Bitrix\Main\UserField
modules
main
lib
userfield
display.php
Создано системой
1.10.0