Example #1
1
 public function setCollection($collection)
 {
     if ((int) $this->getLimit()) {
         $collection->setPageSize($this->getLimit());
     }
     parent::setCollection($collection);
 }
Example #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 '';
 }
Example #3
0
 public function getLimitUrl($limit)
 {
     if (Mage::helper('seo')->getFullActionCode() == 'review_product_list') {
         return $this->getSeoReviewUrl(false, $limit);
     } else {
         return parent::getLimitUrl($limit);
     }
 }
 public function getPagerUrl($params = array())
 {
     $category = Mage::registry('current_category');
     if (!is_object($category)) {
         return parent::getPagerUrl($params);
     }
     $url = Mage::getModel('filterurls/catalog_layer_filter_item')->getSpeakingFilterUrl(FALSE, TRUE, $params);
     return $url;
 }
Example #5
0
 protected function _construct()
 {
     parent::_construct();
     if ($this->isAjaxPager()) {
         $this->setTemplate('gomage/navigation/html/pager.phtml');
     } else {
         $this->setTemplate('page/html/pager.phtml');
     }
 }
Example #6
0
 public function getPagerUrl($params = array())
 {
     if (!Mage::helper('sm_shopby')->isEnabled()) {
         return parent::getPagerUrl($params);
     }
     if ($this->helper('sm_shopby')->isCatalogSearch()) {
         $params['isLayerAjax'] = null;
         return parent::getPagerUrl($params);
     }
     return $this->helper('sm_shopby')->getPagerUrl($params);
 }
Example #7
0
 /**
  * Return the URL for a certain page of the collection
  *
  * @return string
  */
 public function getPagerUrl($params = array())
 {
     $limitVar = $this->getLimitVarName();
     $pageVar = $this->getPageVarName();
     if (isset($params[$limitVar]) && $params[$limitVar] == $this->getDefaultLimit()) {
         $params[$limitVar] = null;
     }
     if (isset($params[$pageVar]) && $params[$pageVar] == '1') {
         $params[$pageVar] = null;
     }
     return parent::getPagerUrl($params);
 }
Example #8
0
 public function getPagerUrl($params = array())
 {
     $innerParams = $this->getRequest()->getParams();
     $identifier = $innerParams['identifier'];
     $moduelUrl = $this->getUrl();
     $parentPath = parent::getPagerUrl($params);
     if (strpos($parentPath, '?') !== false) {
         $parts = explode('?', $parentPath);
         if (count($parts) == 2) {
             $_helper = Mage::helper('brand');
             $moduelUrl .= $_helper->getRoute() . '/' . $identifier . '.html/';
             $moduelUrl .= '?' . $parts[1];
         }
     }
     return $moduelUrl;
 }
Example #9
0
 /**
  * Get pager url with specific params
  *
  * @param array $params
  *
  * @return string
  */
 public function getPagerUrl($params = array())
 {
     if (!$this->_handler || !$this->_handler->getPaging()) {
         return parent::getPagerUrl($params);
     }
     $pageNum = $params['p'];
     if (!isset($this->_pagingUrls[$pageNum])) {
         $this->_pagingUrls[$pageNum] = '';
         /** @var \FACTFinder\Data\Page $pageItem */
         foreach ($this->_handler->getPaging() as $pageItem) {
             if ($pageItem->getPageNumber() == $pageNum) {
                 $this->_pagingUrls[$pageNum] = $pageItem->getUrl();
                 break;
             }
         }
     }
     return $this->_pagingUrls[$pageNum];
 }
Example #10
0
 public function getPage2Url($page)
 {
     return str_replace('?', '?', parent::getPage2Url($page));
 }
Example #11
0
 public function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->setTemplate('luckydraw/luckydraw/pager.phtml');
     return $this;
 }
 public function getPagerUrl($params = array())
 {
     $params['active_tab'] = 'labels';
     return parent::getPagerUrl($params);
 }
Example #13
0
 /**
  * Retrieve the frame pages array
  *
  * @return array
  */
 public function getFramePages()
 {
     return $this->isSimplePager() ? array() : parent::getFramePages();
 }
