43 lines
1016 B
PHP
Executable File
43 lines
1016 B
PHP
Executable File
<?php
|
|
/**
|
|
* Copyright © 2016 Magento. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
namespace FME\Banners\Block\Adminhtml\Banners;
|
|
|
|
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
|
|
|
|
/**
|
|
* Class DeleteButton
|
|
*/
|
|
class DeleteButton extends GenericButton implements ButtonProviderInterface
|
|
{
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getButtonData()
|
|
{
|
|
$data = [];
|
|
if ($this->getBlockId()) {
|
|
$data = [
|
|
'label' => __('Delete Block'),
|
|
'class' => 'delete',
|
|
'on_click' => 'deleteConfirm(\'' . __(
|
|
'Are you sure you want to do this?'
|
|
) . '\', \'' . $this->getDeleteUrl() . '\')',
|
|
'sort_order' => 20,
|
|
];
|
|
}
|
|
return $data;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getDeleteUrl()
|
|
{
|
|
return $this->getUrl('*/*/delete', ['banners_id' => $this->getBlockId()]);
|
|
}
|
|
}
|