6 declare(strict_types=1);
41 private $confirmationMessage;
51 private $deleteRoutePath;
71 string $confirmationMessage,
73 string $deleteRoutePath,
77 $this->urlBuilder = $urlBuilder;
78 $this->escaper = $escaper;
79 $this->confirmationMessage = $confirmationMessage;
80 $this->idFieldName = $idFieldName;
81 $this->deleteRoutePath = $deleteRoutePath;
82 $this->sortOrder = $sortOrder;
91 $fieldId = $this->escaper->escapeJs($this->escaper->escapeHtml($this->request->getParam($this->idFieldName)));
93 $url = $this->urlBuilder->getUrl($this->deleteRoutePath);
94 $escapedMessage = $this->escaper->escapeJs($this->escaper->escapeHtml($this->confirmationMessage));
96 'label' =>
__(
'Delete'),
98 'on_click' =>
"deleteConfirm('{$escapedMessage}', '{$url}', {data:{{$this->idFieldName}:{$fieldId}}})",
99 'sort_order' => $this->sortOrder,