Esempio n. 1
1
 public function setCollection($collection)
 {
     if ((int) $this->getLimit()) {
         $collection->setPageSize($this->getLimit());
     }
     parent::setCollection($collection);
 }
Esempio n. 2
1
 public function pagerDirective($construction)
 {
     if ($this->_pagerBlock instanceof Mage_Page_Block_Html_Pager) {
         if (null === $this->_pagerBlock->getCollection()) {
             $params = $this->_getIncludeParameters($construction[2]);
             foreach ($params as $key => $value) {
                 switch ($key) {
                     case 'limits':
                         $limits = array_filter(explode("|", $value), 'is_numeric');
                         $limits = array_combine($limits, $limits);
                         $this->_pagerBlock->setAvailableLimit($limits);
                         break;
                     case 'frame_length':
                         $value = (int) $value;
                         if (0 > $value) {
                             $value = null;
                         }
                     case 'limit_var_name':
                     case 'page_var_name':
                         if (isset($value)) {
                             $method = 'set' . uc_words($key, '');
                             if (is_callable(array($this->_pagerBlock, $method))) {
                                 $this->_pagerBlock->{$method}($value);
                             }
                         }
                         break;
                 }
             }
             $this->_pagerBlock->setCollection($this->getCollection());
         }
         return $this->_pagerBlock->toHtml();
     }
     return '';
 }
Esempio n. 3
0
 /**
  * Custom setter for pager collection
  *
  * @param Varien_Data_Collection
  * @return Mage_Catalog_Block_Product_List_Toolbar_Pager
  */
 public function setCollection($collection)
 {
     parent::setCollection($collection);
     $this->_setFrameInitialized(false);
     return $this;
 }
Esempio n. 4
-1
 public function setCollection($collection)
 {
     parent::setCollection($collection);
     if ($this->getCurrentOrder()) {
         $this->getCollection()->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
     }
     return $this;
 }