/**
  * 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;
 }
示例#3
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->setPosts($this->_getPostCollection());
     //		echo '<pre>'; print_r($this->getData());		exit;
     return $this;
 }
 /**
  * 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;
 }
示例#5
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     $this->getPagerBlock();
     parent::_beforeToHtml();
     $this->setPosts($this->_getPostCollection());
     return $this;
 }
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     if (!$this->getTemplate()) {
         $this->setTemplate('wordpress/sidebar/widget/image.phtml');
     }
     return $this;
 }
示例#7
0
 /**
  * Set the posts collection
  *
  */
 protected function _beforeToHtml()
 {
     if ($this->helper('wordpress/plugin_yarpp')->isEnabled()) {
         parent::_beforeToHtml();
         $this->setPosts($this->_getPostCollection());
     }
     return $this;
 }
示例#8
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;
 }
 /**
  * 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;
 }
示例#11
0
 /**
  * Load the RSS feed and items before the block is rendered
  *
  */
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     $this->getRssItems();
 }