diff --git a/fid_bbi/config/vufind/Amsl.ini b/fid_bbi/config/vufind/Amsl.ini deleted file mode 100644 index 2013d047618ef7610071143f96c856ce2ada316f..0000000000000000000000000000000000000000 --- a/fid_bbi/config/vufind/Amsl.ini +++ /dev/null @@ -1,40 +0,0 @@ -;#################################################################### -;##################### 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' diff --git a/fid_bbi/languages/de.ini b/fid_bbi/languages/de.ini index 186fff5d1faaf8d20e2e226252a938f141df99fb..2ecbdb61830a29fe03247bab2b9116ea61c4c6f6 100644 --- a/fid_bbi/languages/de.ini +++ b/fid_bbi/languages/de.ini @@ -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 diff --git a/fid_bbi/languages/en.ini b/fid_bbi/languages/en.ini index 604f5bfed927f929afd64758901edf612f1df9a5..9066bde008ed265b93137b3be646c03e2cd1597d 100644 --- a/fid_bbi/languages/en.ini +++ b/fid_bbi/languages/en.ini @@ -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 diff --git a/module/fid_bbi/config/module.config.php b/module/fid_bbi/config/module.config.php index 9f9768d83e75673dc1cb2da3c3746d316e3231a8..691199cf202c9114ecc619ba1452ff90d088bbf5 100644 --- a/module/fid_bbi/config/module.config.php +++ b/module/fid_bbi/config/module.config.php @@ -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); diff --git a/module/fid_bbi/src/fid_bbi/Controller/SearchController.php b/module/fid_bbi/src/fid_bbi/Controller/SearchController.php new file mode 100644 index 0000000000000000000000000000000000000000..8368696979a7087e77dfb85c49e4983faea135c0 --- /dev/null +++ b/module/fid_bbi/src/fid_bbi/Controller/SearchController.php @@ -0,0 +1,111 @@ +<?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; + } +} diff --git a/themes/fid_bbi/templates/footer.phtml b/themes/fid_bbi/templates/footer.phtml index 0ff0f2c663ce29f57d36e31d8ebdb18d1cc5194a..7a666c505a8d9522ec50b3e483244e62448f631f 100644 --- a/themes/fid_bbi/templates/footer.phtml +++ b/themes/fid_bbi/templates/footer.phtml @@ -1,23 +1,21 @@ -<!-- 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 --> diff --git a/themes/fid_bbi/templates/search/sources.phtml b/themes/fid_bbi/templates/search/sources.phtml new file mode 100644 index 0000000000000000000000000000000000000000..6b6b556e99d48dcf6512fa3e8082990b6a6ae3be --- /dev/null +++ b/themes/fid_bbi/templates/search/sources.phtml @@ -0,0 +1,15 @@ +<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>