Protected Member Functions | |
_toHtml () |
Definition at line 34 of file Preview.php.
_toHtml | ( | ) | [protected] |
Render block HTML
Reimplemented from Mage_Core_Block_Template.
Definition at line 37 of file Preview.php.
00038 { 00039 $template = Mage::getModel('newsletter/template'); 00040 if($id = (int)$this->getRequest()->getParam('id')) { 00041 $template->load($id); 00042 } else { 00043 $template->setTemplateType($this->getRequest()->getParam('type')); 00044 $template->setTemplateText($this->getRequest()->getParam('text')); 00045 } 00046 00047 Varien_Profiler::start("email_template_proccessing"); 00048 $vars = array(); 00049 00050 if($this->getRequest()->getParam('subscriber')) { 00051 $vars['subscriber'] = Mage::getModel('newsletter/subscriber') 00052 ->load($this->getRequest()->getParam('subscriber')); 00053 } 00054 00055 $templateProcessed = $template->getProcessedTemplate($vars, true); 00056 00057 if($template->isPlain()) { 00058 $templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>"; 00059 } 00060 00061 Varien_Profiler::stop("email_template_proccessing"); 00062 00063 return $templateProcessed; 00064 }