1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Search\Block\Adminhtml\Synonyms\Edit;
- use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
- /**
- * Class DeleteButton
- */
- class DeleteButton extends GenericButton implements ButtonProviderInterface
- {
- /**
- * @return array
- */
- public function getButtonData()
- {
- $data = [];
- if ($this->getGroupId()) {
- $data = [
- 'label' => __('Delete Synonym Group'),
- 'class' => 'delete',
- 'on_click' => 'deleteConfirm(\''
- . __('Are you sure you want to delete this synonym group?')
- . '\', \'' . $this->getDeleteUrl() . '\')',
- 'sort_order' => 20,
- ];
- }
- return $data;
- }
- /**
- * @return string
- */
- public function getDeleteUrl()
- {
- return $this->getUrl('*/*/delete', ['group_id' => $this->getGroupId()]);
- }
- }
|