Public Member Functions | |
__construct () | |
getModel () | |
Protected Member Functions | |
_prepareForm () |
Definition at line 35 of file Form.php.
__construct | ( | ) |
Define Form settings
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 41 of file Form.php.
00042 { 00043 parent::__construct(); 00044 }
_prepareForm | ( | ) | [protected] |
Prepare form before rendering HTML
Reimplemented from Mage_Adminhtml_Block_Widget_Form.
Definition at line 61 of file Form.php.
00062 { 00063 $model = $this->getModel(); 00064 $form = new Varien_Data_Form(array( 00065 'id' => 'edit_form', 00066 'action' => $this->getData('action'), 00067 'method' => 'post' 00068 )); 00069 00070 $fieldset = $form->addFieldset('base_fieldset', array( 00071 'legend' => Mage::helper('newsletter')->__('Template Information'), 00072 'class' => 'fieldset-wide' 00073 )); 00074 00075 if ($model->getId()) { 00076 $fieldset->addField('id', 'hidden', array( 00077 'name' => 'id', 00078 'value' => $model->getId(), 00079 )); 00080 } 00081 00082 $fieldset->addField('code', 'text', array( 00083 'name' => 'code', 00084 'label' => Mage::helper('newsletter')->__('Template Name'), 00085 'title' => Mage::helper('newsletter')->__('Template Name'), 00086 'required' => true, 00087 'value' => $model->getTemplateCode(), 00088 )); 00089 00090 $fieldset->addField('subject', 'text', array( 00091 'name' => 'subject', 00092 'label' => Mage::helper('newsletter')->__('Template Subject'), 00093 'title' => Mage::helper('newsletter')->__('Template Subject'), 00094 'required' => true, 00095 'value' => $model->getTemplateSubject(), 00096 )); 00097 00098 $fieldset->addField('sender_name', 'text', array( 00099 'name' =>'sender_name', 00100 'label' => Mage::helper('newsletter')->__('Sender Name'), 00101 'title' => Mage::helper('newsletter')->__('Sender Name'), 00102 'required' => true, 00103 'value' => $model->getTemplateSenderName(), 00104 )); 00105 00106 $fieldset->addField('sender_email', 'text', array( 00107 'name' =>'sender_email', 00108 'label' => Mage::helper('newsletter')->__('Sender Email'), 00109 'title' => Mage::helper('newsletter')->__('Sender Email'), 00110 'class' => 'validate-email', 00111 'required' => true, 00112 'value' => $model->getTemplateSenderEmail(), 00113 )); 00114 00115 $fieldset->addField('text', 'editor', array( 00116 'name' => 'text', 00117 'wysiwyg' => (!$model->isPlain()), 00118 'label' => Mage::helper('newsletter')->__('Template Content'), 00119 'title' => Mage::helper('newsletter')->__('Template Content'), 00120 'theme' => 'advanced', 00121 'required' => true, 00122 'state' => 'html', 00123 'style' => 'height:36em;', 00124 'value' => $model->getTemplateText(), 00125 )); 00126 00127 $form->setAction($this->getUrl('*/*/save')); 00128 $form->setUseContainer(true); 00129 $this->setForm($form); 00130 00131 return parent::_prepareForm(); 00132 }
getModel | ( | ) |
Retrieve template object
Definition at line 51 of file Form.php.
00052 { 00053 return Mage::registry('_current_template'); 00054 }