setTemplate('system/design/edit.phtml'); $this->setId('design_edit'); } protected function _prepareLayout() { $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button') ->setData(array( 'label' => Mage::helper('core')->__('Back'), 'onclick' => 'setLocation(\''.$this->getUrl('*/*/').'\')', 'class' => 'back' )) ); $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button') ->setData(array( 'label' => Mage::helper('core')->__('Save'), 'onclick' => 'designForm.submit()', 'class' => 'save' )) ); $confirmationMessage = Mage::helper('core')->jsQuoteEscape( Mage::helper('core')->__('Are you sure?') ); $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button') ->setData(array( 'label' => Mage::helper('core')->__('Delete'), 'onclick' => 'confirmSetLocation(\'' . $confirmationMessage . '\', \'' . $this->getDeleteUrl() . '\')', 'class' => 'delete' )) ); return parent::_prepareLayout(); } public function getDesignChangeId() { return Mage::registry('design')->getId(); } public function getDeleteUrl() { return $this->getUrl('*/*/delete', array('_current'=>true)); } public function getSaveUrl() { return $this->getUrl('*/*/save', array('_current'=>true)); } public function getValidationUrl() { return $this->getUrl('*/*/validate', array('_current'=>true)); } public function getHeader() { $header = ''; if (Mage::registry('design')->getId()) { $header = Mage::helper('core')->__('Edit Design Change'); } else { $header = Mage::helper('core')->__('New Design Change'); } return $header; } }