Пример #1
0
 /**
  * Store the configuration of the recommendation module.
  *
  * @param string $settings Settings from searches.ini.
  *
  * @return void
  */
 public function setConfig($settings)
 {
     parent::setConfig($settings);
     $settings = explode(':', $settings);
     $iniName = isset($settings[2]) ? $settings[2] : 'facets';
     // Load the desired facet information...
     $config = $this->configLoader->get($iniName);
     if (isset($config->Results_Settings)) {
         $this->resultSettings = $config->Results_Settings->toArray();
     }
 }
Пример #2
0
 /**
  * Store the configuration of the recommendation module.
  *
  * @param string $settings Settings from searches.ini.
  *
  * @return void
  */
 public function setConfig($settings)
 {
     parent::setConfig($settings);
     // Parse the additional settings:
     $settings = explode(':', $settings);
     $mainSection = empty($settings[0]) ? 'Results' : $settings[0];
     $checkboxSection = isset($settings[1]) ? $settings[1] : false;
     $iniName = isset($settings[2]) ? $settings[2] : 'facets';
     // Load the desired facet information...
     $config = $this->configLoader->get($iniName);
     // New items facets
     if (isset($config->SpecialFacets->newItems)) {
         $this->newItemsFacets = $config->SpecialFacets->newItems->toArray();
     }
 }
Пример #3
0
 /**
  * Get a fully configured module
  *
  * @param \VuFind\Config\PluginManager                $configLoader config loader
  * @param \VuFind\Search\Solr\Results                 $results      results object
  * @param string                                      $settings     settings
  * @param \Zend\StdLib\Parameters                     $request      request
  * @param \VuFind\Search\Solr\HierarchicalFacetHelper $facetHelper  hierarchical facet helper (true to build default, null to omit)
  *
  * @return SideFacets
  */
 protected function getSideFacets($configLoader = null, $results = null, $settings = '', $request = null, $facetHelper = true)
 {
     if (null === $configLoader) {
         $configLoader = $this->getMockConfigLoader();
     }
     if (null === $results) {
         $results = $this->getMockResults();
     }
     if (true === $facetHelper) {
         $facetHelper = new \VuFind\Search\Solr\HierarchicalFacetHelper();
     }
     if (null === $request) {
         $request = new \Zend\StdLib\Parameters([]);
     }
     $sf = new SideFacets($configLoader, $facetHelper);
     $sf->setConfig($settings);
     $sf->init($results->getParams(), $request);
     $sf->process($results);
     return $sf;
 }