Skip to content
Snippets Groups Projects
Commit e50db01a authored by Dorian Merz's avatar Dorian Merz
Browse files

refs #17575 [fid_bbi] configure Browse page

* only allow tags browsing
* remove letter level from alphabetical search
parent e35d887a
Branches
Tags
No related merge requests found
...@@ -131,3 +131,25 @@ WorldcatTab = enabled ...@@ -131,3 +131,25 @@ WorldcatTab = enabled
EndNote = "record,bulk" EndNote = "record,bulk"
BibTeX = "record,bulk" BibTeX = "record,bulk"
RIS = "record,bulk" RIS = "record,bulk"
; This section controls the behavior of the Browse module. The result_limit
; setting controls the maximum number of results that may display in any given
; result box on the Browse screen. You can set to -1 for no limit; however,
; setting a very high (or no) limit may result in "out of memory" errors if you
; have a large index!
[Browse]
result_limit = 100
tag = true ; allow browsing of Tags
dewey = false ; allow browsing of Dewey Decimal call numbers
lcc = false ; allow browsing of LC call numbers
author = false ; allow browsing of authors
topic = false ; allow browsing of subject headings
genre = false ; allow browsing of genre subdivisions
region = false ; allow browsing of region subdivisions
era = false ; allow browsing of era subdivisions
; You can use this setting to change the default alphabet provided for browsing:
alphabet_letters = "AÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ"
; Uncomment to sort lists alphabetically (instead of by popularity); note that
; this will not changed the values returned -- you will still get only the
; <result_limit> most popular entries -- it only affects display order.
alphabetical_order = true
\ No newline at end of file
...@@ -38,6 +38,7 @@ $config = [ ...@@ -38,6 +38,7 @@ $config = [
'fid_bbi\Controller\SearchController' => 'VuFind\Controller\AbstractBaseFactory', 'fid_bbi\Controller\SearchController' => 'VuFind\Controller\AbstractBaseFactory',
'fid_bbi\Controller\MyResearchController' => 'VuFind\Controller\AbstractBaseFactory', 'fid_bbi\Controller\MyResearchController' => 'VuFind\Controller\AbstractBaseFactory',
'fid_bbi\Controller\RecordController' => 'VuFind\Controller\AbstractBaseWithConfigFactory', 'fid_bbi\Controller\RecordController' => 'VuFind\Controller\AbstractBaseWithConfigFactory',
'fid_bbi\Controller\BrowseController' => 'VuFind\Controller\AbstractBaseWithConfigFactory',
], ],
'aliases' => [ 'aliases' => [
'feedback' => 'fid_bbi\Controller\FeedbackController', 'feedback' => 'fid_bbi\Controller\FeedbackController',
...@@ -47,6 +48,7 @@ $config = [ ...@@ -47,6 +48,7 @@ $config = [
'Record' => 'fid_bbi\Controller\RecordController', 'Record' => 'fid_bbi\Controller\RecordController',
'record' => 'fid_bbi\Controller\RecordController', 'record' => 'fid_bbi\Controller\RecordController',
'VuFind\Controller\MyResearchController' => 'fid_bbi\Controller\MyResearchController', 'VuFind\Controller\MyResearchController' => 'fid_bbi\Controller\MyResearchController',
'VuFind\Controller\BrowseController' => 'fid_bbi\Controller\BrowseController',
], ],
], ],
'vufind' => [ 'vufind' => [
......
<?php
/**
* Browse Module Controller
*
* PHP version 7
*
* Copyright (C) Villanova University 2011.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category VuFind
* @package Controller
* @author Chris Hallberg <challber@villanova.edu>
* @author Dorian Merz <merz@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:controllers Wiki
*/
namespace fid_bbi\Controller;
use VuFind\Controller\BrowseController as BaseController;
/**
* BrowseController Class
*
* Controls the browsing feature
*
* This fid_bbi specific instance removes the letter
* level for alphabetical tag browsing
*
* @category VuFind
* @package Controller
* @author Dorian Merz <merz@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:controllers Wiki
*/
class BrowseController extends BaseController
{
/**
* Browse tags
* this is mostly a copy of the
* parent method with the alphabetical special case
* removed
*
* @return \Zend\View\Model\ViewModel
*/
public function tagAction()
{
if (!$this->tagsEnabled()) {
throw new ForbiddenException('Tags disabled.');
}
$this->setCurrentAction('Tag');
$view = $this->createViewModel();
$view->categoryList = [
'alphabetical' => 'By Alphabetical',
'popularity' => 'By Popularity',
'recent' => 'By Recent'
];
if ($this->params()->fromQuery('findby')) {
$params = $this->getRequest()->getQuery()->toArray();
$tagTable = $this->getTable('Tags');
// Default case: always display tag list for non-alphabetical modes:
$tagList = $tagTable->getTagList(
$params['findby'],
$this->config->Browse->result_limit
);
$resultList = [];
foreach ($tagList as $i => $tag) {
$resultList[$i] = [
'displayText' => $tag['tag'],
'value' => $tag['tag'],
'count' => $tag['cnt']
];
}
$view->resultList = $resultList;
$view->paramTitle = 'lookfor=';
$view->searchParams = [];
}
return $this->performSearch($view);
}
}
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