Skip to content
Snippets Groups Projects
Commit 8c536f3c authored by Demian Katz's avatar Demian Katz
Browse files

Added SearchParams helper.

parent 63260a3b
No related merge requests found
...@@ -381,6 +381,20 @@ class Factory ...@@ -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. * Construct the SearchTabs helper.
* *
......
<?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
...@@ -28,6 +28,7 @@ return array( ...@@ -28,6 +28,7 @@ return array(
'reviews' => array('VuFind\View\Helper\Root\Factory', 'getReviews'), 'reviews' => array('VuFind\View\Helper\Root\Factory', 'getReviews'),
'searchbox' => array('VuFind\View\Helper\Root\Factory', 'getSearchBox'), 'searchbox' => array('VuFind\View\Helper\Root\Factory', 'getSearchBox'),
'searchoptions' => array('VuFind\View\Helper\Root\Factory', 'getSearchOptions'), 'searchoptions' => array('VuFind\View\Helper\Root\Factory', 'getSearchOptions'),
'searchparams' => array('VuFind\View\Helper\Root\Factory', 'getSearchParams'),
'searchtabs' => array('VuFind\View\Helper\Root\Factory', 'getSearchTabs'), 'searchtabs' => array('VuFind\View\Helper\Root\Factory', 'getSearchTabs'),
'syndeticsplus' => array('VuFind\View\Helper\Root\Factory', 'getSyndeticsPlus'), 'syndeticsplus' => array('VuFind\View\Helper\Root\Factory', 'getSyndeticsPlus'),
'systememail' => array('VuFind\View\Helper\Root\Factory', 'getSystemEmail'), 'systememail' => array('VuFind\View\Helper\Root\Factory', 'getSystemEmail'),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment