Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Currency.php
Go to the documentation of this file.
1 <?php
13 
19 {
23  protected $_template = 'Magento_CurrencySymbol::system/currency/rates.phtml';
24 
30  protected function _prepareLayout()
31  {
32  $this->getToolbar()->addChild(
33  'save_button',
34  \Magento\Backend\Block\Widget\Button::class,
35  [
36  'label' => __('Save Currency Rates'),
37  'class' => 'save primary save-currency-rates',
38  'data_attribute' => [
39  'mage-init' => ['button' => ['event' => 'save', 'target' => '#rate-form']],
40  ]
41  ]
42  );
43 
44  $onClick = "setLocation('" . $this->getUrl('adminhtml/system_config/edit/section/currency') . "')";
45 
46  $this->getToolbar()->addChild(
47  'options_button',
48  \Magento\Backend\Block\Widget\Button::class,
49  ['label' => __('Options'), 'onclick' => $onClick]
50  );
51 
52  $this->getToolbar()->addChild(
53  'reset_button',
54  \Magento\Backend\Block\Widget\Button::class,
55  ['label' => __('Reset'), 'onclick' => 'document.location.reload()', 'class' => 'reset']
56  );
57 
58  $this->addChild(
59  'import_button',
60  \Magento\Backend\Block\Widget\Button::class,
61  ['label' => __('Import'), 'class' => 'add', 'type' => 'submit']
62  );
63 
64  $this->addChild('rates_matrix', \Magento\CurrencySymbol\Block\Adminhtml\System\Currency\Rate\Matrix::class);
65 
66  $this->addChild(
67  'import_services',
68  \Magento\CurrencySymbol\Block\Adminhtml\System\Currency\Rate\Services::class
69  );
70 
71  return parent::_prepareLayout();
72  }
73 
80  public function getHeader()
81  {
82  return __('Manage Currency Rates');
83  }
84 
91  public function getSaveButtonHtml()
92  {
93  return $this->getChildHtml('save_button');
94  }
95 
102  public function getResetButtonHtml()
103  {
104  return $this->getChildHtml('reset_button');
105  }
106 
113  public function getImportButtonHtml()
114  {
115  return $this->getChildHtml('import_button');
116  }
117 
124  public function getServicesHtml()
125  {
126  return $this->getChildHtml('import_services');
127  }
128 
135  public function getRatesMatrixHtml()
136  {
137  return $this->getChildHtml('rates_matrix');
138  }
139 
146  public function getImportFormAction()
147  {
148  return $this->getUrl('adminhtml/*/fetchRates');
149  }
150 }
__()
Definition: __.php:13