| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | class ImportButton implements ButtonProviderInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var Context |
||
| 18 | */ |
||
| 19 | private $context; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param Context $context |
||
| 23 | */ |
||
| 24 | public function __construct( |
||
| 25 | Context $context |
||
| 26 | ) { |
||
| 27 | $this->context = $context; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritDoc |
||
| 32 | */ |
||
| 33 | public function getButtonData() |
||
| 34 | { |
||
| 35 | return [ |
||
| 36 | 'label' => __('Import Contacts'), |
||
| 37 | 'class' => 'primary', |
||
| 38 | 'on_click' => 'deleteConfirm(\'' . __( |
||
| 39 | 'Are you sure you want to do this?' |
||
| 40 | ) . '\', \'' . $this->getImportUrl() . '\', {"data": {}})', |
||
| 41 | ]; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | private function getImportUrl(): string |
||
| 50 | } |
||
| 51 | } |
||
| 52 |