diff --git a/config/vufind/Summon.ini b/config/vufind/Summon.ini index 7cc56c350b7edff1af0bd90a5346222925c479fa..cfa986fd9ffb0b8cdc72db11df7c88cf0c5fdaa7 100644 --- a/config/vufind/Summon.ini +++ b/config/vufind/Summon.ini @@ -8,6 +8,15 @@ default_sort = relevance ; should be one of the options present in the [Views] section below. default_view = list +; This section controls the result limit options for search results. default_limit +; sets the default number of results per page. limit_options is a comma-separated +; list of numbers to be presented to the end-user. If only one limit is required, +; set default_limit and leave limit_options commented out. +; WARNING: using large limits may require you to raise your PHP memory limits to +; avoid errors. +default_limit = 20 +;limit_options = 10,20,40,60,80,100 + ; If this setting is true, boolean operators in searches (AND/OR/NOT) will only ; be recognized if they are ALL UPPERCASE. If set to false, they will be ; recognized regardless of case. If set to a comma-separated list of operators diff --git a/config/vufind/combined.ini b/config/vufind/combined.ini index 3809c7475521f55dac5c0b90acc99f276a2d9ac9..7d658e6b06036f12bbcafd3211923d1515054111 100644 --- a/config/vufind/combined.ini +++ b/config/vufind/combined.ini @@ -4,7 +4,10 @@ ; ; label = The header on the column ; sublabel = Text to display below the header (optional) -; more_link = The text of the link to access more results +; more_link = The text of the link to access more results; set to false to +; disable all "more results" links for this entry. Note that disabling +; more_link will not impact the jquerymobile theme, which handles +; combined search in a simplified manner. ; ajax = If true, these results will load via AJAX; otherwise, they will load ; inline (default = false) ; diff --git a/module/VuFind/src/VuFind/Search/Summon/Options.php b/module/VuFind/src/VuFind/Search/Summon/Options.php index 6fe4c58c26193031837d0e601da68e91c959e026..af2f7a2eaf2e28c514ad40fdb0e7804386755064 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Options.php +++ b/module/VuFind/src/VuFind/Search/Summon/Options.php @@ -79,6 +79,15 @@ class Options extends \VuFind\Search\Base\Options // Load the search configuration file: $searchSettings = $configLoader->get($this->searchIni); + // Set up limit preferences + if (isset($searchSettings->General->default_limit)) { + $this->defaultLimit = $searchSettings->General->default_limit; + } + if (isset($searchSettings->General->limit_options)) { + $this->limitOptions + = explode(",", $searchSettings->General->limit_options); + } + // Set up highlighting preference if (isset($searchSettings->General->highlighting)) { $this->highlight = $searchSettings->General->highlighting; diff --git a/themes/blueprint/templates/combined/results-list.phtml b/themes/blueprint/templates/combined/results-list.phtml index 106aaf9c6b3a5cac6f1cd339cb327b95a4db04cd..3f022a3592aa1ada891b74c193cce7cfc4e99de0 100644 --- a/themes/blueprint/templates/combined/results-list.phtml +++ b/themes/blueprint/templates/combined/results-list.phtml @@ -6,9 +6,11 @@ $recordTotal = $results->getResultTotal(); $moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1); ?> -<div style="float: right;"> - <a href="<?=$moreUrl?>"><?=$this->transEsc('More options')?></a> -</div> +<? if ($currentSearch['more_link']): ?> + <div style="float: right;"> + <a href="<?=$moreUrl?>"><?=$this->transEsc('More options')?></a> + </div> +<? endif; ?> <h2><?=$this->transEsc($currentSearch['label'])?></h2> <? if (isset($currentSearch['sublabel'])): ?> <p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p> @@ -59,5 +61,7 @@ <? else: ?> <? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?> <?=$this->render('search/list-' . $viewType . '.phtml', array('results' => $results, 'params' => $params))?> - <p class="more_link"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?></a></p> + <? if ($currentSearch['more_link']): ?> + <p class="more_link"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?></a></p> + <? endif; ?> <? endif; ?> diff --git a/themes/bootstrap/templates/combined/results-list.phtml b/themes/bootstrap/templates/combined/results-list.phtml index b87ea646af2333dbeec3d767f6c65ac99d88df4c..444192f53488e8d966f2fedd24d60de7b0c1474e 100644 --- a/themes/bootstrap/templates/combined/results-list.phtml +++ b/themes/bootstrap/templates/combined/results-list.phtml @@ -6,9 +6,11 @@ $recordTotal = $results->getResultTotal(); $moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1); ?> -<div class="pull-right"> - <a href="<?=$moreUrl?>" class="btn btn-link"><i class="icon-gears"></i> <?=$this->transEsc('More options')?></a> -</div> +<? if ($currentSearch['more_link']): ?> + <div class="pull-right"> + <a href="<?=$moreUrl?>" class="btn btn-link"><i class="icon-gears"></i> <?=$this->transEsc('More options')?></a> + </div> +<? endif; ?> <p class="lead"><?=$this->transEsc($currentSearch['label'])?></p> <? if (isset($currentSearch['sublabel'])): ?> <p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p> @@ -58,5 +60,7 @@ <? else: ?> <? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?> <?=$this->render('search/list-' . $viewType . '.phtml', array('results' => $results, 'params' => $params))?> - <p class="pad text-right"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?> <i class="icon-long-arrow-right"></i></a></p> + <? if ($currentSearch['more_link']): ?> + <p class="pad text-right"><a href="<?=$moreUrl?>"><?=$this->transEsc($currentSearch['more_link'])?> <i class="icon-long-arrow-right"></i></a></p> + <? endif; ?> <? endif; ?>