Public Member Functions | |
__construct () | |
getBackButtonHtml () | |
getToggleButtonHtml () | |
getResetButtonHtml () | |
getToPlainButtonHtml () | |
getToHtmlButtonHtml () | |
getSaveButtonHtml () | |
getPreviewButtonHtml () | |
getDeleteButtonHtml () | |
getLoadButtonHtml () | |
getEditMode () | |
getHeaderText () | |
getFormHtml () | |
getSaveUrl () | |
getPreviewUrl () | |
isTextType () | |
getDeleteUrl () | |
getEmailTemplate () | |
getLocaleOptions () | |
getTemplateOptions () | |
getCurrentLocale () | |
getLoadUrl () | |
Protected Member Functions | |
_prepareLayout () |
Definition at line 35 of file Edit.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 39 of file Edit.php.
00040 { 00041 parent::__construct(); 00042 $this->setTemplate('system/email/template/edit.phtml'); 00043 Mage::register('email_template', Mage::getModel('core/email_template')); 00044 if ($templateId = (int) $this->getRequest()->getParam('id')) { 00045 $this->getEmailTemplate()->load($templateId); 00046 } 00047 }
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 49 of file Edit.php.
00050 { 00051 $this->setChild('back_button', 00052 $this->getLayout()->createBlock('adminhtml/widget_button') 00053 ->setData( 00054 array( 00055 'label' => Mage::helper('adminhtml')->__('Back'), 00056 'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'", 00057 'class' => 'back' 00058 ) 00059 ) 00060 ); 00061 00062 00063 $this->setChild('reset_button', 00064 $this->getLayout()->createBlock('adminhtml/widget_button') 00065 ->setData( 00066 array( 00067 'label' => Mage::helper('adminhtml')->__('Reset'), 00068 'onclick' => 'window.location.href = window.location.href' 00069 ) 00070 ) 00071 ); 00072 00073 00074 $this->setChild('delete_button', 00075 $this->getLayout()->createBlock('adminhtml/widget_button') 00076 ->setData( 00077 array( 00078 'label' => Mage::helper('adminhtml')->__('Delete Template'), 00079 'onclick' => 'templateControl.deleteTemplate();', 00080 'class' => 'delete' 00081 ) 00082 ) 00083 ); 00084 00085 $this->setChild('to_plain_button', 00086 $this->getLayout()->createBlock('adminhtml/widget_button') 00087 ->setData( 00088 array( 00089 'label' => Mage::helper('adminhtml')->__('Convert to Plain Text'), 00090 'onclick' => 'templateControl.stripTags();', 00091 'id' => 'convert_button' 00092 ) 00093 ) 00094 ); 00095 00096 00097 $this->setChild('to_html_button', 00098 $this->getLayout()->createBlock('adminhtml/widget_button') 00099 ->setData( 00100 array( 00101 'label' => Mage::helper('adminhtml')->__('Return Html Version'), 00102 'onclick' => 'templateControl.unStripTags();', 00103 'id' => 'convert_button_back', 00104 'style' => 'display:none' 00105 ) 00106 ) 00107 ); 00108 00109 $this->setChild('toggle_button', 00110 $this->getLayout()->createBlock('adminhtml/widget_button') 00111 ->setData( 00112 array( 00113 'label' => Mage::helper('adminhtml')->__('Toggle Editor'), 00114 'onclick' => 'templateControl.toggleEditor();', 00115 'id' => 'toggle_button' 00116 ) 00117 ) 00118 ); 00119 00120 00121 $this->setChild('preview_button', 00122 $this->getLayout()->createBlock('adminhtml/widget_button') 00123 ->setData( 00124 array( 00125 'label' => Mage::helper('adminhtml')->__('Preview Template'), 00126 'onclick' => 'templateControl.preview();' 00127 ) 00128 ) 00129 ); 00130 00131 $this->setChild('save_button', 00132 $this->getLayout()->createBlock('adminhtml/widget_button') 00133 ->setData( 00134 array( 00135 'label' => Mage::helper('adminhtml')->__('Save Template'), 00136 'onclick' => 'templateControl.save();', 00137 'class' => 'save' 00138 ) 00139 ) 00140 ); 00141 00142 $this->setChild('load_button', 00143 $this->getLayout()->createBlock('adminhtml/widget_button') 00144 ->setData( 00145 array( 00146 'label' => Mage::helper('adminhtml')->__('Load Template'), 00147 'onclick' => 'templateControl.load();', 00148 'type' => 'button', 00149 'class' => 'save' 00150 ) 00151 ) 00152 ); 00153 00154 00155 $this->setChild('form', 00156 $this->getLayout()->createBlock('adminhtml/system_email_template_edit_form') 00157 ); 00158 return parent::_prepareLayout(); 00159 }
getBackButtonHtml | ( | ) |
Definition at line 161 of file Edit.php.
00162 { 00163 return $this->getChildHtml('back_button'); 00164 }
getCurrentLocale | ( | ) |
getDeleteButtonHtml | ( | ) |
Definition at line 197 of file Edit.php.
00198 { 00199 return $this->getChildHtml('delete_button'); 00200 }
getDeleteUrl | ( | ) |
getEditMode | ( | ) |
Return edit flag for block
Definition at line 212 of file Edit.php.
00213 { 00214 return $this->getEmailTemplate()->getId(); 00215 }
getEmailTemplate | ( | ) |
Retrive email template model
Definition at line 282 of file Edit.php.
00283 { 00284 return Mage::registry('email_template'); 00285 }
getFormHtml | ( | ) |
Return form block HTML
Definition at line 237 of file Edit.php.
00238 { 00239 return $this->getChildHtml('form'); 00240 }
getHeaderText | ( | ) |
Return header text for form
Definition at line 222 of file Edit.php.
00223 { 00224 if($this->getEditMode()) { 00225 return Mage::helper('adminhtml')->__('Edit Email Template'); 00226 } 00227 00228 return Mage::helper('adminhtml')->__('New Email Template'); 00229 }
getLoadButtonHtml | ( | ) |
Definition at line 202 of file Edit.php.
00203 { 00204 return $this->getChildHtml('load_button'); 00205 }
getLoadUrl | ( | ) |
getLocaleOptions | ( | ) |
getPreviewButtonHtml | ( | ) |
Definition at line 192 of file Edit.php.
00193 { 00194 return $this->getChildHtml('preview_button'); 00195 }
getPreviewUrl | ( | ) |
getResetButtonHtml | ( | ) |
Definition at line 172 of file Edit.php.
00173 { 00174 return $this->getChildHtml('reset_button'); 00175 }
getSaveButtonHtml | ( | ) |
Definition at line 187 of file Edit.php.
00188 { 00189 return $this->getChildHtml('save_button'); 00190 }
getSaveUrl | ( | ) |
getTemplateOptions | ( | ) |
Definition at line 292 of file Edit.php.
00293 { 00294 return Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray(); 00295 }
getToggleButtonHtml | ( | ) |
Definition at line 166 of file Edit.php.
00167 { 00168 return $this->getChildHtml('toggle_button'); 00169 }
getToHtmlButtonHtml | ( | ) |
Definition at line 182 of file Edit.php.
00183 { 00184 return $this->getChildHtml('to_html_button'); 00185 }
getToPlainButtonHtml | ( | ) |
Definition at line 177 of file Edit.php.
00178 { 00179 return $this->getChildHtml('to_plain_button'); 00180 }
isTextType | ( | ) |
Definition at line 262 of file Edit.php.
00263 { 00264 return $this->getEmailTemplate()->isPlain(); 00265 }