Public Member Functions | |
__construct () | |
getProduct () | |
getBackButtonHtml () | |
getCancelButtonHtml () | |
getSaveButtonHtml () | |
getSaveAndEditButtonHtml () | |
getDeleteButtonHtml () | |
getDuplicateButtonHtml () | |
getValidationUrl () | |
getSaveUrl () | |
getSaveAndContinueUrl () | |
getProductId () | |
getProductSetId () | |
getIsGrouped () | |
getDeleteUrl () | |
getDuplicateUrl () | |
getHeader () | |
getAttributeSetName () | |
getIsConfigured () | |
getSelectedTabId () | |
Protected Member Functions | |
_prepareLayout () |
Definition at line 34 of file Edit.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 36 of file Edit.php.
00037 { 00038 parent::__construct(); 00039 $this->setTemplate('catalog/product/edit.phtml'); 00040 $this->setId('product_edit'); 00041 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 53 of file Edit.php.
00054 { 00055 if (!$this->getRequest()->getParam('popup')) { 00056 $this->setChild('back_button', 00057 $this->getLayout()->createBlock('adminhtml/widget_button') 00058 ->setData(array( 00059 'label' => Mage::helper('catalog')->__('Back'), 00060 'onclick' => 'setLocation(\''.$this->getUrl('*/*/', array('store'=>$this->getRequest()->getParam('store', 0))).'\')', 00061 'class' => 'back' 00062 )) 00063 ); 00064 } else { 00065 $this->setChild('back_button', 00066 $this->getLayout()->createBlock('adminhtml/widget_button') 00067 ->setData(array( 00068 'label' => Mage::helper('catalog')->__('Close Window'), 00069 'onclick' => 'window.close()', 00070 'class' => 'cancel' 00071 )) 00072 ); 00073 } 00074 00075 if (!$this->getProduct()->isReadonly()) { 00076 $this->setChild('reset_button', 00077 $this->getLayout()->createBlock('adminhtml/widget_button') 00078 ->setData(array( 00079 'label' => Mage::helper('catalog')->__('Reset'), 00080 'onclick' => 'setLocation(\''.$this->getUrl('*/*/*', array('_current'=>true)).'\')' 00081 )) 00082 ); 00083 00084 $this->setChild('save_button', 00085 $this->getLayout()->createBlock('adminhtml/widget_button') 00086 ->setData(array( 00087 'label' => Mage::helper('catalog')->__('Save'), 00088 'onclick' => 'productForm.submit()', 00089 'class' => 'save' 00090 )) 00091 ); 00092 } 00093 00094 if (!$this->getRequest()->getParam('popup')) { 00095 if (!$this->getProduct()->isReadonly()) { 00096 $this->setChild('save_and_edit_button', 00097 $this->getLayout()->createBlock('adminhtml/widget_button') 00098 ->setData(array( 00099 'label' => Mage::helper('catalog')->__('Save And Continue Edit'), 00100 'onclick' => 'saveAndContinueEdit(\''.$this->getSaveAndContinueUrl().'\')', 00101 'class' => 'save' 00102 )) 00103 ); 00104 } 00105 if ($this->getProduct()->isDeleteable()) { 00106 $this->setChild('delete_button', 00107 $this->getLayout()->createBlock('adminhtml/widget_button') 00108 ->setData(array( 00109 'label' => Mage::helper('catalog')->__('Delete'), 00110 'onclick' => 'confirmSetLocation(\''.Mage::helper('catalog')->__('Are you sure?').'\', \''.$this->getDeleteUrl().'\')', 00111 'class' => 'delete' 00112 )) 00113 ); 00114 } 00115 00116 if ($this->getProduct()->isDuplicable()) { 00117 $this->setChild('duplicate_button', 00118 $this->getLayout()->createBlock('adminhtml/widget_button') 00119 ->setData(array( 00120 'label' => Mage::helper('catalog')->__('Duplicate'), 00121 'onclick' => 'setLocation(\''.$this->getDuplicateUrl().'\')', 00122 'class' => 'add' 00123 )) 00124 ); 00125 } 00126 } 00127 00128 return parent::_prepareLayout(); 00129 }
getAttributeSetName | ( | ) |
Definition at line 225 of file Edit.php.
00226 { 00227 if ($setId = $this->getProduct()->getAttributeSetId()) { 00228 $set = Mage::getModel('eav/entity_attribute_set') 00229 ->load($setId); 00230 return $set->getAttributeSetName(); 00231 } 00232 return ''; 00233 }
getBackButtonHtml | ( | ) |
Definition at line 131 of file Edit.php.
00132 { 00133 return $this->getChildHtml('back_button'); 00134 }
getCancelButtonHtml | ( | ) |
Definition at line 136 of file Edit.php.
00137 { 00138 return $this->getChildHtml('reset_button'); 00139 }
getDeleteButtonHtml | ( | ) |
Definition at line 151 of file Edit.php.
00152 { 00153 return $this->getChildHtml('delete_button'); 00154 }
getDeleteUrl | ( | ) |
getDuplicateButtonHtml | ( | ) |
Definition at line 156 of file Edit.php.
00157 { 00158 return $this->getChildHtml('duplicate_button'); 00159 }
getDuplicateUrl | ( | ) |
getHeader | ( | ) |
Definition at line 210 of file Edit.php.
00211 { 00212 $header = ''; 00213 if ($this->getProduct()->getId()) { 00214 $header = $this->htmlEscape($this->getProduct()->getName()); 00215 } 00216 else { 00217 $header = Mage::helper('catalog')->__('New Product'); 00218 } 00219 if ($setName = $this->getAttributeSetName()) { 00220 $header.= ' (' . $setName . ')'; 00221 } 00222 return $header; 00223 }
getIsConfigured | ( | ) |
Definition at line 235 of file Edit.php.
00236 { 00237 if ($this->getProduct()->isConfigurable() 00238 && !($superAttributes = $this->getProduct()->getTypeInstance(true)->getUsedProductAttributeIds($this->getProduct()))) { 00239 $superAttributes = false; 00240 } 00241 00242 return !$this->getProduct()->isConfigurable() || $superAttributes !== false; 00243 }
getIsGrouped | ( | ) |
Definition at line 195 of file Edit.php.
00196 { 00197 return $this->getProduct()->isGrouped(); 00198 }
getProduct | ( | ) |
Retrieve currently edited product object
Definition at line 48 of file Edit.php.
00049 { 00050 return Mage::registry('current_product'); 00051 }
getProductId | ( | ) |
getProductSetId | ( | ) |
Definition at line 186 of file Edit.php.
00187 { 00188 $setId = false; 00189 if (!($setId = $this->getProduct()->getAttributeSetId()) && $this->getRequest()) { 00190 $setId = $this->getRequest()->getParam('set', null); 00191 } 00192 return $setId; 00193 }
getSaveAndContinueUrl | ( | ) |
getSaveAndEditButtonHtml | ( | ) |
Definition at line 146 of file Edit.php.
00147 { 00148 return $this->getChildHtml('save_and_edit_button'); 00149 }
getSaveButtonHtml | ( | ) |
Definition at line 141 of file Edit.php.
00142 { 00143 return $this->getChildHtml('save_button'); 00144 }
getSaveUrl | ( | ) |
getSelectedTabId | ( | ) |
Definition at line 245 of file Edit.php.
00246 { 00247 return addslashes(htmlspecialchars($this->getRequest()->getParam('tab'))); 00248 }
getValidationUrl | ( | ) |