Protected Member Functions | |
_prepareForm () |
Definition at line 35 of file Form.php.
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Check is single store mode
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 37 of file Form.php.
00038 { 00039 $statuses = Mage::getModel('review/review') 00040 ->getStatusCollection() 00041 ->load() 00042 ->toOptionArray(); 00043 00044 $form = new Varien_Data_Form(); 00045 00046 $fieldset = $form->addFieldset('add_review_form', array('legend' => Mage::helper('review')->__('Review Details'))); 00047 00048 $fieldset->addField('product_name', 'note', array( 00049 'label' => Mage::helper('review')->__('Product'), 00050 'text' => 'product_name', 00051 )); 00052 00053 $fieldset->addField('detailed_rating', 'note', array( 00054 'label' => Mage::helper('review')->__('Product Rating'), 00055 'required' => true, 00056 'text' => '<div id="rating_detail">' . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() . '</div>', 00057 )); 00058 00059 $fieldset->addField('status_id', 'select', array( 00060 'label' => Mage::helper('review')->__('Status'), 00061 'required' => true, 00062 'name' => 'status_id', 00063 'values' => $statuses, 00064 )); 00065 00066 /** 00067 * Check is single store mode 00068 */ 00069 if (!Mage::app()->isSingleStoreMode()) { 00070 $fieldset->addField('select_stores', 'multiselect', array( 00071 'label' => Mage::helper('review')->__('Visible In'), 00072 'required' => true, 00073 'name' => 'select_stores[]', 00074 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm() 00075 )); 00076 } 00077 00078 $fieldset->addField('nickname', 'text', array( 00079 'name' => 'nickname', 00080 'title' => Mage::helper('review')->__('Nickname'), 00081 'label' => Mage::helper('review')->__('Nickname'), 00082 'maxlength' => '50', 00083 'required' => true, 00084 )); 00085 00086 $fieldset->addField('title', 'text', array( 00087 'name' => 'title', 00088 'title' => Mage::helper('review')->__('Summary of Review'), 00089 'label' => Mage::helper('review')->__('Summary of Review'), 00090 'maxlength' => '255', 00091 'required' => true, 00092 )); 00093 00094 $fieldset->addField('detail', 'textarea', array( 00095 'name' => 'detail', 00096 'title' => Mage::helper('review')->__('Review'), 00097 'label' => Mage::helper('review')->__('Review'), 00098 'style' => 'width: 98%; height: 600px;', 00099 'required' => true, 00100 )); 00101 00102 $fieldset->addField('product_id', 'hidden', array( 00103 'name' => 'product_id', 00104 )); 00105 00106 /*$gridFieldset = $form->addFieldset('add_review_grid', array('legend' => Mage::helper('review')->__('Please select a product'))); 00107 $gridFieldset->addField('products_grid', 'note', array( 00108 'text' => $this->getLayout()->createBlock('adminhtml/review_product_grid')->toHtml(), 00109 ));*/ 00110 00111 $form->setMethod('post'); 00112 $form->setUseContainer(true); 00113 $form->setId('edit_form'); 00114 $form->setAction($this->getUrl('*/*/post')); 00115 00116 $this->setForm($form); 00117 }