protected function _prepareLayout() { $helper = Mage::helper('autosku'); if ($helper->autosku_enable()) { if (!$this->getRequest()->getParam('popup')) { $this->setTemplate('autosku/catalog/product/edit.phtml'); $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/', array('store' => $this->getRequest()->getParam('store', 0))) . '\')', 'class' => 'back'))); } else { $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Close Window'), 'onclick' => 'window.close()', 'class' => 'cancel'))); } if (!$this->getProduct()->isReadonly()) { $this->setChild('reset_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Reset'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/*', array('_current' => true)) . '\')'))); $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Save'), 'onclick' => 'productForm.submit()', 'class' => 'save'))); } if (!$this->getRequest()->getParam('popup')) { if (!$this->getProduct()->isReadonly()) { $this->setChild('save_and_edit_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Save and Continue Edit'), 'onclick' => 'saveAndContinueEdit(\'' . $this->getSaveAndContinueUrl() . '\')', 'class' => 'save'))); } if ($this->getProduct()->isDeleteable()) { $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Delete'), 'onclick' => 'confirmSetLocation(\'' . Mage::helper('catalog')->__('Are you sure?') . '\', \'' . $this->getDeleteUrl() . '\')', 'class' => 'delete'))); } if ($this->getProduct()->isDuplicable()) { $this->setChild('duplicate_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Duplicate'), 'onclick' => 'setLocation(\'' . $this->getDuplicateUrl() . '\')', 'class' => 'add'))); } } } else { parent::_prepareLayout(); } }
public function getHeader() { $header = parent::getHeader(); if ($this->getProduct()->getId()) { $productUrl = $this->getProduct()->getUrlInStore(); $previewUrl = $this->getUrl('tadic_avp/product/preview', array('id' => $this->getProductId(), 'key' => Mage::helper('tadic_avp/catalog_product')->getHashForProduct($this->getProductId()), '_store' => $this->getProduct()->getStoreId())); $header .= "  <a href='{$productUrl}' target='_blank'>view</a>"; $header .= "  <a href='{$previewUrl}' target='_blank'>preview</a>"; } return $header; }
public function testGetTypeSwitcherData() { $data = json_decode($this->_block->getTypeSwitcherData(), true); $this->assertEquals('simple', $data['current_type']); $this->assertEquals(array(), $data['attributes']); }
public function __construct() { parent::__construct(); $this->setTemplate('catalog/product/edit.phtml'); $this->setId('product_edit'); }