Protected Member Functions | |
_prepareForm () | |
_getAdditionalElementTypes () | |
_toHtml () |
Definition at line 34 of file Attributes.php.
_getAdditionalElementTypes | ( | ) | [protected] |
Retrieve predefined additional element types
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 70 of file Attributes.php.
00071 { 00072 $result = array( 00073 'price' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_price'), 00074 'image' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_image'), 00075 'boolean' => Mage::getConfig()->getBlockClassName('adminhtml/catalog_product_helper_form_boolean') 00076 ); 00077 00078 $response = new Varien_Object(); 00079 $response->setTypes(array()); 00080 Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response'=>$response)); 00081 00082 foreach ($response->getTypes() as $typeName=>$typeClass) { 00083 $result[$typeName] = $typeClass; 00084 } 00085 00086 return $result; 00087 }
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Initialize product object as form property for using it in elements generation
Set attribute default values for new product
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 36 of file Attributes.php.
00037 { 00038 00039 $form = new Varien_Data_Form(); 00040 /** 00041 * Initialize product object as form property 00042 * for using it in elements generation 00043 */ 00044 $form->setDataObject(Mage::registry('product')); 00045 00046 $fieldset = $form->addFieldset('group_fields', array()); 00047 00048 $attributes = $this->getGroupAttributes(); 00049 00050 $this->_setFieldset($attributes, $fieldset, array('gallery')); 00051 00052 $values = Mage::registry('product')->getData(); 00053 /** 00054 * Set attribute default values for new product 00055 */ 00056 if (!Mage::registry('product')->getId()) { 00057 foreach ($attributes as $attribute) { 00058 if (!isset($values[$attribute->getAttributeCode()])) { 00059 $values[$attribute->getAttributeCode()] = $attribute->getDefaultValue(); 00060 } 00061 } 00062 } 00063 00064 Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form'=>$form)); 00065 $form->addValues($values); 00066 $form->setFieldNameSuffix('product'); 00067 $this->setForm($form); 00068 }
_toHtml | ( | ) | [protected] |
Render block HTML
Reimplemented from Mage_Core_Block_Template.
Definition at line 89 of file Attributes.php.
00090 { 00091 parent::_toHtml(); 00092 return $this->getForm()->getElement('group_fields')->getChildrenHtml(); 00093 }