From 092e8f5c718b27686ca2c84b0f6506efb15a02a5 Mon Sep 17 00:00:00 2001 From: Rui Francisco <blackmolly@gmail.com> Date: Fri, 16 Oct 2015 10:41:24 -0400 Subject: [PATCH] Change EDS pagination to allow access to more results. - Adds mechanism to limit first/last page options due to limitations of EDS API. (You can access deep results, but not without accessing intermediate pages). --- module/VuFind/src/VuFind/Search/EDS/Options.php | 3 ++- themes/bootstrap3/templates/eds/search.phtml | 1 + themes/bootstrap3/templates/search/pagination.phtml | 8 ++++++-- themes/bootstrap3/templates/search/results.phtml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/module/VuFind/src/VuFind/Search/EDS/Options.php b/module/VuFind/src/VuFind/Search/EDS/Options.php index e73859e7559..1ce1eca4836 100644 --- a/module/VuFind/src/VuFind/Search/EDS/Options.php +++ b/module/VuFind/src/VuFind/Search/EDS/Options.php @@ -120,7 +120,8 @@ class Options extends \VuFind\Search\Base\Options $this->searchIni = $this->facetsIni = 'EDS'; $searchSettings = $configLoader->get($this->searchIni); parent::__construct($configLoader); - $this->resultLimit = 100; + // 2015-06-30 RF - Changed to unlimited + //$this->resultLimit = 100; $this->viewOptions = [ 'list|title' => 'Title View', 'list|brief' => 'Brief View', 'list|detailed' => 'Detailed View' diff --git a/themes/bootstrap3/templates/eds/search.phtml b/themes/bootstrap3/templates/eds/search.phtml index a1f2bef83e8..6894a00ae29 100644 --- a/themes/bootstrap3/templates/eds/search.phtml +++ b/themes/bootstrap3/templates/eds/search.phtml @@ -1,5 +1,6 @@ <? // Load standard settings from the default search results screen: $this->overrideSideFacetCaption = 'Refine Results'; + $this->paginationOptions = ['disableFirst' => true, 'disableLast' => true]; echo $this->render('search/results.phtml'); ?> \ No newline at end of file diff --git a/themes/bootstrap3/templates/search/pagination.phtml b/themes/bootstrap3/templates/search/pagination.phtml index fc194622507..b4c32f34512 100644 --- a/themes/bootstrap3/templates/search/pagination.phtml +++ b/themes/bootstrap3/templates/search/pagination.phtml @@ -1,7 +1,9 @@ <? if ($this->pageCount): ?> <ul class="pagination"> <? if (isset($this->previous)): ?> - <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>">[1]</a></li> + <? if (!isset($this->options['disableFirst']) || !$this->options['disableFirst']): ?> + <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>">[1]</a></li> + <? endif; ?> <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>">« <?=$this->transEsc('Prev')?></a></li> <? endif; ?> @@ -17,7 +19,9 @@ <? if (isset($this->next)): ?> <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->next)?>"><?=$this->transEsc('Next');?> »</a></li> - <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->pageCount)?>">[<?=$this->pageCount?>]</a></li> + <? if (!isset($this->options['disableLast']) || !$this->options['disableLast']): ?> + <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->pageCount)?>">[<?=$this->pageCount?>]</a></li> + <? endif; ?> <? endif; ?> </ul> <? endif; ?> \ No newline at end of file diff --git a/themes/bootstrap3/templates/search/results.phtml b/themes/bootstrap3/templates/search/results.phtml index ed3dc1d2454..1ed0fdced7d 100644 --- a/themes/bootstrap3/templates/search/results.phtml +++ b/themes/bootstrap3/templates/search/results.phtml @@ -103,7 +103,7 @@ <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?> <?=$this->render('search/list-' . $this->params->getView() . '.phtml')?> <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => 'bottom_'))?> - <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', array('results' => $this->results))?> + <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', array('results' => $this->results, 'options' => isset($this->paginationOptions) ? $this->paginationOptions : []))?> </form> <div class="searchtools hidden-print"> -- GitLab