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: class Mage_Adminhtml_Block_System_Design_Edit extends Mage_Adminhtml_Block_Widget
28: {
29: public function __construct()
30: {
31: parent::__construct();
32: $this->setTemplate('system/design/edit.phtml');
33: $this->setId('design_edit');
34: }
35:
36: protected function _prepareLayout()
37: {
38: $this->setChild('back_button',
39: $this->getLayout()->createBlock('adminhtml/widget_button')
40: ->setData(array(
41: 'label' => Mage::helper('core')->__('Back'),
42: 'onclick' => 'setLocation(\''.$this->getUrl('*/*/').'\')',
43: 'class' => 'back'
44: ))
45: );
46:
47: $this->setChild('save_button',
48: $this->getLayout()->createBlock('adminhtml/widget_button')
49: ->setData(array(
50: 'label' => Mage::helper('core')->__('Save'),
51: 'onclick' => 'designForm.submit()',
52: 'class' => 'save'
53: ))
54: );
55:
56: $this->setChild('delete_button',
57: $this->getLayout()->createBlock('adminhtml/widget_button')
58: ->setData(array(
59: 'label' => Mage::helper('core')->__('Delete'),
60: 'onclick' => 'confirmSetLocation(\''.Mage::helper('core')->__('Are you sure?').'\', \''.$this->getDeleteUrl().'\')',
61: 'class' => 'delete'
62: ))
63: );
64: return parent::_prepareLayout();
65: }
66:
67: public function getDesignChangeId()
68: {
69: return Mage::registry('design')->getId();
70: }
71:
72: public function getDeleteUrl()
73: {
74: return $this->getUrl('*/*/delete', array('_current'=>true));
75: }
76:
77: public function getSaveUrl()
78: {
79: return $this->getUrl('*/*/save', array('_current'=>true));
80: }
81:
82: public function getValidationUrl()
83: {
84: return $this->getUrl('*/*/validate', array('_current'=>true));
85: }
86:
87: public function ()
88: {
89: $header = '';
90: if (Mage::registry('design')->getId()) {
91: $header = Mage::helper('core')->__('Edit Design Change');
92: } else {
93: $header = Mage::helper('core')->__('New Design Change');
94: }
95: return $header;
96: }
97: }
98: