protected function _toHtml()
 {
     if (self::$_helper->getEnabled()) {
         $parent = $this->getParentBlock();
         if (!$parent) {
             return null;
         }
         $showLeft = Mage::getStoreConfig('blog/menu/left');
         $showRight = Mage::getStoreConfig('blog/menu/right');
         $isBlogPage = Mage::app()->getRequest()->getModuleName() == AW_Blog_Helper_Data::DEFAULT_ROOT;
         $leftAllowed = $isBlogPage && $showLeft == 2 || $showLeft == 1;
         $rightAllowed = $isBlogPage && $showRight == 2 || $showRight == 1;
         if (!$leftAllowed && $parent->getNameInLayout() == 'left') {
             return null;
         }
         if (!$rightAllowed && $parent->getNameInLayout() == 'right') {
             return null;
         }
         return parent::_toHtml();
     }
 }
Beispiel #2
0
 public function _toHtml()
 {
     $contentFormat = Mage::getStoreConfig('blog/blog/contentformat');
     if ($this->getHasLayoutOptions() == 1) {
         if (!empty($contentFormat)) {
             $template = "aw_blog/" . $contentFormat . ".phtml";
             $this->setTemplate($template);
         }
     }
     if (Mage::helper('blog')->getEnabled()) {
         $isLeft = $this->getParentBlock() === $this->getLayout()->getBlock('left');
         $isRight = $this->getParentBlock() === $this->getLayout()->getBlock('right');
         $isBlogPage = Mage::app()->getFrontController()->getAction()->getRequest()->getModuleName() == 'blog';
         $leftAllowed = $isBlogPage && Mage::getStoreConfig('blog/menu/left') == 2 || Mage::getStoreConfig('blog/menu/left') == 1;
         $rightAllowed = $isBlogPage && Mage::getStoreConfig('blog/menu/right') == 2 || Mage::getStoreConfig('blog/menu/right') == 1;
         if (!$leftAllowed && $isLeft) {
             return '';
         }
         if (!$rightAllowed && $isRight) {
             return '';
         }
         try {
             if (Mage::getModel('widget/template_filter')) {
                 $processor = Mage::getModel('widget/template_filter');
             }
             return $processor->filter(parent::_toHtml());
         } catch (Exception $ex) {
             return parent::_toHtml();
         }
     }
 }
Beispiel #3
0
 protected function _toHtml()
 {
     return Mage::helper('blog')->filterWYS(parent::_toHtml());
 }