_slider){ $slider = Mage::getModel('revslider/slider'); $id = $this->getRequest()->getParam('id', null); if (is_numeric($id)){ $slider->load($id); } $this->_slider = $slider; } return $this->_slider; } public function _prepareForm(){ /* @var $slider AM_RevSlider_Model_Slider */ $slider = $this->_getSlider(); $form = new Varien_Data_Form(); $fieldset1 = $form->addFieldset('css_fieldset', array( 'legend' => Mage::helper('revslider')->__('Static Styles') )); $fieldset1->addField('styles', 'text', array( 'name' => 'styles', 'label' => Mage::helper('revslider')->__('Slider Static Styles') )); $form->getElement('styles')->setRenderer( $this->getLayout()->createBlock('revslider/adminhtml_widget_form_editor', null, array( 'mode' => 'css' )) ); $fieldset2 = $form->addFieldset('js_fieldset', array( 'legend' => Mage::helper('revslider')->__('Custom Javascript') )); $fieldset2->addField('scripts', 'text', array( 'name' => 'scripts' )); $form->getElement('scripts')->setRenderer( $this->getLayout()->createBlock('revslider/adminhtml_widget_form_editor', null, array( 'mode' => 'javascript' )) ); $this->setForm($form); if ($slider->getId()){ $form->setValues($slider->getData()); } return parent::_prepareForm(); } }