/** * Add a field to facet on. * * @param string $newField Field name * @param string $newAlias Optional on-screen display label * @param bool $ored Should we treat this as an ORed facet? * * @return void */ public function addFacet($newField, $newAlias = null, $ored = false) { // Save the full field name (which may include extra parameters); // we'll need these to do the proper search using the Summon class: if (strstr($newField, 'PublicationDate')) { // Special case -- we don't need to send this to the Summon API, // but we do need to set a flag so VuFind knows to display the // date facet control. $this->dateFacetSettings[] = 'PublicationDate'; } else { $this->fullFacetSettings[] = $newField; } // Field name may have parameters attached -- remove them: $parts = explode(',', $newField); return parent::addFacet($parts[0], $newAlias, $ored); }
/** * Called at the end of the Search Params objects' initFromRequest() method. * This method is responsible for setting search parameters needed by the * recommendation module and for reading any existing search parameters that may * be needed. * * @param \VuFind\Search\Base\Params $params Search parameter object * @param \Zend\StdLib\Parameters $request Parameter object representing user * request. * * @return void */ public function init($params, $request) { // Turn on top facets in the search results: foreach ($this->facets as $name => $desc) { $params->addFacet($name, $desc, in_array($name, $this->orFacets)); } }
/** * init * * Called at the end of the Search Params objects' initFromRequest() method. * This method is responsible for setting search parameters needed by the * recommendation module and for reading any existing search parameters that may * be needed. * * @param \VuFind\Search\Base\Params $params Search parameter object * @param \Zend\StdLib\Parameters $request Parameter object representing user * request. * * @return void */ public function init($params, $request) { $filters = $params->getFilters(); foreach ($filters as $key => $value) { if ($key == $this->dateField) { $this->selectedDateRange = $value[0]; $params->addFacet($this->dateField, 'New acquisitions since'); } } }
/** * Called at the end of the Search Params objects' initFromRequest() method. * This method is responsible for setting search parameters needed by the * recommendation module and for reading any existing search parameters that may * be needed. * * @param \VuFind\Search\Base\Params $params Search parameter object * @param \Zend\StdLib\Parameters $request Parameter object representing user * request. * * @return void */ public function init($params, $request) { // Turn on side facets in the search results: foreach ($this->mainFacets as $name => $desc) { $params->addFacet($name, $desc, in_array($name, $this->orFacets)); } foreach ($this->checkboxFacets as $name => $desc) { $params->addCheckboxFacet($name, $desc); } }
/** * init * * Called at the end of the Search Params objects' initFromRequest() method. * This method is responsible for setting search parameters needed by the * recommendation module and for reading any existing search parameters that may * be needed. * * @param \VuFind\Search\Base\Params $params Search parameter object * @param \Zend\StdLib\Parameters $request Parameter object representing user * request. * * @return void */ public function init($params, $request) { $filters = $params->getFilters(); foreach ($filters as $key => $value) { if (isset($this->config[$key])) { $expFacet = $this->config[$key]; $params->addFacet($expFacet['field'], $expFacet['label']); } } }
/** * init * * Called at the end of the Search Params objects' initFromRequest() method. * This method is responsible for setting search parameters needed by the * recommendation module and for reading any existing search parameters that may * be needed. * * @param \VuFind\Search\Base\Params $params Search parameter object * @param \Zend\StdLib\Parameters $request Parameter object representing user * request. * * @return void */ public function init($params, $request) { // Turn on side facets in the search results: foreach ($this->facets as $name => $desc) { $params->addFacet($name, $desc); } }