Mage_Adminhtml_Block_Newsletter_Template_Preview Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Newsletter_Template_Preview:

Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Protected Member Functions

 _toHtml ()


Detailed Description

Definition at line 34 of file Preview.php.


Member Function Documentation

_toHtml (  )  [protected]

Render block HTML

Returns:
string

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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:52 2009 for Magento by  doxygen 1.5.8