Skip to content
Snippets Groups Projects
Commit 4f068dac authored by Robert Lange's avatar Robert Lange
Browse files

Revert refs #17407 [fid_bbi] replace bbi specific sources list by amsl values...

Revert refs #17407 [fid_bbi] replace bbi specific sources list by amsl values - List resources/sources via amsl.api

This reverts commit bfdbc646.
and commit d281e08a.
parent bfdbc646
No related merge requests found
;####################################################################
;##################### DO NOT DELETE THIS HEADER ####################
;################### Leipzig University Library © 2020 ##############
;
; This is the ISIL-instance-specific default INI-file and inherits
; all the settings from the INI-file defined in [Parent_Config] which
; points to the default INI-file located in the folder vufind2/local
;
[Parent_Config]
;relative_path = ../../../local/config/vufind/Amsl.ini
; A comma-separated list of config sections from the parent which should be
; completely overwritten by the equivalent sections in this configuration;
; any sections not listed here will be merged on a section-by-section basis.
;override_full_sections = "Languages,AlphaBrowse_Types"
;
; Add instance-specific customization after this header.
;
;##################### DO NOT DELETE THIS HEADER ####################
;####################################################################
[API]
;url = "https://live.amsl.technology/inhouseservices/list?do=catalog_metadataList&isil=DE-23"
url = "https://live.amsl.technology/inhouseservices/list?do=catalog_metadataList&isil=FID-BBI-DE-23"
response_type = 'application/json'
; Contains label patterns for two layers of source hierarchy
; these will normally be source and collection represented by main_label and sub_label, resp.
; use array_keys in double percent signs to be rendered in the labels
; the main label MUST contain the main key and the main key SHOULD identify the source
; same for the sub key and label
[Mapping]
main_key = 'source_id'
main_label = '%%source_id%%: %%source_label%%'
default_main_label = 'untitled source'
sub_key = 'collection_label'
sub_label = '%%collection_label%%'
default_sub_label = 'untilted collection'
......@@ -468,7 +468,4 @@ add_tag_success = "Tags gespeichert. Beachten Sie, dass Tags nach einer Woche ö
Open Access = Kostenfrei Zugänglich
#16470
Link to WorldCat record = "Link zum Datensatz des WorldCat"
; #17407
Amsl_Resources = "Liste der Datenquellen"
Link to WorldCat record = "Link zum Datensatz des WorldCat"
\ No newline at end of file
......@@ -461,7 +461,4 @@ add_tag_success = "Tags saved. Please remember that tags will be publicly visibl
Open Access = Free Access
#16470
Link to WorldCat record = "Link to WorldCat record"
; #17407
Amsl_Resources = "List of metadata sources"
Link to WorldCat record = "Link to WorldCat record"
\ No newline at end of file
......@@ -38,6 +38,7 @@ $config = [
'controllers' => [
'factories' => [
'fid_bbi\Controller\FeedbackController' => 'VuFind\Controller\AbstractBaseFactory',
'fid_bbi\Controller\SearchController' => 'VuFind\Controller\AbstractBaseFactory',
'fid_bbi\Controller\MyResearchController' => 'VuFind\Controller\AbstractBaseFactory',
'fid_bbi\Controller\RecordController' => 'VuFind\Controller\AbstractBaseWithConfigFactory',
'fid_bbi\Controller\BrowseController' => 'VuFind\Controller\AbstractBaseWithConfigFactory',
......@@ -45,6 +46,8 @@ $config = [
'aliases' => [
'feedback' => 'fid_bbi\Controller\FeedbackController',
'Feedback' => 'fid_bbi\Controller\FeedbackController',
'Search' => 'fid_bbi\Controller\SearchController',
'search' => 'fid_bbi\Controller\SearchController',
'Record' => 'fid_bbi\Controller\RecordController',
'record' => 'fid_bbi\Controller\RecordController',
'VuFind\Controller\MyResearchController' => 'fid_bbi\Controller\MyResearchController',
......@@ -189,7 +192,8 @@ $staticRoutes = [
'MyResearch/Usertags',
'dds/Home',
'dds/Email',
'Record/EblLink'
'Record/EblLink',
'Search/Sources'
];
$routeGenerator = new \VuFind\Route\RouteGenerator($nonTabRecordActions);
......
<?php
/**
* Default Controller
*
* PHP version 5
*
* Copyright (C) Villanova University 2010.
*
* 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 Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org Main Site
*/
namespace fid_bbi\Controller;
use VuFind\Controller\SearchController as BaseSearchController;
/**
* Redirects the user to the appropriate default VuFind action.
*
* @category VuFind
* @package Controller
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org Main Site
*/
class SearchController extends BaseSearchController
{
/**
* Home action
*
* @return mixed
*/
public function sourcesAction()
{
$homepageFacets = $this->getConfig('facets')->HomePage->toArray();
$facetCache = $this->serviceLocator
->get('VuFind\Search\FacetCache\PluginManager')
->get($this->searchClassId);
$facets = $facetCache->getList('Advanced');
$results = $facetCache->getResults();
$renderer = $this->getViewRenderer();
$facetList = [];
foreach ($homepageFacets as $facet => $label)
{
$facetList = array_merge(
$facetList,
$renderer->sortFacetList(
$results,
$facet,
$this->filterFacets(
$facets[$facet]['list'],
$facet
),
'search-results'
)
);
}
uasort($facetList,function ($a,$b) use ($renderer)
{
return strnatcmp(
ucfirst($renderer->translate('Facet::' . $a)),
ucfirst($renderer->translate('Facet::' . $b))
);
});
$view = $this->createViewModel(
[
'data' => $facetList,
'results' => $results
]
);
$view->setTemplate('search/sources.phtml');
return $view;
}
protected function filterFacets($facetList,$facet)
{
$whitelist = $this->getConfig('facets')->get('AllowFacetValue')->get($facet);
if (!empty($whitelist)) {
$whitelist = $whitelist->toArray();
$facetList
= array_filter(
$facetList,
function ($facet_info) use ($whitelist) {
return in_array($facet_info['value'], $whitelist);
}
);
}
return $facetList;
}
}
<!-- fid-bbi: footer -->
<?php /* Add link to Resources - #17407 - HR */?>
<!-- finc: footer -->
<footer class="hidden-print">
<div class="footer-container">
<div class="footer-column">
<p><strong><?=$this->transEsc('Search Options')?></strong></p>
<ul>
<li><a href="<?=$this->url('search-advanced')?>"><?=$this->transEsc('Advanced Search')?></a></li>
<li><a href="<?=$this->url('resources')?>"><?=$this->translate('Data Collection')?></a></li>
<li><a data-toggle="collapse" data-target="#searchbox-snippet"><?=$this->transEsc('embed_searchbox_button')?></a></li>
<li><a href="<?=$this->url('search-advanced')?>"><?=$this->transEsc('Advanced Search')?></a></li>
<li><a href="<?=$this->url('search-sources')?>"><?=$this->transEsc('Data Collection')?></a></li>
<li><a data-toggle="collapse" data-target="#searchbox-snippet"><?=$this->transEsc('embed_searchbox_button')?></a></li>
</ul>
</div>
<div class="footer-column">
<p><strong><?=$this->transEsc('More Information')?></strong></p>
<ul>
<li><a href="<?=$this->url('content-page', ['page' => 'about'])?>"><?=$this->transEsc('About Us')?></a></li>
<li><a href="<?=$this->url('content-page', ['page' => 'faq'])?>"><?=$this->transEsc('FAQs')?></a></li>
<li><a href="<?=$this->url('fid/user/terms')?>"><?=$this->transEsc('Terms of Use')?></a></li>
<li><a href="<?=$this->url('fid/user/policy')?>"><?=$this->transEsc('Privacy Policy')?></a></li>
<li><a href="<?=$this->url('content-page', ['page' => 'about'])?>"><?=$this->transEsc('About Us')?></a></li>
<li><a href="<?=$this->url('content-page', ['page' => 'faq'])?>"><?=$this->transEsc('FAQs')?></a></li>
<li><a href="<?=$this->url('fid/user/terms')?>"><?=$this->transEsc('Terms of Use')?></a></li>
<li><a href="<?=$this->url('fid/user/policy')?>"><?=$this->transEsc('Privacy Policy')?></a></li>
</ul>
</div>
<div class="footer-column">
......@@ -28,20 +26,20 @@
<?=$this->transEsc('Email')?>: <a data-lightbox href="<?=$this->url('feedback-home')?>">fid@hab.de</a></p>
</div>
<?php if ($this->permission()->allowDisplay('fid.ReadList')): ?>
<div class="footer-column">
<p><strong><?=$this->transEsc('fid::admin_section')?></strong></p>
<p><a href="<?=$this->url('fid/admin/list')?>"><?=$this->transEsc('fid::permission_read_user_list')?></a></p>
<p><a href="<?=$this->url('admin/tags', ['action' => 'List'])?>"><?=$this->transEsc('Tag Management')?></a></p>
</div>
<div class="footer-column">
<p><strong><?=$this->transEsc('fid::admin_section')?></strong></p>
<p><a href="<?=$this->url('fid/admin/list')?>"><?=$this->transEsc('fid::permission_read_user_list')?></a></p>
<p><a href="<?=$this->url('admin/tags', ['action' => 'List'])?>"><?=$this->transEsc('Tag Management')?></a></p>
</div>
<?php endif; ?>
</div>
<pre id="searchbox-snippet" class="collapse">
<strong><?=$this->transEsc('embed_searchbox_help',["%%bbi_url%%" => $this->url('home',[],['force_canonical'=>true])])?></strong>
<?=$this->escapeHtml('<!-- Search BBI -->
<form method="get" action="'.$this->url('search-results',[],['force_canonical'=>true]).'" name="bbisearch">
<strong><?=$this->transEsc('embed_searchbox_help',["%%bbi_url%%" => $this->url('home',[],['force_canonical'=>true])])?></strong>
<?=$this->escapeHtml('<!-- Search BBI -->
<form method="get" action="'.$this->url('search-results',[],['force_canonical'=>true]).'" name="bbisearch">
<input type="text" name="lookfor" class="inputbox" value="">
<input type="submit" name="btnBBI" value="BBI-Suche">
</form>
</form>
<!-- Search BBI - END -->')?></pre>
<?php /* finc branding footer */ ?>
<hr>
......@@ -57,4 +55,4 @@
<?php if ($this->fidisStatus): ?>
<div class="fidis-status"><?=$this->fidisStatus?></div>
<?php endif; ?>
<!-- fid-bbi: Footer - END -->
<!-- finc: Footer - END -->
<div class="searchHomeContent">
<div class="search-home-facets">
<div class="home-facet?>">
<h2><?=$this->transEsc('browse_sources')?></h2>
<div class="home-facet-container">
<ul class="home-facet-list">
<?php foreach ($data as $url => $value): ?>
<li><a href="<?=$url?>"><?=$this->transEsc('Facet::'.$value)?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
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