Example #14
0
 /**
  * Render block HTML
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->getLastPageNum() > 1) {
         return parent::_toHtml();
     } else {
         return '';
     }
 }
Example #15
0
 public function getAvailableLimit()
 {
     if ($this->getCurrentMode() == 'list') {
         $perPageValues = (string) Mage::getConfig()->getNode('frontend/catalog/per_page_values/list');
         $perPageValues = explode(',', $perPageValues);
         $perPageValues = array_combine($perPageValues, $perPageValues);
         return $perPageValues + array('all' => Mage::helper('catalog')->__('All'));
     } elseif ($this->getCurrentMode() == 'grid') {
         $perPageValues = (string) Mage::getConfig()->getNode('frontend/catalog/per_page_values/grid');
         $perPageValues = explode(',', $perPageValues);
         $perPageValues = array_combine($perPageValues, $perPageValues);
         return $perPageValues + array('all' => Mage::helper('catalog')->__('All'));
     }
     return parent::getAvailableLimit();
 }
Example #16
0
 public function getPageUrlParams($page)
 {
     $url = parent::getPageUrl($page);
     $clean_url = $url;
     if (strpos($url, "?") !== false) {
         $clean_url = substr($url, 0, strpos($url, '?'));
     }
     return str_replace($clean_url, "", $url);
 }
 /**
  * Retrieve available limits for current view mode
  *
  * @return array
  */
 public function getAvailableLimit()
 {
     if ($this->getCurrentMode() == 'list') {
         if (isset($this->_availableLimit['list'])) {
             return $this->_availableLimit['list'];
         }
         $perPageValues = (string) AO::getStoreConfig('catalog/frontend/list_per_page_values');
         $perPageValues = explode(',', $perPageValues);
         $perPageValues = array_combine($perPageValues, $perPageValues);
         return $perPageValues + array('all' => $this->__('All'));
     } elseif ($this->getCurrentMode() == 'grid') {
         if (isset($this->_availableLimit['grid'])) {
             return $this->_availableLimit['grid'];
         }
         $perPageValues = (string) AO::getStoreConfig('catalog/frontend/grid_per_page_values');
         $perPageValues = explode(',', $perPageValues);
         $perPageValues = array_combine($perPageValues, $perPageValues);
         return $perPageValues + array('all' => $this->__('All'));
     }
     return parent::getAvailableLimit();
 }
Example #18
-1
 protected function _construct()
 {
     parent::_construct();
     $this->_limitVarName = AW_Kbase_Helper_Url::URL_PARAM_NAME_LIMIT;
     $this->_pageVarName = AW_Kbase_Helper_Url::URL_PARAM_NAME_PAGE;
     if (($pageLimit = trim(Mage::getStoreConfig('kbase/general/articles_per_page'))) && count($pageLimit = array_filter(explode(',', $pageLimit), array($this, 'noEmptyValues')))) {
         $this->_availableLimit = array_combine($pageLimit, $pageLimit);
     }
 }
 /**
  * Construct the pager and set the limits
  *
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setPageVarName('page');
     $baseLimit = $this->helper('wordpress')->getWpOption('posts_per_page', 10);
     $this->setDefaultLimit($baseLimit);
     $this->setLimit($baseLimit);
     $this->setAvailableLimit(array($baseLimit => $baseLimit));
     $this->setFrameLength(5);
 }
Example #20
-1
 protected function _construct()
 {
     parent::_construct();
     $this->setData('show_amounts', true);
     $this->setData('use_container', true);
     if (Mage::helper('core')->isModuleEnabled('Ced_CsVendorPanel')) {
         $this->setTemplate('csmarketplace/html/pager.phtml');
     } else {
         $this->setTemplate('page/html/pager.phtml');
     }
 }
Example #21
-1
 protected function _construct()
 {
     parent::_construct();
 }
Example #22
-1
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('queldorei/priceslider/slider_pager.phtml');
 }
Example #23
-1
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('unirgy/ratings/vendor/pager.phtml');
 }