/**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     if (!$this->getTemplate()) {
         $this->setTemplate('wordpress/sidebar/widget/categories.phtml');
     }
     return parent::_beforeToHtml();
 }
 /**
  * Load the RSS feed and items before the block is rendered
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->setFeedReady(false);
     if ($this->getFeedUrl() !== false) {
         if (($feed = $this->_getRssFeed($this->getFeedUrl())) !== false) {
             $this->setFeedTitle($feed->getTitle());
             $this->setFeedLink($feed->getLink());
             $this->setFeedDescription($feed->getDescription());
             $buffer = $feed->getItem();
             if (count($buffer) > 0) {
                 if (!isset($buffer[0]) && isset($buffer['title'])) {
                     $buffer = array($buffer);
                 }
                 $items = array();
                 foreach ($buffer as $item) {
                     if (($item = $this->_prepareFeedItem($item)) !== false) {
                         $items[] = $item;
                         $this->setFeedReady(true);
                     }
                 }
                 if (count($items) > $this->getMaxFeedItems()) {
                     $items = array_splice($items, 0, $this->getMaxFeedItems());
                 }
                 $this->setFeedItems($items);
             }
         }
     }
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Retrieve the block title
  *
  * @return string
  */
 public function getTitle()
 {
     if ($this->getPage() && $this->getPage()->hasChildren()) {
         return $this->getPage()->getPostTitle();
     }
     return parent::getTitle();
 }
 /**
  * Generate the Menu HTML
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $menuBlock = $this->getLayout()->createBlock('wordpress/menu')->setMenuId($this->getNavMenu())->includeWrapper(true);
     $this->setMenuBlock($menuBlock)->setMenuHtml($menuBlock->toHtml())->setTitle($menuBlock->getTitle());
     return $this;
 }
Exemplo n.º 5
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->setPosts($this->_getPostCollection());
     //		echo '<pre>'; print_r($this->getData());		exit;
     return $this;
 }
Exemplo n.º 6
0
 protected function _toHtml()
 {
     if ($this->helper('wordpress')->isPluginEnabled('twitter-widget-pro')) {
         return parent::_toHtml();
     }
     return '';
 }
Exemplo n.º 7
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     $this->getPagerBlock();
     parent::_beforeToHtml();
     $this->setPosts($this->_getPostCollection());
     return $this;
 }
 /**
  * Convert {{block tags to HTML
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($html = parent::_toHtml()) {
         return Mage::helper('cms')->getBlockTemplateProcessor()->filter($html);
     }
     return '';
 }
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     if (!$this->getTemplate()) {
         $this->setTemplate('wordpress/sidebar/widget/image.phtml');
     }
     return $this;
 }
Exemplo n.º 10
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     if ($this->helper('wordpress/plugin_yarpp')->isEnabled()) {
         parent::_beforeToHtml();
         $this->setPosts($this->_getPostCollection());
     }
     return $this;
 }
Exemplo n.º 11
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->setPosts($this->_getPostCollection());
     if (!$this->getTemplate()) {
         $this->setTemplate('wordpress/sidebar/widget/posts.phtml');
     }
     return $this;
 }
Exemplo n.º 12
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->_initDate();
     $this->_initPreviousNextLinks();
     if (!$this->getTemplate()) {
         $this->setTemplate('wordpress/sidebar/widget/calendar.phtml');
     }
     return $this;
 }
 /**
  * Load the options for the widget/block and set the posts
  *
  * @return $this
  */
 protected function _beforeToHtml()
 {
     if (!$this->isEnabled()) {
         return $this;
     }
     $options = unserialize($this->helper('wordpress')->getWpOption('yarpp'));
     if (is_array($options)) {
         if (isset($options['template'])) {
             $options['view'] = $options['template'];
             unset($options['template']);
         }
         $this->addData($options);
     }
     parent::_beforeToHtml();
     $this->setPosts($this->_getPostCollection());
     return $this;
 }
Exemplo n.º 14
0
 /**
  * Loads the Slick Social Buttons options into the block
  *
  */
 protected function _construct()
 {
     parent::_construct();
     if (($pluginOptions = $this->_getWpOption('dcssb_options', false)) !== false) {
         $options = unserialize($pluginOptions);
         foreach ($options as $key => $value) {
             $value = trim($value);
             if ($value === '') {
                 continue;
             } else {
                 if ($value === 'true') {
                     $value = true;
                 } else {
                     if ($value === 'false') {
                         $value = false;
                     }
                 }
             }
             $key = preg_replace('/([A-Z]{1,})/e', '"_" . strtolower($1);', $key);
             $this->setData($key, $value);
         }
     }
 }
Exemplo n.º 15
0
 /**
  * Load the RSS feed and items before the block is rendered
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->getRssItems();
 }