diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Factory.php b/module/VuFind/src/VuFind/View/Helper/Root/Factory.php index 676edbc1d06e4df25c80ff2a4de0919b5c8bb44f..1336e5d0ec613fcd69bf5d140697eaaff26c2a9d 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Factory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Factory.php @@ -381,6 +381,20 @@ class Factory ); } + /** + * Construct the SearchParams helper. + * + * @param ServiceManager $sm Service manager. + * + * @return SearchParams + */ + public static function getSearchParams(ServiceManager $sm) + { + return new SearchParams( + $sm->getServiceLocator()->get('VuFind\SearchParamsPluginManager') + ); + } + /** * Construct the SearchTabs helper. * diff --git a/module/VuFind/src/VuFind/View/Helper/Root/SearchParams.php b/module/VuFind/src/VuFind/View/Helper/Root/SearchParams.php new file mode 100644 index 0000000000000000000000000000000000000000..e054598088292a0215af8e8665b325a9445ec7a0 --- /dev/null +++ b/module/VuFind/src/VuFind/View/Helper/Root/SearchParams.php @@ -0,0 +1,70 @@ +<?php +/** + * "Retrieve search params" view helper + * + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:developer_manual Wiki + */ +namespace VuFind\View\Helper\Root; +use VuFind\Search\Params\PluginManager; + +/** + * "Retrieve search params" view helper + * + * @category VuFind2 + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:developer_manual Wiki + */ +class SearchParams extends \Zend\View\Helper\AbstractHelper +{ + /** + * Search manager + * + * @var PluginManager + */ + protected $manager; + + /** + * Constructor + * + * @param PluginManager $manager Search manager + */ + public function __construct(PluginManager $manager) + { + $this->manager = $manager; + } + + /** + * Wrapper to the options plugin manager + * + * @param string $type The search type of the object to retrieve + * + * @return \VuFind\Search\Base\Options + */ + public function __invoke($type = 'Solr') + { + return $this->manager->get($type); + } +} \ No newline at end of file diff --git a/themes/root/theme.config.php b/themes/root/theme.config.php index fc46a3eac552bc4e7b3cdeb0a8715b0c4d5c3352..895f82339ee4f0667c8d00676a119cd0d3040f29 100644 --- a/themes/root/theme.config.php +++ b/themes/root/theme.config.php @@ -28,6 +28,7 @@ return array( 'reviews' => array('VuFind\View\Helper\Root\Factory', 'getReviews'), 'searchbox' => array('VuFind\View\Helper\Root\Factory', 'getSearchBox'), 'searchoptions' => array('VuFind\View\Helper\Root\Factory', 'getSearchOptions'), + 'searchparams' => array('VuFind\View\Helper\Root\Factory', 'getSearchParams'), 'searchtabs' => array('VuFind\View\Helper\Root\Factory', 'getSearchTabs'), 'syndeticsplus' => array('VuFind\View\Helper\Root\Factory', 'getSyndeticsPlus'), 'systememail' => array('VuFind\View\Helper\Root\Factory', 'getSystemEmail'),