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_Tax_Rate_Toolbar_Save extends Mage_Adminhtml_Block_Template
00036 {
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->assign('createUrl', $this->getUrl('*/tax_rate/save'));
00041 $this->setTemplate('tax/toolbar/rate/save.phtml');
00042 }
00043
00044 protected function _prepareLayout()
00045 {
00046 $this->setChild('backButton',
00047 $this->getLayout()->createBlock('adminhtml/widget_button')
00048 ->setData(array(
00049 'label' => Mage::helper('tax')->__('Back'),
00050 'onclick' => 'window.location.href=\''.$this->getUrl('*/*/').'\'',
00051 'class' => 'back'
00052 ))
00053 );
00054
00055 $this->setChild('resetButton',
00056 $this->getLayout()->createBlock('adminhtml/widget_button')
00057 ->setData(array(
00058 'label' => Mage::helper('tax')->__('Reset'),
00059 'onclick' => 'window.location.reload()'
00060 ))
00061 );
00062
00063 $this->setChild('saveButton',
00064 $this->getLayout()->createBlock('adminhtml/widget_button')
00065 ->setData(array(
00066 'label' => Mage::helper('tax')->__('Save Rate'),
00067 'onclick' => 'wigetForm.submit();return false;',
00068 'class' => 'save'
00069 ))
00070 );
00071
00072 $this->setChild('deleteButton',
00073 $this->getLayout()->createBlock('adminhtml/widget_button')
00074 ->setData(array(
00075 'label' => Mage::helper('tax')->__('Delete Rate'),
00076 'onclick' => 'deleteConfirm(\'' . Mage::helper('tax')->__('Are you sure you want to do this?') . '\', \'' . $this->getUrl('*/*/delete', array('rate' => $this->getRequest()->getParam('rate'))) . '\')',
00077 'class' => 'delete'
00078 ))
00079 );
00080 return parent::_prepareLayout();
00081 }
00082
00083 public function getBackButtonHtml()
00084 {
00085 return $this->getChildHtml('backButton');
00086 }
00087
00088 public function getResetButtonHtml()
00089 {
00090 return $this->getChildHtml('resetButton');
00091 }
00092
00093 public function getSaveButtonHtml()
00094 {
00095 return $this->getChildHtml('saveButton');
00096 }
00097
00098 public function getDeleteButtonHtml()
00099 {
00100 if( intval($this->getRequest()->getParam('rate')) == 0 ) {
00101 return;
00102 }
00103 return $this->getChildHtml('deleteButton');
00104 }
00105 }