Skip to content
Snippets Groups Projects
Commit ef85a2fa authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Merge branch 'master' of https://github.com/vufind-org/vufind

parents 85e350e3 a9bf9de9
No related merge requests found
...@@ -8,6 +8,15 @@ default_sort = relevance ...@@ -8,6 +8,15 @@ default_sort = relevance
; should be one of the options present in the [Views] section below. ; should be one of the options present in the [Views] section below.
default_view = list 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 ; 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 ; 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 ; recognized regardless of case. If set to a comma-separated list of operators
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
; ;
; label = The header on the column ; label = The header on the column
; sublabel = Text to display below the header (optional) ; 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 ; ajax = If true, these results will load via AJAX; otherwise, they will load
; inline (default = false) ; inline (default = false)
; ;
......
...@@ -79,6 +79,15 @@ class Options extends \VuFind\Search\Base\Options ...@@ -79,6 +79,15 @@ class Options extends \VuFind\Search\Base\Options
// Load the search configuration file: // Load the search configuration file:
$searchSettings = $configLoader->get($this->searchIni); $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 // Set up highlighting preference
if (isset($searchSettings->General->highlighting)) { if (isset($searchSettings->General->highlighting)) {
$this->highlight = $searchSettings->General->highlighting; $this->highlight = $searchSettings->General->highlighting;
......
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
$recordTotal = $results->getResultTotal(); $recordTotal = $results->getResultTotal();
$moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1); $moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1);
?> ?>
<div style="float: right;"> <? if ($currentSearch['more_link']): ?>
<a href="<?=$moreUrl?>"><?=$this->transEsc('More options')?></a> <div style="float: right;">
</div> <a href="<?=$moreUrl?>"><?=$this->transEsc('More options')?></a>
</div>
<? endif; ?>
<h2><?=$this->transEsc($currentSearch['label'])?></h2> <h2><?=$this->transEsc($currentSearch['label'])?></h2>
<? if (isset($currentSearch['sublabel'])): ?> <? if (isset($currentSearch['sublabel'])): ?>
<p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p> <p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p>
...@@ -59,5 +61,7 @@ ...@@ -59,5 +61,7 @@
<? else: ?> <? else: ?>
<? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?> <? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?>
<?=$this->render('search/list-' . $viewType . '.phtml', array('results' => $results, 'params' => $params))?> <?=$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; ?> <? endif; ?>
...@@ -6,9 +6,11 @@ ...@@ -6,9 +6,11 @@
$recordTotal = $results->getResultTotal(); $recordTotal = $results->getResultTotal();
$moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1); $moreUrl = $this->url($params->getOptions()->getSearchAction()) . $results->getUrlQuery()->setPage(1);
?> ?>
<div class="pull-right"> <? if ($currentSearch['more_link']): ?>
<a href="<?=$moreUrl?>" class="btn btn-link"><i class="icon-gears"></i> <?=$this->transEsc('More options')?></a> <div class="pull-right">
</div> <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> <p class="lead"><?=$this->transEsc($currentSearch['label'])?></p>
<? if (isset($currentSearch['sublabel'])): ?> <? if (isset($currentSearch['sublabel'])): ?>
<p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p> <p><i><?=$this->transEsc($currentSearch['sublabel'])?></i></p>
...@@ -58,5 +60,7 @@ ...@@ -58,5 +60,7 @@
<? else: ?> <? else: ?>
<? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?> <? $viewType = in_array('list', array_keys($params->getViewList())) ? 'list' : $params->getView(); ?>
<?=$this->render('search/list-' . $viewType . '.phtml', array('results' => $results, 'params' => $params))?> <?=$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; ?> <? endif; ?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment