Configuration.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace Dotdigitalgroup\Email\Block\Adminhtml\Dashboard;
  3. /**
  4. * Dashboard Configuration block
  5. *
  6. * @api
  7. */
  8. class Configuration extends \Magento\Config\Block\System\Config\Edit
  9. {
  10. /**
  11. * @var mixed
  12. */
  13. public $originalParams;
  14. /**
  15. * Configuration constructor.
  16. *
  17. * @param \Magento\Backend\Block\Template\Context $context
  18. * @param \Magento\Config\Model\Config\Structure $configStructure
  19. * @param array $data
  20. */
  21. public function __construct(
  22. \Magento\Backend\Block\Template\Context $context,
  23. \Magento\Config\Model\Config\Structure $configStructure,
  24. array $data = []
  25. ) {
  26. parent::__construct($context, $configStructure, $data);
  27. $this->_prepareRequestParams();
  28. $this->setTitle(__('dotmailer Configuration'));
  29. $this->_resetRequestParams();
  30. }
  31. /**
  32. * @return $this
  33. */
  34. protected function _prepareLayout()
  35. {
  36. $this->_prepareRequestParams();
  37. parent::_prepareLayout();
  38. return $this;
  39. }
  40. /**
  41. *
  42. */
  43. public function _prepareRequestParams()
  44. {
  45. $this->originalParams = $this->getRequest()->getParam('section');
  46. $this->getRequest()->setParam('section', 'connector_developer_settings');
  47. }
  48. /**
  49. *
  50. */
  51. public function _resetRequestParams()
  52. {
  53. $this->getRequest()->setParam('section', $this->originalParams);
  54. }
  55. /**
  56. * @return string
  57. */
  58. public function getSaveUrl()
  59. {
  60. return $this->getUrl('adminhtml/system_config/save', ['section' => 'connector_developer_settings']);
  61. }
  62. }