1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
column.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Grid\Column;
4
5
use Bitrix\Main\ArgumentNullException;
6
use Bitrix\Main\ArgumentTypeException;
7
use Bitrix\Main\Grid\Column\Editable\Config;
8
use Bitrix\Main\Grid\Column\Editable\Factory\ConfigFactory;
9
use Bitrix\Main\Grid\Column\UI\Hint;
10
use Bitrix\Main\Grid\Column\UI\Icon;
11
12
class
Column
13
{
14
use
UI\ColumnFields
;
15
16
protected
string
$id
;
17
protected
string
$type
;
18
protected
?
string
$name
;
19
protected
?
string
$sort
;
20
protected
bool
$default
=
false
;
29
protected
bool
$necessary
=
false
;
37
protected
array
$select
;
38
protected
bool
$multiple
=
false
;
39
protected
?
Config
$editableConfig
=
null
;
40
45
public
function
__construct
(
string
$id
,
array
$params
= [])
46
{
47
$this->
setId
(
$id
);
48
49
$this
50
->setType(
51
empty(
$params
[
'type'
]) ? Type::TEXT :
$params
[
'type'
]
52
)
53
->setName(
$params
[
'name'
] ??
null
)
54
->setSort(
$params
[
'sort'
] ??
null
)
55
->setAlign(
$params
[
'align'
] ??
null
)
56
->setTitle(
$params
[
'title'
] ??
null
)
57
->setWidth(
$params
[
'width'
] ??
null
)
58
->setSection(
$params
[
'section_id'
] ??
null
)
59
->setCssClassName(
$params
[
'class'
] ??
null
)
60
;
61
62
$this->
setSelect
(
$params
[
'select'
] ?? [
$id
]);
63
64
if
(isset(
$params
[
'editable'
]))
65
{
66
$this->
setEditable
(
$params
[
'editable'
]);
67
}
68
69
if
(isset(
$params
[
'first_order'
]))
70
{
71
$this->setFirstOrder(
$params
[
'first_order'
]);
72
}
73
74
if
(isset(
$params
[
'default'
]))
75
{
76
$this->
setDefault
(
$params
[
'default'
]);
77
}
78
79
if
(isset(
$params
[
'necessary'
]))
80
{
81
$this->
setNecessary
(
$params
[
'necessary'
]);
82
}
83
84
if
(isset(
$params
[
'multiple'
]))
85
{
86
$this->
setMultiple
(
$params
[
'multiple'
]);
87
}
88
89
if
(isset(
$params
[
'resizeable'
]))
90
{
91
$this->setResizeable(
$params
[
'resizeable'
]);
92
}
93
94
if
(isset(
$params
[
'prevent_default'
]))
95
{
96
$this->setPreventDefault(
$params
[
'prevent_default'
]);
97
}
98
99
if
(isset(
$params
[
'sticked'
]))
100
{
101
$this->setSticked(
$params
[
'sticked'
]);
102
}
103
104
if
(isset(
$params
[
'shift'
]))
105
{
106
$this->setShift(
$params
[
'shift'
]);
107
}
108
109
if
(isset(
$params
[
'showname'
]))
110
{
111
$this->setShowname(
$params
[
'showname'
]);
112
}
113
114
$color =
$params
[
'color'
] ??
null
;
115
if
(isset($color) && is_string($color))
116
{
117
if
(self::isValidCssColorValue($color))
118
{
119
$this->setCssColorValue($color);
120
}
121
else
122
{
123
$this->setCssColorClassName($color);
124
}
125
}
126
127
if
(isset(
$params
[
'iconUrl'
]))
128
{
129
$this->setIcon(
130
new
Icon
(
131
$params
[
'iconUrl'
],
132
$params
[
'iconTitle'
] ??
null
133
)
134
);
135
}
136
137
if
(isset(
$params
[
'hint'
]))
138
{
139
$hint =
new
Hint
(
$params
[
'hint'
]);
140
141
if
(isset(
$params
[
'hintHtml'
]) && is_bool(
$params
[
'hintHtml'
]))
142
{
143
$hint->
setHtml
(
$params
[
'hintHtml'
]);
144
}
145
146
if
(isset(
$params
[
'hintInteractivity'
]) && is_bool(
$params
[
'hintInteractivity'
]))
147
{
148
$hint->
setInteractivity
(
$params
[
'hintInteractivity'
]);
149
}
150
151
$this->setHint($hint);
152
}
153
}
154
155
public
function
setId
(
string
$id
): self
156
{
157
$id
= trim(
$id
);
158
if
(empty(
$id
))
159
{
160
throw
new
ArgumentNullException
(
'id'
);
161
}
162
163
$this->
id
= $id;
164
165
return
$this;
166
}
167
168
public
function
getId
(): string
169
{
170
return
$this->id;
171
}
172
182
public
function
setType
(
string
$type
): self
183
{
184
$type
= trim(
$type
);
185
if
(empty(
$type
))
186
{
187
throw
new
ArgumentNullException
(
'type'
);
188
}
189
190
$this->type =
$type
;
191
192
return
$this;
193
}
194
195
public
function
getType
(): string
196
{
197
return
$this->type
;
198
}
199
200
public
function
setName
(?
string
$name
): self
201
{
202
$this->name =
$name
;
203
204
return
$this;
205
}
206
207
public
function
getName
(): ?string
208
{
209
return
$this->name
;
210
}
211
212
public
function
setDefault
(
bool
$default
): self
213
{
214
$this->
default
= $default;
215
216
return
$this;
217
}
218
219
public
function
isDefault
(): bool
220
{
221
return
$this->default;
222
}
223
224
public
function
setNecessary
(
bool
$necessary
): self
225
{
226
$this->necessary =
$necessary
;
227
228
return
$this;
229
}
230
236
public
function
isNecessary
(): bool
237
{
238
return
$this->necessary;
239
}
240
246
public
function
setEditable
($value): self
247
{
248
if
(is_bool($value))
249
{
250
if
($value)
251
{
252
$this->editableConfig = (
new
ConfigFactory
)->createFromColumn($this);
253
}
254
else
255
{
256
$this->editableConfig =
null
;
257
}
258
}
259
elseif
($value instanceof
Config
)
260
{
261
$this->editableConfig = $value;
262
}
263
else
264
{
265
throw
new
ArgumentTypeException
(
'editable'
,
'\Bitrix\Main\Grid\Column\Editable\Config|bool'
);
266
}
267
268
return
$this;
269
}
270
271
public
function
getEditable
(): ?
Config
272
{
273
return
$this->editableConfig;
274
}
275
276
public
function
isEditable
(): bool
277
{
278
return
isset($this->editableConfig);
279
}
280
281
public
function
setMultiple
(
bool
$multiple
): self
282
{
283
$this->multiple =
$multiple
;
284
285
return
$this;
286
}
287
288
public
function
isMultiple
(): bool
289
{
290
return
$this->multiple;
291
}
292
293
public
function
setSort
(?
string
$sort
): self
294
{
295
$this->sort =
$sort
;
296
297
return
$this;
298
}
299
300
public
function
getSort
(): ?string
301
{
302
return
$this->sort;
303
}
304
305
public
function
setSelect
(
array
$select
): self
306
{
307
$this->
select
=
$select
;
308
309
return
$this;
310
}
311
312
public
function
getSelect
():
array
313
{
314
return
$this->select
;
315
}
316
}
select
return select
Определения
access_edit.php:440
$type
$type
Определения
options.php:106
Bitrix\Main\ArgumentNullException
Определения
ArgumentNullException.php:9
Bitrix\Main\ArgumentTypeException
Определения
ArgumentTypeException.php:9
Bitrix\Main\Grid\Column\Column\isDefault
isDefault()
Определения
column.php:219
Bitrix\Main\Grid\Column\Column\getId
getId()
Определения
column.php:168
Bitrix\Main\Grid\Column\Column\$select
array $select
Определения
column.php:37
Bitrix\Main\Grid\Column\Column\setDefault
setDefault(bool $default)
Определения
column.php:212
Bitrix\Main\Grid\Column\Column\$sort
string $sort
Определения
column.php:19
Bitrix\Main\Grid\Column\Column\getName
getName()
Определения
column.php:207
Bitrix\Main\Grid\Column\Column\$id
string $id
Определения
column.php:16
Bitrix\Main\Grid\Column\Column\isEditable
isEditable()
Определения
column.php:276
Bitrix\Main\Grid\Column\Column\setEditable
setEditable($value)
Определения
column.php:246
Bitrix\Main\Grid\Column\Column\setNecessary
setNecessary(bool $necessary)
Определения
column.php:224
Bitrix\Main\Grid\Column\Column\$name
string $name
Определения
column.php:18
Bitrix\Main\Grid\Column\Column\$default
bool $default
Определения
column.php:20
Bitrix\Main\Grid\Column\Column\setMultiple
setMultiple(bool $multiple)
Определения
column.php:281
Bitrix\Main\Grid\Column\Column\setSelect
setSelect(array $select)
Определения
column.php:305
Bitrix\Main\Grid\Column\Column\isNecessary
isNecessary()
Определения
column.php:236
Bitrix\Main\Grid\Column\Column\getType
getType()
Определения
column.php:195
Bitrix\Main\Grid\Column\Column\getEditable
getEditable()
Определения
column.php:271
Bitrix\Main\Grid\Column\Column\getSelect
getSelect()
Определения
column.php:312
Bitrix\Main\Grid\Column\Column\setName
setName(?string $name)
Определения
column.php:200
Bitrix\Main\Grid\Column\Column\getSort
getSort()
Определения
column.php:300
Bitrix\Main\Grid\Column\Column\setSort
setSort(?string $sort)
Определения
column.php:293
Bitrix\Main\Grid\Column\Column\$type
string $type
Определения
column.php:17
Bitrix\Main\Grid\Column\Column\$necessary
bool $necessary
Определения
column.php:29
Bitrix\Main\Grid\Column\Column\isMultiple
isMultiple()
Определения
column.php:288
Bitrix\Main\Grid\Column\Column\$multiple
bool $multiple
Определения
column.php:38
Bitrix\Main\Grid\Column\Column\__construct
__construct(string $id, array $params=[])
Определения
column.php:45
Bitrix\Main\Grid\Column\Column\$editableConfig
Config $editableConfig
Определения
column.php:39
Bitrix\Main\Grid\Column\Column\setType
setType(string $type)
Определения
column.php:182
Bitrix\Main\Grid\Column\Column\setId
setId(string $id)
Определения
column.php:155
Bitrix\Main\Grid\Column\Editable\Factory\ConfigFactory
Определения
configfactory.php:15
Bitrix\Main\Grid\Column\UI\Hint
Определения
hint.php:11
Bitrix\Main\Grid\Column\UI\Hint\setHtml
setHtml(bool $value)
Определения
hint.php:59
Bitrix\Main\Grid\Column\UI\Hint\setInteractivity
setInteractivity(bool $value)
Определения
hint.php:85
Bitrix\Main\Grid\Column\UI\Icon
Определения
icon.php:11
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$select
$select
Определения
iblock_catalog_list.php:194
$name
$name
Определения
menu_edit.php:35
Bitrix\Main\Config
Определения
configuration.php:3
Bitrix\Main\Grid\Column\UI\ColumnFields
trait ColumnFields
Определения
columnfields.php:11
Bitrix\Main\Grid\Column
Определения
color.php:3
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
main
lib
grid
column
column.php
Создано системой
1.14.0