Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DoneButton.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  private $bulkStatus;
20 
24  private $request;
25 
30  public function __construct(
31  \Magento\Framework\Bulk\BulkStatusInterface $bulkStatus,
32  \Magento\Framework\App\RequestInterface $request
33  ) {
34  $this->bulkStatus = $bulkStatus;
35  $this->request = $request;
36  }
37 
43  public function getButtonData()
44  {
45  $uuid = $this->request->getParam('uuid');
46  $operationsCount = $this->bulkStatus->getOperationsCountByBulkIdAndStatus(
47  $uuid,
49  );
50  $button = [];
51 
52  if ($this->request->getParam('buttons') && $operationsCount === 0) {
53  $button = [
54  'label' => __('Done'),
55  'class' => 'primary',
56  'sort_order' => 10,
57  'on_click' => '',
58  'data_attribute' => [
59  'mage-init' => [
60  'Magento_Ui/js/form/button-adapter' => [
61  'actions' => [
62  [
63  'targetName' => 'notification_area.notification_area.modalContainer.modal',
64  'actionName' => 'closeModal'
65  ],
66  ],
67  ],
68  ],
69  ],
70  ];
71  }
72 
73  return $button;
74  }
75 }
__construct(\Magento\Framework\Bulk\BulkStatusInterface $bulkStatus, \Magento\Framework\App\RequestInterface $request)
Definition: DoneButton.php:30
__()
Definition: __.php:13