Public Member Functions | |
__construct () | |
getForm () | |
getFormObject () | |
getFormHtml () | |
setForm (Varien_Data_Form $form) | |
Protected Member Functions | |
_prepareLayout () | |
_prepareForm () | |
_beforeToHtml () | |
_initFormValues () | |
_setFieldset ($attributes, $fieldset, $exclude=array()) | |
_addElementTypes (Varien_Data_Form_Abstract $baseElement) | |
_getAdditionalElementTypes () | |
_getAdditionalElementHtml ($element) | |
Protected Attributes | |
$_form |
Definition at line 34 of file Form.php.
__construct | ( | ) |
Class constructor
Reimplemented from Varien_Object.
Reimplemented in Mage_Adminhtml_Block_Api_Tab_Roleinfo, Mage_Adminhtml_Block_Api_Tab_Rolesedit, Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes, Mage_Adminhtml_Block_Catalog_Category_Tab_Design, Mage_Adminhtml_Block_Catalog_Category_Tab_General, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formattribute, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formgroup, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formset, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Toolbar_Main_Filter, Mage_Adminhtml_Block_Catalog_Search_Edit_Form, Mage_Adminhtml_Block_Checkout_Agreement_Edit_Form, Mage_Adminhtml_Block_Cms_Block_Edit_Form, Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Design, Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Meta, Mage_Adminhtml_Block_Customer_Edit_Tab_Account, Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses, Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter, Mage_Adminhtml_Block_Customer_Online_Filter, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Abstract, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Contents, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Depends, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Maintainers, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Package, Mage_Adminhtml_Block_Extensions_Custom_Edit_Tab_Release, Mage_Adminhtml_Block_Extensions_Local_Edit_Tab_Actions, Mage_Adminhtml_Block_Extensions_Local_Edit_Tab_Changelog, Mage_Adminhtml_Block_Extensions_Local_Edit_Tab_Contents, Mage_Adminhtml_Block_Extensions_Local_Edit_Tab_Depends, Mage_Adminhtml_Block_Extensions_Local_Edit_Tab_Package, Mage_Adminhtml_Block_Extensions_Remote_Edit_Tab_Actions, Mage_Adminhtml_Block_Extensions_Remote_Edit_Tab_Changelog, Mage_Adminhtml_Block_Extensions_Remote_Edit_Tab_Package, Mage_Adminhtml_Block_Newsletter_Template_Edit_Form, Mage_Adminhtml_Block_Permissions_Tab_Rolesedit, Mage_Adminhtml_Block_Promo_Catalog_Edit_Form, Mage_Adminhtml_Block_Promo_Quote_Edit_Form, Mage_Adminhtml_Block_Sitemap_Edit_Form, Mage_Adminhtml_Block_System_Config_Form, Mage_Adminhtml_Block_System_Convert_Gui_Edit_Tab_Upload, Mage_Adminhtml_Block_System_Currency_Edit_Form, Mage_Adminhtml_Block_System_Store_Delete_Form, Mage_Adminhtml_Block_System_Store_Edit_Form, Mage_Adminhtml_Block_Tag_Edit_Form, Mage_Adminhtml_Block_Tag_Tag_Edit_Form, Mage_Adminhtml_Block_Tax_Class_Edit_Form, Mage_Adminhtml_Block_Tax_Rate_Form, Mage_Adminhtml_Block_Tax_Rule_Edit_Form, Mage_Adminhtml_Block_Urlrewrite_Edit_Form, and Mage_GoogleOptimizer_Block_Adminhtml_Catalog_Category_Edit_Tab_Googleoptimizer.
Definition at line 48 of file Form.php.
00049 { 00050 parent::__construct(); 00051 $this->setTemplate('widget/form.phtml'); 00052 $this->setDestElementId('edit_form'); 00053 $this->setShowGlobalIcon(false); 00054 }
_addElementTypes | ( | Varien_Data_Form_Abstract $ | baseElement | ) | [protected] |
Add new element type
Varien_Data_Form_Abstract | $baseElement |
Definition at line 210 of file Form.php.
00211 { 00212 $types = $this->_getAdditionalElementTypes(); 00213 foreach ($types as $code => $className) { 00214 $baseElement->addType($code, $className); 00215 } 00216 }
_beforeToHtml | ( | ) | [protected] |
This method is called before rendering HTML
Reimplemented from Mage_Core_Block_Abstract.
Reimplemented in Mage_Adminhtml_Block_Api_Tab_Roleinfo, and Mage_Adminhtml_Block_Permissions_Tab_Roleinfo.
Definition at line 137 of file Form.php.
00138 { 00139 $this->_prepareForm(); 00140 $this->_initFormValues(); 00141 return parent::_beforeToHtml(); 00142 }
_getAdditionalElementHtml | ( | $ | element | ) | [protected] |
Enter description here...
Varien_Data_Form_Element_Abstract | $element |
Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes.
Definition at line 234 of file Form.php.
_getAdditionalElementTypes | ( | ) | [protected] |
Retrieve predefined additional element types
Reimplemented in Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes, Mage_Adminhtml_Block_Catalog_Category_Tab_General, Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Main, Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Attributes, Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes, and Mage_Adminhtml_Block_System_Config_Form.
Definition at line 223 of file Form.php.
00224 { 00225 return array(); 00226 }
_initFormValues | ( | ) | [protected] |
Initialize form fileds values Method will be called after prepareForm and can be used for field values initialization
Definition at line 150 of file Form.php.
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Reimplemented in Mage_Adminhtml_Block_Api_User_Edit_Form, Mage_Adminhtml_Block_Api_User_Edit_Tab_Main, Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes, Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Form, Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Front, Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Main, Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_System, Mage_Adminhtml_Block_Catalog_Product_Attribute_New_Product_Attributes, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formattribute, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formgroup, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Main_Formset, Mage_Adminhtml_Block_Catalog_Product_Attribute_Set_Toolbar_Main_Filter, Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Settings, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Settings, Mage_Adminhtml_Block_Catalog_Search_Edit_Form, Mage_Adminhtml_Block_Checkout_Agreement_Edit_Form, Mage_Adminhtml_Block_Cms_Block_Edit_Form, Mage_Adminhtml_Block_Cms_Page_Edit_Form, Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Design, Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Meta, Mage_Adminhtml_Block_Customer_Edit_Form, Mage_Adminhtml_Block_Customer_Online_Filter, Mage_Adminhtml_Block_Extensions_Console_Edit_Form, Mage_Adminhtml_Block_Extensions_Custom_Edit_Form, Mage_Adminhtml_Block_Extensions_Local_Edit_Form, Mage_Adminhtml_Block_Extensions_Remote_Edit_Form, Mage_Adminhtml_Block_Newsletter_Queue_Edit_Form, Mage_Adminhtml_Block_Newsletter_Template_Edit_Form, Mage_Adminhtml_Block_Permissions_Tab_Useredit, Mage_Adminhtml_Block_Permissions_User_Edit_Form, Mage_Adminhtml_Block_Permissions_User_Edit_Tab_Main, Mage_Adminhtml_Block_Poll_Answer_Edit_Form, Mage_Adminhtml_Block_Poll_Edit_Form, Mage_Adminhtml_Block_Poll_Edit_Tab_Answers_Form, Mage_Adminhtml_Block_Poll_Edit_Tab_Form, Mage_Adminhtml_Block_Promo_Catalog_Edit_Form, Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Actions, Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Conditions, Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main, Mage_Adminhtml_Block_Promo_Quote_Edit_Form, Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Actions, Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Conditions, Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main, Mage_Adminhtml_Block_Rating_Edit_Form, Mage_Adminhtml_Block_Rating_Edit_Tab_Form, Mage_Adminhtml_Block_Rating_Edit_Tab_Options, Mage_Adminhtml_Block_Review_Add_Form, Mage_Adminhtml_Block_Review_Edit_Form, Mage_Adminhtml_Block_Sales_Order_Create_Giftmessage_Form, Mage_Adminhtml_Block_Sitemap_Edit_Form, Mage_Adminhtml_Block_System_Account_Edit_Form, Mage_Adminhtml_Block_System_Convert_Gui_Edit_Form, Mage_Adminhtml_Block_System_Convert_Profile_Edit_Form, Mage_Adminhtml_Block_System_Currency_Edit_Form, Mage_Adminhtml_Block_System_Design_Edit_Tab_General, Mage_Adminhtml_Block_System_Email_Template_Edit_Form, Mage_Adminhtml_Block_System_Store_Delete_Form, Mage_Adminhtml_Block_System_Store_Edit_Form, Mage_Adminhtml_Block_Tag_Edit_Form, Mage_Adminhtml_Block_Tag_Tag_Edit_Form, Mage_Adminhtml_Block_Tax_Class_Edit_Form, Mage_Adminhtml_Block_Tax_Rate_Form, Mage_Adminhtml_Block_Tax_Rule_Edit_Form, Mage_Adminhtml_Block_Urlrewrite_Edit_Form, Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes, Mage_GoogleBase_Block_Adminhtml_Types_Edit_Form, Mage_Googleoptimizer_Block_Adminhtml_Catalog_Product_Edit_Tab_Googleoptimizer, and Mage_Googleoptimizer_Block_Adminhtml_Cms_Page_Edit_Tab_Googleoptimizer.
Definition at line 127 of file Form.php.
_prepareLayout | ( | ) | [protected] |
Prepare block children and data
Reimplemented from Mage_Core_Block_Abstract.
Reimplemented in Mage_Adminhtml_Block_Catalog_Category_Tab_Design, Mage_Adminhtml_Block_Catalog_Category_Tab_General, Mage_Adminhtml_Block_Catalog_Form, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Settings, Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Settings, Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses, Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter, Mage_Adminhtml_Block_Customer_Group_Edit_Form, and Mage_GoogleOptimizer_Block_Adminhtml_Catalog_Category_Edit_Tab_Googleoptimizer.
Definition at line 60 of file Form.php.
00061 { 00062 Varien_Data_Form::setElementRenderer( 00063 $this->getLayout()->createBlock('adminhtml/widget_form_renderer_element') 00064 ); 00065 Varien_Data_Form::setFieldsetRenderer( 00066 $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset') 00067 ); 00068 Varien_Data_Form::setFieldsetElementRenderer( 00069 $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element') 00070 ); 00071 }
_setFieldset | ( | $ | attributes, | |
$ | fieldset, | |||
$ | exclude = array() | |||
) | [protected] |
Set Fieldset to Form
array | $attributes attributes that are to be added | |
Varien_Data_Form_Element_Fieldset | $fieldset | |
array | $exclude attributes that should be skipped |
Definition at line 162 of file Form.php.
00163 { 00164 $this->_addElementTypes($fieldset); 00165 foreach ($attributes as $attribute) { 00166 /* @var $attribute Mage_Eav_Model_Entity_Attribute */ 00167 if (!$attribute || !$attribute->getIsVisible()) { 00168 continue; 00169 } 00170 if ( ($inputType = $attribute->getFrontend()->getInputType()) 00171 && !in_array($attribute->getAttributeCode(), $exclude) 00172 && ('media_image' != $inputType) 00173 ) { 00174 00175 $fieldType = $inputType; 00176 $rendererClass = $attribute->getFrontend()->getInputRendererClass(); 00177 if (!empty($rendererClass)) { 00178 $fieldType = $inputType . '_' . $attribute->getAttributeCode(); 00179 $fieldset->addType($fieldType, $rendererClass); 00180 } 00181 00182 $element = $fieldset->addField($attribute->getAttributeCode(), $fieldType, 00183 array( 00184 'name' => $attribute->getAttributeCode(), 00185 'label' => __($attribute->getFrontend()->getLabel()), 00186 'class' => $attribute->getFrontend()->getClass(), 00187 'required' => $attribute->getIsRequired(), 00188 'note' => $attribute->getNote(), 00189 ) 00190 ) 00191 ->setEntityAttribute($attribute); 00192 00193 $element->setAfterElementHtml($this->_getAdditionalElementHtml($element)); 00194 00195 if ($inputType == 'select' || $inputType == 'multiselect') { 00196 $element->setValues($attribute->getSource()->getAllOptions(true, true)); 00197 } elseif ($inputType == 'date') { 00198 $element->setImage($this->getSkinUrl('images/grid-cal.gif')); 00199 $element->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT)); 00200 } 00201 } 00202 } 00203 }
getForm | ( | ) |
getFormHtml | ( | ) |
getFormObject | ( | ) |
Get form object
Definition at line 90 of file Form.php.
00091 { 00092 return $this->getForm(); 00093 }
setForm | ( | Varien_Data_Form $ | form | ) |
Set form object
Varien_Data_Form | $form |
Definition at line 114 of file Form.php.
00115 { 00116 $this->_form = $form; 00117 $this->_form->setParent($this); 00118 $this->_form->setBaseUrl(Mage::getBaseUrl()); 00119 return $this; 00120 }