Mage_Adminhtml_Block_Catalog_Product_Edit Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit:

Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

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 ()


Detailed Description

Definition at line 34 of file Edit.php.


Constructor & Destructor Documentation

__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     }


Member Function Documentation

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

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 (  ) 

Definition at line 200 of file Edit.php.

00201     {
00202         return $this->getUrl('*/*/delete', array('_current'=>true));
00203     }

getDuplicateButtonHtml (  ) 

Definition at line 156 of file Edit.php.

00157     {
00158         return $this->getChildHtml('duplicate_button');
00159     }

getDuplicateUrl (  ) 

Definition at line 205 of file Edit.php.

00206     {
00207         return $this->getUrl('*/*/duplicate', array('_current'=>true));
00208     }

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

Returns:
Mage_Catalog_Model_Product

Definition at line 48 of file Edit.php.

00049     {
00050         return Mage::registry('current_product');
00051     }

getProductId (  ) 

Definition at line 181 of file Edit.php.

00182     {
00183         return $this->getProduct()->getId();
00184     }

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 (  ) 

Definition at line 171 of file Edit.php.

00172     {
00173         return $this->getUrl('*/*/save', array(
00174             '_current'   => true,
00175             'back'       => 'edit',
00176             'tab'        => '{{tab_id}}',
00177             'active_tab' => null
00178         ));
00179     }

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 (  ) 

Definition at line 166 of file Edit.php.

00167     {
00168         return $this->getUrl('*/*/save', array('_current'=>true, 'back'=>null));
00169     }

getSelectedTabId (  ) 

Definition at line 245 of file Edit.php.

00246     {
00247         return addslashes(htmlspecialchars($this->getRequest()->getParam('tab')));
00248     }

getValidationUrl (  ) 

Definition at line 161 of file Edit.php.

00162     {
00163         return $this->getUrl('*/*/validate', array('_current'=>true));
00164     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:44 2009 for Magento by  doxygen 1.5.8