-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # module/LMS/src/LMS/Controller/MyResearchController.php
- Loading branch information
Showing
35 changed files
with
669 additions
and
549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
module/FacetPrefix/src/FacetPrefix/Search/Params/FacetRestrictionsTrait.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<?php | ||
/** | ||
* Trait to add facet prefix and matches settings to a Params object. | ||
* | ||
* PHP version 7 | ||
* | ||
* Copyright (C) Villanova University 2018. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
* @category VuFind | ||
* @package Search | ||
* @author Demian Katz <[email protected]> | ||
* @author Hajo Seng <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki | ||
*/ | ||
namespace FacetPrefix\Search\Params; | ||
|
||
use Zend\Config\Config; | ||
|
||
/** | ||
* Trait to add facet limiting settings to a Params object. | ||
* | ||
* @category VuFind | ||
* @package Search | ||
* @author Demian Katz <[email protected]> | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License | ||
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki | ||
*/ | ||
trait FacetRestrictionsTrait | ||
{ | ||
/** | ||
* Per-field facet prefix | ||
* | ||
* @var array | ||
*/ | ||
protected $facetPrefixByField = []; | ||
|
||
/** | ||
* Per-field facet matches | ||
* | ||
* @var array | ||
*/ | ||
protected $facetMatchesByField = []; | ||
|
||
/** | ||
* Initialize facet prefix and matches from a Config object. | ||
* | ||
* @param Config $config Configuration | ||
* | ||
* @return void | ||
*/ | ||
protected function initFacetRestrictionsFromConfig(Config $config = null) | ||
{ | ||
foreach ($config->facet_prefix_by_field ?? [] as $k => $v) { | ||
$this->facetPrefixByField[$k] = $v; | ||
} | ||
foreach ($config->facet_matches_by_field ?? [] as $k => $v) { | ||
$this->facetMatchesByField[$k] = $v; | ||
} | ||
} | ||
|
||
/** | ||
* Set Facet Prefix by Field | ||
* | ||
* @param array $new Associative array of $field name => $limit | ||
* | ||
* @return void | ||
*/ | ||
public function setFacetPrefixByField(array $new) | ||
{ | ||
$this->facetPrefixByField = $new; | ||
} | ||
|
||
/** | ||
* Set Facet Matches by Field | ||
* | ||
* @param array $new Associative array of $field name => $limit | ||
* | ||
* @return void | ||
*/ | ||
public function setFacetMatchesByField(array $new) | ||
{ | ||
$this->facetMatchesByField = $new; | ||
} | ||
|
||
/** | ||
* Get the facet prefix for the specified field. | ||
* | ||
* @param string $field Field to look up | ||
* | ||
* @return string | ||
*/ | ||
protected function getFacetPrefixForField($field) | ||
{ | ||
$prefix = $this->facetPrefixByField[$field] ?? ''; | ||
return $prefix; | ||
} | ||
|
||
/** | ||
* Get the facet matches for the specified field. | ||
* | ||
* @param string $field Field to look up | ||
* | ||
* @return string | ||
*/ | ||
protected function getFacetMatchesForField($field) | ||
{ | ||
$matches = $this->facetMatchesByField[$field] ?? ''; | ||
return $matches; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 0 additions & 67 deletions
67
module/FacetPrefix/src/FacetPrefix/Search/Primo/Params.php
This file was deleted.
Oops, something went wrong.
103 changes: 0 additions & 103 deletions
103
module/FacetPrefix/src/FacetPrefix/Search/Results/PluginManager.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.