*/ class Mage_XmlConnect_Block_Adminhtml_Template_Preview extends Mage_Adminhtml_Block_Widget { /** * Retrieve processed template * * @return string */ protected function _toHtml() { if ((int)$this->getRequest()->getParam('queue_preview')) { $id = $this->getRequest()->getParam('queue_preview'); /** @var $template Mage_XmlConnect_Model_Queue */ $template = Mage::getModel('xmlconnect/queue'); } else { $id = (int)$this->getRequest()->getParam('id'); /** @var $template Mage_XmlConnect_Model_Template */ $template = Mage::getModel('xmlconnect/template'); } if ($id) { $template->load($id); } $storeId = (int)$this->getRequest()->getParam('store_id'); if (!$storeId) { $storeId = Mage::app()->getDefaultStoreView()->getId(); } $template->emulateDesign($storeId); $templateProcessed = $template->getProcessedTemplate(array(), true); $template->revertDesign(); return $templateProcessed; } }