- Модуль: iblock
- Путь к файлу: ~/bitrix/modules/iblock/lib/grid/panel/groupaction.php
- Класс: BitrixIblockGridPanelGroupAction
- Вызов: GroupAction::getApplyButtonWithConfirm
public function getApplyButtonWithConfirm(array $params): array
{
$confirmMessage = null;
if (
isset($params['CONFIRM_MESSAGE'])
&& is_string($params['CONFIRM_MESSAGE'])
&& $params['CONFIRM_MESSAGE'] !== ''
)
{
$confirmMessage = $params['CONFIRM_MESSAGE'];
}
elseif (
isset($params['DEFAULT_CONFIRM_MESSAGE'])
&& is_string($params['DEFAULT_CONFIRM_MESSAGE'])
&& $params['DEFAULT_CONFIRM_MESSAGE'] !== ''
)
{
$confirmMessage = $params['DEFAULT_CONFIRM_MESSAGE'];
}
$result = $this->mainSnippet->getApplyButton([]);
$result['id'] = $this->getElementId($params['APPLY_BUTTON_ID']);
$this->mainSnippet->setButtonActions(
$result,
[
[
'ACTION' => MainGridPanelActions::CALLBACK,
'CONFIRM' => true,
'CONFIRM_MESSAGE' => $confirmMessage,
'DATA' => [
$this->getDefaultApplyAction(),
],
],
]
);
return $result;
}