*/ class Mage_Adminhtml_Block_Review_Add_Form extends Mage_Adminhtml_Block_Widget_Form { protected function _prepareForm() { $statuses = Mage::getModel('review/review') ->getStatusCollection() ->load() ->toOptionArray(); $form = new Varien_Data_Form(); $fieldset = $form->addFieldset('add_review_form', array('legend' => Mage::helper('review')->__('Review Details'))); $fieldset->addField('product_name', 'note', array( 'label' => Mage::helper('review')->__('Product'), 'text' => 'product_name', )); $fieldset->addField('detailed_rating', 'note', array( 'label' => Mage::helper('review')->__('Product Rating'), 'required' => true, 'text' => '
' . $this->getLayout()->createBlock('adminhtml/review_rating_detailed')->toHtml() . '
', )); $fieldset->addField('status_id', 'select', array( 'label' => Mage::helper('review')->__('Status'), 'required' => true, 'name' => 'status_id', 'values' => $statuses, )); /** * Check is single store mode */ if (!Mage::app()->isSingleStoreMode()) { $field = $fieldset->addField('select_stores', 'multiselect', array( 'label' => Mage::helper('review')->__('Visible In'), 'required' => true, 'name' => 'select_stores[]', 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(), )); $renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element'); $field->setRenderer($renderer); } $fieldset->addField('nickname', 'text', array( 'name' => 'nickname', 'title' => Mage::helper('review')->__('Nickname'), 'label' => Mage::helper('review')->__('Nickname'), 'maxlength' => '50', 'required' => true, )); $fieldset->addField('title', 'text', array( 'name' => 'title', 'title' => Mage::helper('review')->__('Summary of Review'), 'label' => Mage::helper('review')->__('Summary of Review'), 'maxlength' => '255', 'required' => true, )); $fieldset->addField('detail', 'textarea', array( 'name' => 'detail', 'title' => Mage::helper('review')->__('Review'), 'label' => Mage::helper('review')->__('Review'), 'style' => 'height: 600px;', 'required' => true, )); $fieldset->addField('product_id', 'hidden', array( 'name' => 'product_id', )); /*$gridFieldset = $form->addFieldset('add_review_grid', array('legend' => Mage::helper('review')->__('Please select a product'))); $gridFieldset->addField('products_grid', 'note', array( 'text' => $this->getLayout()->createBlock('adminhtml/review_product_grid')->toHtml(), ));*/ $form->setMethod('post'); $form->setUseContainer(true); $form->setId('edit_form'); $form->setAction($this->getUrl('*/*/post')); $this->setForm($form); } }