Skip to content
Snippets Groups Projects
Commit 97ecf470 authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Support reversed checkbox facet sections in label loading.

parent 0237110f
No related merge requests found
...@@ -122,7 +122,9 @@ labelSections[] = Facets ...@@ -122,7 +122,9 @@ labelSections[] = Facets
; This setting lists configuration settings defining checkbox facets. If you use ; This setting lists configuration settings defining checkbox facets. If you use
; a custom section to configure additional facets, be sure to add it to this list ; a custom section to configure additional facets, be sure to add it to this list
; so labels display correctly in history, the advanced search editor, etc. ; so labels display correctly in history, the advanced search editor, etc. If you
; are using the reverse label => filter format rather than filter => label, you
; should prefix the section name with a ~ character to ensure proper loading.
checkboxSections[] = CheckboxFacets checkboxSections[] = CheckboxFacets
; Facet display settings ; Facet display settings
...@@ -229,14 +231,14 @@ organization_id = "VuFind 2.x from MyUniversity" ...@@ -229,14 +231,14 @@ organization_id = "VuFind 2.x from MyUniversity"
[List] [List]
view=full view=full
; This section controls the behavior of the Autocomplete of EDS ; This section controls the behavior of the Autocomplete of EDS
; If enabled the option "autocomplete" is send for UIDAuth to get the token ; If enabled the option "autocomplete" is send for UIDAuth to get the token
; and the url. ; and the url.
[Autocomplete] [Autocomplete]
; Set this to false to disable all autocomplete behavior ; Set this to false to disable all autocomplete behavior
enabled = true enabled = true
; Define a default_handler ; Define a default_handler
default_handler = Eds default_handler = Eds
; Auto-submit autocomplete on click or enter ; Auto-submit autocomplete on click or enter
...@@ -247,7 +249,7 @@ auto_submit = true ...@@ -247,7 +249,7 @@ auto_submit = true
; behavior when that search type is selected. (default: Eds:rawqueries) ; behavior when that search type is selected. (default: Eds:rawqueries)
; These values are available: None, Eds:rawqueries and Eds:holdings ; These values are available: None, Eds:rawqueries and Eds:holdings
; Use None to disable autocomplete for a specific search type ; Use None to disable autocomplete for a specific search type
; Use Eds:holdings for title completion in PubFinder. ; Use Eds:holdings for title completion in PubFinder.
; Use Eds:rawqueries for completion of basic textual queries. ; Use Eds:rawqueries for completion of basic textual queries.
[Autocomplete_Types] [Autocomplete_Types]
;AllFields = Eds:rawqueries ;AllFields = Eds:rawqueries
......
...@@ -108,7 +108,9 @@ labelSections[] = Facets ...@@ -108,7 +108,9 @@ labelSections[] = Facets
; This setting lists configuration settings defining checkbox facets. If you use ; This setting lists configuration settings defining checkbox facets. If you use
; a custom section to configure additional facets, be sure to add it to this list ; a custom section to configure additional facets, be sure to add it to this list
; so labels display correctly in history, the advanced search editor, etc. ; so labels display correctly in history, the advanced search editor, etc. If you
; are using the reverse label => filter format rather than filter => label, you
; should prefix the section name with a ~ character to ensure proper loading.
checkboxSections[] = CheckboxFacets checkboxSections[] = CheckboxFacets
; Checkbox facets are facets, which are getting displayed as checkboxes ; Checkbox facets are facets, which are getting displayed as checkboxes
......
...@@ -164,7 +164,9 @@ labelSections[] = Facets ...@@ -164,7 +164,9 @@ labelSections[] = Facets
; This setting lists configuration settings defining checkbox facets. If you use ; This setting lists configuration settings defining checkbox facets. If you use
; a custom section to configure additional facets, be sure to add it to this list ; a custom section to configure additional facets, be sure to add it to this list
; so labels display correctly in history, the advanced search editor, etc. ; so labels display correctly in history, the advanced search editor, etc. If you
; are using the reverse label => filter format rather than filter => label, you
; should prefix the section name with a ~ character to ensure proper loading.
checkboxSections[] = CheckboxFacets checkboxSections[] = CheckboxFacets
; Facet display settings ; Facet display settings
......
...@@ -39,7 +39,9 @@ labelSections[] = ExtraFacetLabels ...@@ -39,7 +39,9 @@ labelSections[] = ExtraFacetLabels
; This setting lists configuration settings defining checkbox facets. If you use ; This setting lists configuration settings defining checkbox facets. If you use
; a custom section to configure additional facets, be sure to add it to this list ; a custom section to configure additional facets, be sure to add it to this list
; so labels display correctly in history, the advanced search editor, etc. ; so labels display correctly in history, the advanced search editor, etc. If you
; are using the reverse label => filter format rather than filter => label, you
; should prefix the section name with a ~ character to ensure proper loading.
checkboxSections[] = CheckboxFacets checkboxSections[] = CheckboxFacets
; This section is used to specify labels for facets that may be applied by parts ; This section is used to specify labels for facets that may be applied by parts
......
...@@ -1797,11 +1797,19 @@ class Params ...@@ -1797,11 +1797,19 @@ class Params
) { ) {
$config = $this->configLoader $config = $this->configLoader
->get($cfgFile ?? $this->getOptions()->getFacetsIni()); ->get($cfgFile ?? $this->getOptions()->getFacetsIni());
if (empty($config->$facetList)) { $retVal = false;
return false; // If the section is in reverse order, the tilde will flag this:
} if (substr($facetList, 0, 1) == '~') {
foreach ($config->$facetList as $key => $value) { foreach ($config->{substr($facetList, 1)} as $value => $key) {
$this->addCheckboxFacet($key, $value); $this->addCheckboxFacet($key, $value);
$retVal = true;
}
} else {
foreach ($config->$facetList as $key => $value) {
$this->addCheckboxFacet($key, $value);
$retVal = true;
}
} }
return $retVal;
} }
} }
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