Skip to content
Snippets Groups Projects
Commit 7a43fc48 authored by Demian Katz's avatar Demian Katz
Browse files

Progress on VUFIND-505: created mechanism to allow more complex checkbox filters.

parent c9b3f189
No related merge requests found
...@@ -192,6 +192,9 @@ CallNumber = callnumber ...@@ -192,6 +192,9 @@ CallNumber = callnumber
; standard facet settings (defaults to "Results" if not specified), ; standard facet settings (defaults to "Results" if not specified),
; and [checkbox facet section] is the name of a section of the ini file ; and [checkbox facet section] is the name of a section of the ini file
; containing checkbox facet settings (leave blank for no checkbox facets). ; containing checkbox facet settings (leave blank for no checkbox facets).
; Checkbox facets are normally in filter => label format; prefix the section
; name with ~ to reverse this and use label => filter format (useful if your
; filters contain values that are illegal in configuration keys -- e.g. []).
; SummonDatabases:[GET parameter] ; SummonDatabases:[GET parameter]
; Display Summon-generated database recommendations matching the terms found ; Display Summon-generated database recommendations matching the terms found
; in the specified GET parameter. NOTE: If you are using this module with a ; in the specified GET parameter. NOTE: If you are using this module with a
......
...@@ -77,9 +77,16 @@ class SideFacets implements RecommendInterface ...@@ -77,9 +77,16 @@ class SideFacets implements RecommendInterface
} }
// Checkbox facets: // Checkbox facets:
if (substr($checkboxSection, 0, 1) == '~') {
$checkboxSection = substr($checkboxSection, 1);
$flipCheckboxes = true;
}
$this->checkboxFacets $this->checkboxFacets
= ($checkboxSection && isset($config->$checkboxSection)) = ($checkboxSection && isset($config->$checkboxSection))
? $config->$checkboxSection->toArray() : array(); ? $config->$checkboxSection->toArray() : array();
if ($flipCheckboxes) {
$this->checkboxFacets = array_flip($this->checkboxFacets);
}
} }
/** /**
......
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