1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34:
35: class Mage_Adminhtml_Block_Tax_Rate_Toolbar_Save extends Mage_Adminhtml_Block_Template
36: {
37: public function __construct()
38: {
39: parent::__construct();
40: $this->assign('createUrl', $this->getUrl('*/tax_rate/save'));
41: $this->setTemplate('tax/toolbar/rate/save.phtml');
42: }
43:
44: protected function _prepareLayout()
45: {
46: $this->setChild('backButton',
47: $this->getLayout()->createBlock('adminhtml/widget_button')
48: ->setData(array(
49: 'label' => Mage::helper('tax')->__('Back'),
50: 'onclick' => 'window.location.href=\''.$this->getUrl('*/*/').'\'',
51: 'class' => 'back'
52: ))
53: );
54:
55: $this->setChild('resetButton',
56: $this->getLayout()->createBlock('adminhtml/widget_button')
57: ->setData(array(
58: 'label' => Mage::helper('tax')->__('Reset'),
59: 'onclick' => 'window.location.reload()'
60: ))
61: );
62:
63: $this->setChild('saveButton',
64: $this->getLayout()->createBlock('adminhtml/widget_button')
65: ->setData(array(
66: 'label' => Mage::helper('tax')->__('Save Rate'),
67: 'onclick' => 'wigetForm.submit();return false;',
68: 'class' => 'save'
69: ))
70: );
71:
72: $this->setChild('deleteButton',
73: $this->getLayout()->createBlock('adminhtml/widget_button')
74: ->setData(array(
75: 'label' => Mage::helper('tax')->__('Delete Rate'),
76: 'onclick' => 'deleteConfirm(\'' . Mage::helper('tax')->__('Are you sure you want to do this?') . '\', \'' . $this->getUrl('*/*/delete', array('rate' => $this->getRequest()->getParam('rate'))) . '\')',
77: 'class' => 'delete'
78: ))
79: );
80: return parent::_prepareLayout();
81: }
82:
83: public function getBackButtonHtml()
84: {
85: return $this->getChildHtml('backButton');
86: }
87:
88: public function getResetButtonHtml()
89: {
90: return $this->getChildHtml('resetButton');
91: }
92:
93: public function getSaveButtonHtml()
94: {
95: return $this->getChildHtml('saveButton');
96: }
97:
98: public function getDeleteButtonHtml()
99: {
100: if( intval($this->getRequest()->getParam('rate')) == 0 ) {
101: return;
102: }
103: return $this->getChildHtml('deleteButton');
104: }
105: }
106: