Edit.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Adminhtml tax rule Edit Container
  8. */
  9. namespace Magento\Tax\Block\Adminhtml\Rule;
  10. /**
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class Edit extends \Magento\Backend\Block\Widget\Form\Container
  15. {
  16. /**
  17. * Core registry
  18. *
  19. * @var \Magento\Framework\Registry
  20. */
  21. protected $_coreRegistry = null;
  22. /**
  23. * @param \Magento\Backend\Block\Widget\Context $context
  24. * @param \Magento\Framework\Registry $registry
  25. * @param array $data
  26. */
  27. public function __construct(
  28. \Magento\Backend\Block\Widget\Context $context,
  29. \Magento\Framework\Registry $registry,
  30. array $data = []
  31. ) {
  32. $this->_coreRegistry = $registry;
  33. parent::__construct($context, $data);
  34. }
  35. /**
  36. * Init class
  37. *
  38. * @return void
  39. */
  40. protected function _construct()
  41. {
  42. $this->_objectId = 'rule';
  43. $this->_controller = 'adminhtml_rule';
  44. $this->_blockGroup = 'Magento_Tax';
  45. parent::_construct();
  46. $this->buttonList->update('save', 'label', __('Save Rule'));
  47. $this->buttonList->update('delete', 'label', __('Delete Rule'));
  48. $this->buttonList->add(
  49. 'save_and_continue',
  50. [
  51. 'label' => __('Save and Continue Edit'),
  52. 'class' => 'save',
  53. 'data_attribute' => [
  54. 'mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']],
  55. ]
  56. ],
  57. 10
  58. );
  59. }
  60. }