diff --git a/module/VuFind/src/VuFind/Recommend/AuthorFacets.php b/module/VuFind/src/VuFind/Recommend/AuthorFacets.php index 3233bce2b5676abb0079d3b03bdddc845c7ac4e8..8a96c93ef08c9ad2da9cdce321d8ec4364555c5b 100644 --- a/module/VuFind/src/VuFind/Recommend/AuthorFacets.php +++ b/module/VuFind/src/VuFind/Recommend/AuthorFacets.php @@ -51,13 +51,15 @@ class AuthorFacets implements RecommendInterface protected $searchObject; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Save the basic parameters: $this->settings = $settings; diff --git a/module/VuFind/src/VuFind/Recommend/AuthorInfo.php b/module/VuFind/src/VuFind/Recommend/AuthorInfo.php index bc54993900c1e6005fb160f05d6cd1e3809554e1..8f9d68f3aaef25d75f6799efdf15abd23e0e01b2 100644 --- a/module/VuFind/src/VuFind/Recommend/AuthorInfo.php +++ b/module/VuFind/src/VuFind/Recommend/AuthorInfo.php @@ -48,13 +48,15 @@ class AuthorInfo implements RecommendInterface protected $lang; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $translator = Translator::getTranslator(); $this->lang = is_object($translator) ? $translator->getLocale() : 'en'; diff --git a/module/VuFind/src/VuFind/Recommend/AuthorityRecommend.php b/module/VuFind/src/VuFind/Recommend/AuthorityRecommend.php index ab8fdd2e94c214c5b7be25e92aad3320a43640fe..e68c1558b350668846b335a9d9bd4f5679b4e0fa 100644 --- a/module/VuFind/src/VuFind/Recommend/AuthorityRecommend.php +++ b/module/VuFind/src/VuFind/Recommend/AuthorityRecommend.php @@ -58,13 +58,15 @@ class AuthorityRecommend implements RecommendInterface protected $results = array(); /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $params = explode(':', $settings); for ($i = 0; $i < count($params); $i += 2) { diff --git a/module/VuFind/src/VuFind/Recommend/EuropeanaResults.php b/module/VuFind/src/VuFind/Recommend/EuropeanaResults.php index 8e21fe248d8ec6fdd08548e7e83e57433664d0d3..c57d644de799699f85c61dfe664e66dbd88457a5 100644 --- a/module/VuFind/src/VuFind/Recommend/EuropeanaResults.php +++ b/module/VuFind/src/VuFind/Recommend/EuropeanaResults.php @@ -55,13 +55,15 @@ class EuropeanaResults implements RecommendInterface protected $results; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Parse out parameters: $params = explode(':', $settings); diff --git a/module/VuFind/src/VuFind/Recommend/EuropeanaResultsDeferred.php b/module/VuFind/src/VuFind/Recommend/EuropeanaResultsDeferred.php index 0691eb35d0ebccc076608dd7834c3b037abf7fb9..e4afb7ccd22ef4ee8eaeaeba4485ba6631a82efb 100644 --- a/module/VuFind/src/VuFind/Recommend/EuropeanaResultsDeferred.php +++ b/module/VuFind/src/VuFind/Recommend/EuropeanaResultsDeferred.php @@ -47,13 +47,15 @@ class EuropeanaResultsDeferred implements RecommendInterface protected $processedParams; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $this->rawParams = $settings; } diff --git a/module/VuFind/src/VuFind/Recommend/ExpandFacets.php b/module/VuFind/src/VuFind/Recommend/ExpandFacets.php index 0baa798bb1c1821761d1c28d092ae616cfa6c85b..16a8f7151fcf685006758dd20492715dcf750b4f 100644 --- a/module/VuFind/src/VuFind/Recommend/ExpandFacets.php +++ b/module/VuFind/src/VuFind/Recommend/ExpandFacets.php @@ -44,13 +44,15 @@ class ExpandFacets implements RecommendInterface protected $searchObject; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Save the basic parameters: $this->settings = $settings; diff --git a/module/VuFind/src/VuFind/Recommend/FavoriteFacets.php b/module/VuFind/src/VuFind/Recommend/FavoriteFacets.php index a05df435463b9fea2eee7e18917e96a4eca70a76..69a050f56dec7655211b059e5d2e3c82ef82a36f 100644 --- a/module/VuFind/src/VuFind/Recommend/FavoriteFacets.php +++ b/module/VuFind/src/VuFind/Recommend/FavoriteFacets.php @@ -41,13 +41,15 @@ namespace VuFind\Recommend; class FavoriteFacets extends SideFacets { /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $this->mainFacets = array('lists' => 'Your Lists', 'tags' => 'Your Tags'); } diff --git a/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjects.php b/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjects.php index 23ffe6e81c7ca1fb7bbfcd81c7dbce8d64faf5f5..02765da8a31e5127f7c5b19b60c89d91b610960e 100644 --- a/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjects.php +++ b/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjects.php @@ -53,13 +53,15 @@ class OpenLibrarySubjects implements RecommendInterface protected $result = false; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Parse out parameters: $params = explode(':', $settings); diff --git a/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjectsDeferred.php b/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjectsDeferred.php index a69a8e8b8ae2c215eb17004e4780959890c866c8..bed5ccdb8dc2a413910dff93dee8a8991f4fe31b 100644 --- a/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjectsDeferred.php +++ b/module/VuFind/src/VuFind/Recommend/OpenLibrarySubjectsDeferred.php @@ -47,13 +47,15 @@ class OpenLibrarySubjectsDeferred extends OpenLibrarySubjects protected $processedParams; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $this->rawParams = $settings; } diff --git a/module/VuFind/src/VuFind/Recommend/PubDateVisAjax.php b/module/VuFind/src/VuFind/Recommend/PubDateVisAjax.php index c952267799ee64a8dc47afd2051cfdb5bdf919d3..110333c59ee525ac4b9ac7b937bbc4ed4c0d6662 100644 --- a/module/VuFind/src/VuFind/Recommend/PubDateVisAjax.php +++ b/module/VuFind/src/VuFind/Recommend/PubDateVisAjax.php @@ -47,13 +47,15 @@ class PubDateVisAjax implements RecommendInterface protected $dateFacets = array(); /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Save the basic parameters: $this->settings = $settings; diff --git a/module/VuFind/src/VuFind/Recommend/RecommendInterface.php b/module/VuFind/src/VuFind/Recommend/RecommendInterface.php index 034c6141ed02750f9d743b11f266cbf886e858cb..47a3e59b09e11b8cff28b844340a6da56751c9e8 100644 --- a/module/VuFind/src/VuFind/Recommend/RecommendInterface.php +++ b/module/VuFind/src/VuFind/Recommend/RecommendInterface.php @@ -49,13 +49,15 @@ namespace VuFind\Recommend; interface RecommendInterface { /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings); + public function setConfig($settings); /** * init diff --git a/module/VuFind/src/VuFind/Recommend/ResultGoogleMapAjax.php b/module/VuFind/src/VuFind/Recommend/ResultGoogleMapAjax.php index ec4879b65f21ed0ed4669431a997500d60ca1c4f..3b27714378e637c2ffadf11f9407d4e346f978e3 100644 --- a/module/VuFind/src/VuFind/Recommend/ResultGoogleMapAjax.php +++ b/module/VuFind/src/VuFind/Recommend/ResultGoogleMapAjax.php @@ -47,13 +47,15 @@ class ResultGoogleMapAjax implements RecommendInterface protected $searchObject; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // No special settings } diff --git a/module/VuFind/src/VuFind/Recommend/SearchObject.php b/module/VuFind/src/VuFind/Recommend/SearchObject.php index 8f0409b24886a4b7200a3b5bb17fa207347fff44..7c78ecd6bd05921373d81304b105ebdb53fc8dd8 100644 --- a/module/VuFind/src/VuFind/Recommend/SearchObject.php +++ b/module/VuFind/src/VuFind/Recommend/SearchObject.php @@ -45,13 +45,15 @@ abstract class SearchObject implements RecommendInterface protected $requestParam; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $settings = explode(':', $settings); $this->requestParam = empty($settings[0]) ? 'lookfor' : $settings[0]; diff --git a/module/VuFind/src/VuFind/Recommend/SideFacets.php b/module/VuFind/src/VuFind/Recommend/SideFacets.php index 1ed92c9afc807d4ca7b2c4d9915f848495e40fd2..9460e96c322bb1840108062bfcdc03378bc476a3 100644 --- a/module/VuFind/src/VuFind/Recommend/SideFacets.php +++ b/module/VuFind/src/VuFind/Recommend/SideFacets.php @@ -47,13 +47,15 @@ class SideFacets implements RecommendInterface protected $results; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Parse the additional settings: $settings = explode(':', $settings); diff --git a/module/VuFind/src/VuFind/Recommend/SummonDatabases.php b/module/VuFind/src/VuFind/Recommend/SummonDatabases.php index b5fabcfcc0638fedcad9df2e31e390c96df3bfb4..6a01be66bacc83dfde311bdf30d789dd8a1919f4 100644 --- a/module/VuFind/src/VuFind/Recommend/SummonDatabases.php +++ b/module/VuFind/src/VuFind/Recommend/SummonDatabases.php @@ -43,21 +43,23 @@ use VuFind\Search\Summon\Params as SummonParams, class SummonDatabases implements RecommendInterface { protected $databases; - protected $requestParam; + protected $requestParam = 'lookfor'; protected $lookfor; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Only one setting -- HTTP request field containing search terms (ignored // if $searchObject is Summon type). - $this->requestParam = empty($settings) ? 'lookfor' : $settings; + $this->requestParam = empty($settings) ? $this->requestParam : $settings; } /** diff --git a/module/VuFind/src/VuFind/Recommend/SwitchType.php b/module/VuFind/src/VuFind/Recommend/SwitchType.php index 4753020aeb65f200654ad3d6c06bb5178dba9eeb..85c080511a57e6391ed8d87f3a182d7386f4954b 100644 --- a/module/VuFind/src/VuFind/Recommend/SwitchType.php +++ b/module/VuFind/src/VuFind/Recommend/SwitchType.php @@ -47,17 +47,15 @@ class SwitchType implements RecommendInterface protected $active; // is this module active? /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. * - * TopFacets:[ini section]:[ini name] - * Display facets listed in the specified section of the specified ini file; - * if [ini name] is left out, it defaults to "facets." + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $params = explode(':', $settings); $this->newHandler = !empty($params[0]) ? $params[0] : 'AllFields'; diff --git a/module/VuFind/src/VuFind/Recommend/TopFacets.php b/module/VuFind/src/VuFind/Recommend/TopFacets.php index 9306a7dd770ef70f22fce4f1ec31887db789d4fb..304848eb8e318492735f419d14af3f5589e10873 100644 --- a/module/VuFind/src/VuFind/Recommend/TopFacets.php +++ b/module/VuFind/src/VuFind/Recommend/TopFacets.php @@ -48,17 +48,19 @@ class TopFacets implements RecommendInterface protected $results; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. - * - * @param string $settings Settings from searches.ini. + * Store the configuration of the recommendation module. * * TopFacets:[ini section]:[ini name] * Display facets listed in the specified section of the specified ini file; * if [ini name] is left out, it defaults to "facets." + * + * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { $settings = explode(':', $settings); $mainSection = empty($settings[0]) ? 'ResultsTop':$settings[0]; diff --git a/module/VuFind/src/VuFind/Recommend/WorldCatIdentities.php b/module/VuFind/src/VuFind/Recommend/WorldCatIdentities.php index 7f80a48cc5f1f4e62c3d9aaca9b23dc472e73c1f..13d386302761f18e3dce4df55319f6b5d19f6470 100644 --- a/module/VuFind/src/VuFind/Recommend/WorldCatIdentities.php +++ b/module/VuFind/src/VuFind/Recommend/WorldCatIdentities.php @@ -45,13 +45,15 @@ class WorldCatIdentities implements RecommendInterface protected $settings; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Save the basic parameters: $this->settings = $settings; diff --git a/module/VuFind/src/VuFind/Recommend/WorldCatTerms.php b/module/VuFind/src/VuFind/Recommend/WorldCatTerms.php index 9c8884d4a80a0a96ccec65c9808f2d6f42ce08e6..58bc4c3844ef614734ce15499d9bab052bd0e961 100644 --- a/module/VuFind/src/VuFind/Recommend/WorldCatTerms.php +++ b/module/VuFind/src/VuFind/Recommend/WorldCatTerms.php @@ -42,16 +42,18 @@ use VuFind\Connection\WorldCatUtils; class WorldCatTerms implements RecommendInterface { protected $searchObject; - protected $vocab; + protected $vocab = 'lcsh'; /** - * Constructor + * setConfig * - * Establishes base settings for making recommendations. + * Store the configuration of the recommendation module. * * @param string $settings Settings from searches.ini. + * + * @return void */ - public function __construct($settings) + public function setConfig($settings) { // Pick a vocabulary (either user-specified, or LCSH by default): $params = trim($settings); diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index 5d73d9b8a73fe9d45e27a2875dc490af4a546201..3040edc274be0d1bb0d606f15940f78568ac222f 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -818,7 +818,8 @@ class Params implements ServiceLocatorAwareInterface // Build a recommendation module with the provided settings. if (class_exists($class)) { - $obj = new $class($params); + $obj = new $class(); + $obj->setConfig($params); $obj->init($this, $request); $this->recommend[$location][] = $obj; } else {