1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
groupaction.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Grid\Panel\Action;
4
5
use Bitrix\Main\Filter\Filter;
6
use Bitrix\Main\Grid\Panel\Action\Group\GroupChildAction;
7
use Bitrix\Main\Grid\Panel\Actions;
8
use Bitrix\Main\Grid\Panel\Types;
9
use Bitrix\Main\HttpRequest;
10
use Bitrix\Main\Localization\Loc;
11
use Bitrix\Main\Result;
12
13
abstract
class
GroupAction
implements
Action
14
{
18
private
array
$items;
19
25
final
public
static
function
getId
(): string
26
{
27
return
'group_action'
;
28
}
29
33
abstract
protected
function
prepareChildItems
():
array
;
34
40
private
function
getChildItems():
array
41
{
42
$this->items ??= $this->
prepareChildItems
();
43
44
return
$this->items
;
45
}
46
50
public
function
getControl
(): ?
array
51
{
52
$items = $this->getGroupDropdownItems();
53
if
(empty($items))
54
{
55
return
null
;
56
}
57
58
return
[
59
'TYPE'
=>
Types::DROPDOWN
,
60
'ID'
=> static::getId(),
61
'NAME'
=> static::getId(),
62
'ITEMS'
=> [
63
[
64
'NAME'
=> Loc::getMessage(
'MAIN_GRID_PANEL_GROUP_ACTIONS_ITEM_PLACEHOLDER'
),
65
'VALUE'
=>
'default'
,
66
'ONCHANGE'
=> [
67
[
68
'ACTION'
=>
Actions::RESET_CONTROLS
,
69
],
70
],
71
],
72
... $items,
73
],
74
];
75
}
76
82
private
function
getGroupDropdownItems():
array
83
{
84
$result
= [];
85
86
foreach
($this->getChildItems() as $item)
87
{
88
$result
[] = $item->getDropdownItem();
89
}
90
91
return
$result
;
92
}
93
97
final
public
function
processRequest
(
HttpRequest
$request
,
bool
$isSelectedAllRows, ?
Filter
$filter
): ?
Result
98
{
99
$controls =
$request
->getPost(
'controls'
);
100
$itemId = (string)($controls[static::getId()] ??
''
);
101
if
(empty($itemId))
102
{
103
return
null
;
104
}
105
106
foreach
($this->getChildItems() as $item)
107
{
108
if
($item::getId() === $itemId)
109
{
110
return
$item->processRequest(
$request
, $isSelectedAllRows,
$filter
);
111
}
112
}
113
114
return
null
;
115
}
116
}
$request
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения
catalog_reindex.php:36
Bitrix\Main\Grid\Panel\Action\GroupAction
Определения
groupaction.php:14
Bitrix\Main\Grid\Panel\Action\GroupAction\prepareChildItems
prepareChildItems()
Bitrix\Main\Grid\Panel\Action\GroupAction\processRequest
processRequest(HttpRequest $request, bool $isSelectedAllRows, ?Filter $filter)
Определения
groupaction.php:97
Bitrix\Main\Grid\Panel\Action\GroupAction\getControl
getControl()
Определения
groupaction.php:50
Bitrix\Main\Grid\Panel\Action\GroupAction\getId
static getId()
Определения
groupaction.php:25
Bitrix\Main\Grid\Panel\Actions\RESET_CONTROLS
const RESET_CONTROLS
Определения
actions.php:24
Bitrix\Main\Grid\Panel\Types\DROPDOWN
const DROPDOWN
Определения
types.php:13
Bitrix\Main\HttpRequest
Определения
httprequest.php:20
Bitrix\Main\ORM\Data\Result
Определения
result.php:16
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$filter
$filter
Определения
iblock_catalog_list.php:54
Bitrix\Main\Grid\Panel\Action\Action
Определения
action.php:18
Bitrix\Main\Filter
$items
$items
Определения
template.php:224
bitrix
modules
main
lib
grid
panel
action
groupaction.php
Создано системой
1.14.0