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

refs #15160 [fid_bbi] Whitelisting of mega_collection facet

parent 3df75700
No related merge requests found
......@@ -77,4 +77,33 @@ local_heading_facet_dezi4[] = "z";
local_heading_facet_dezi4[] = "g";
finc_class_facet[] = "not assigned"
language[] = "not assigned"
facet_avail[] = "Non-free"
\ No newline at end of file
facet_avail[] = "Non-free"
[AllowFacetValue]
mega_collection[] = "Social Theory"
mega_collection[] = "Springer Lecture Notes"
mega_collection[] = "Torrossa / Monografie"
mega_collection[] = "de Gruyter Online-Zeitschriften [Archiv]"
mega_collection[] = "de Gruyter Online-Zeitschriften / Linguistics, Literature and Humanities"
mega_collection[] = "Early English Books Online"
mega_collection[] = "Eighteenth Century Collections Online / ECCO"
mega_collection[] = "Gallica (BNF)"
mega_collection[] = "Qucosa"
mega_collection[] = "Hathi Trust"
;mega_collection[] = "OLC SSG Informations-, Buch- und Bibliothekswesen"
mega_collection[] = "Morgan & Claypool eBooks (CIS 5, 2013-2014)"
mega_collection[] = "MedienwRezensionen"
;mega_collection[] = "Torrossa / Periodici"
;mega_collection[] = "Emerald Fulltext Archive Database -2014"
;mega_collection[] = "Early Modern Pamphlets Online"
;mega_collection[] = "BASE"
;mega_collection[] = "TIB AV-Portal"
;mega_collection[] = "Olms Online"
; The following five mega_collections are all part of sid:159
; but there is no mega_collection entry in SOLR for those
;mega_collection[] = "Abendländische mittelalterliche Handschriften"
;mega_collection[] = "Abendländische neuzeitliche Handschriften"
;mega_collection[] = "Fragmente"
;mega_collection[] = "Griechische Handschriften"
;mega_collection[] = "Hebräische Handschriften"
......@@ -48,12 +48,25 @@ class SearchController extends BaseSearchController
*/
public function sourcesAction()
{
$facet = $this->params()->fromQuery('facet');
if (empty($facet)) {
$homepageFacet = key($this->getConfig('facets')->HomePage->toArray());
$homepageFacet = key($this->getConfig('facets')->HomePage->toArray());
if (empty($this->params()->fromQuery('facet'))) {
return $this->redirect()->toRoute('search-sources',[],['query'=>['facet'=>$homepageFacet]]);
}
$view = $this->facetListAction();
$facetList = $view->data;
$whitelist = $this->getConfig('facets')->get('AllowFacetValue')->get($homepageFacet);
if (!empty($whitelist)) {
$whitelist = $whitelist->toArray();
$facetList
= array_filter(
$facetList,
function ($facet_info) use ($whitelist) {
return in_array($facet_info['value'], $whitelist);
}
);
}
$view->setVariable('data', $facetList);
$view->setTemplate('search/sources.phtml');
return $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