Public Member Functions | |
__construct () | |
Protected Member Functions | |
_prepareForm () |
Definition at line 35 of file Form.php.
__construct | ( | ) |
Class constructor
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 37 of file Form.php.
00038 { 00039 parent::__construct(); 00040 $this->setId('tag_form'); 00041 $this->setTitle(Mage::helper('tag')->__('Block Information')); 00042 }
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 44 of file Form.php.
00045 { 00046 $model = Mage::registry('tag_tag'); 00047 00048 $form = new Varien_Data_Form(array( 00049 'id' => 'edit_form', 00050 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'), 'ret' => Mage::registry('ret'))), 00051 'method' => 'post' 00052 )); 00053 00054 $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('tag')->__('General Information'))); 00055 00056 if ($model->getTagId()) { 00057 $fieldset->addField('tag_id', 'hidden', array( 00058 'name' => 'tag_id', 00059 )); 00060 } 00061 00062 $fieldset->addField('name', 'text', array( 00063 'name' => 'name', 00064 'label' => Mage::helper('tag')->__('Tag Name'), 00065 'title' => Mage::helper('tag')->__('Tag Name'), 00066 'required' => true, 00067 )); 00068 00069 $fieldset->addField('status', 'select', array( 00070 'label' => Mage::helper('tag')->__('Status'), 00071 'title' => Mage::helper('tag')->__('Status'), 00072 'name' => 'status', 00073 'required' => true, 00074 'options' => array( 00075 Mage_Tag_Model_Tag::STATUS_DISABLED => Mage::helper('tag')->__('Disabled'), 00076 Mage_Tag_Model_Tag::STATUS_PENDING => Mage::helper('tag')->__('Pending'), 00077 Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('tag')->__('Approved'), 00078 ), 00079 )); 00080 00081 $form->setValues($model->getData()); 00082 $form->setUseContainer(true); 00083 $form->setAction( $this->getUrl($form->getAction(), array( 00084 'ret' => $this->getRequest()->getParam('ret'), 00085 'customer_id' => $this->getRequest()->getParam('customer_id'), 00086 'product_id' => $this->getRequest()->getParam('product_id'), 00087 ))); 00088 $this->setForm($form); 00089 return parent::_prepareForm(); 00090 }