00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class Mage_Adminhtml_Block_System_Currency extends Mage_Adminhtml_Block_Template
00036 {
00037
00038 protected function _construct()
00039 {
00040 $this->setTemplate('system/currency/rates.phtml');
00041 }
00042
00043 protected function _prepareLayout()
00044 {
00045 $this->setChild('save_button',
00046 $this->getLayout()->createBlock('adminhtml/widget_button')
00047 ->setData(array(
00048 'label' => Mage::helper('adminhtml')->__('Save Currency Rates'),
00049 'onclick' => 'currencyForm.submit();',
00050 'class' => 'save'
00051 )));
00052
00053 $this->setChild('reset_button',
00054 $this->getLayout()->createBlock('adminhtml/widget_button')
00055 ->setData(array(
00056 'label' => Mage::helper('adminhtml')->__('Reset'),
00057 'onclick' => 'document.location.reload()',
00058 'class' => 'reset'
00059 )));
00060
00061 $this->setChild('import_button',
00062 $this->getLayout()->createBlock('adminhtml/widget_button')
00063 ->setData(array(
00064 'label' => Mage::helper('adminhtml')->__('Import'),
00065 'class' => 'add',
00066 'type' => 'submit',
00067 )));
00068
00069 $this->setChild('rates_matrix',
00070 $this->getLayout()->createBlock('adminhtml/system_currency_rate_matrix')
00071 );
00072
00073 return parent::_prepareLayout();
00074 }
00075
00076 protected function getHeader()
00077 {
00078 return Mage::helper('adminhtml')->__('Manage Currency Rates');
00079 }
00080
00081 protected function getSaveButtonHtml()
00082 {
00083 return $this->getChildHtml('save_button');
00084 }
00085
00086 protected function getResetButtonHtml()
00087 {
00088 return $this->getChildHtml('reset_button');
00089 }
00090
00091 protected function getImportButtonHtml()
00092 {
00093 return $this->getChildHtml('import_button');
00094 }
00095
00096 protected function getServicesHtml()
00097 {
00098 return $this->getLayout()->createBlock('adminhtml/html_select')
00099 ->setOptions(Mage::getModel('adminhtml/system_config_source_currency_service')->toOptionArray(0))
00100 ->setId('rate_services')
00101 ->setName('rate_services')
00102 ->setValue(Mage::getSingleton('adminhtml/session')->getCurrencyRateService(true))
00103 ->setTitle(Mage::helper('adminhtml')->__('Import Service'))
00104 ->toHtml();
00105
00106 }
00107
00108 protected function getRatesMatrixHtml()
00109 {
00110 return $this->getChildHtml('rates_matrix');
00111 }
00112
00113 protected function getImportFormAction()
00114 {
00115 return $this->getUrl('*/*/fetchRates');
00116 }
00117
00118 }