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

Inject configuration.

parent fa75866c
No related merge requests found
...@@ -627,6 +627,7 @@ $config = array( ...@@ -627,6 +627,7 @@ $config = array(
'factories' => array( 'factories' => array(
'collectionhierarchytree' => function ($sm) { 'collectionhierarchytree' => function ($sm) {
return new \VuFind\RecordTab\CollectionHierarchyTree( return new \VuFind\RecordTab\CollectionHierarchyTree(
$sm->getServiceLocator()->get('VuFind\Config')->get('config'),
$sm->getServiceLocator()->get('VuFind\RecordLoader') $sm->getServiceLocator()->get('VuFind\RecordLoader')
); );
}, },
...@@ -636,6 +637,11 @@ $config = array( ...@@ -636,6 +637,11 @@ $config = array(
$searchManager->setSearchClassId('SolrCollection')->getResults() $searchManager->setSearchClassId('SolrCollection')->getResults()
); );
}, },
'hierarchytree' => function ($sm) {
return new \VuFind\RecordTab\HierarchyTree(
$sm->getServiceLocator()->get('VuFind\Config')->get('config')
);
},
'holdingsils' => function ($sm) { 'holdingsils' => function ($sm) {
// If VuFind is configured to suppress the holdings tab when the // If VuFind is configured to suppress the holdings tab when the
// ILS driver specifies no holdings, we need to pass in a connection // ILS driver specifies no holdings, we need to pass in a connection
...@@ -654,7 +660,6 @@ $config = array( ...@@ -654,7 +660,6 @@ $config = array(
'invokables' => array( 'invokables' => array(
'description' => 'VuFind\RecordTab\Description', 'description' => 'VuFind\RecordTab\Description',
'excerpt' => 'VuFind\RecordTab\Excerpt', 'excerpt' => 'VuFind\RecordTab\Excerpt',
'hierarchytree' => 'VuFind\RecordTab\HierarchyTree',
'holdingsworldcat' => 'VuFind\RecordTab\HoldingsWorldCat', 'holdingsworldcat' => 'VuFind\RecordTab\HoldingsWorldCat',
'map' => 'VuFind\RecordTab\Map', 'map' => 'VuFind\RecordTab\Map',
'reviews' => 'VuFind\RecordTab\Reviews', 'reviews' => 'VuFind\RecordTab\Reviews',
......
...@@ -48,10 +48,13 @@ class CollectionHierarchyTree extends HierarchyTree ...@@ -48,10 +48,13 @@ class CollectionHierarchyTree extends HierarchyTree
/** /**
* Constructor * Constructor
* *
* @param \Zend\Config\Config $config Configuration
* @param \VuFind\Record\Loader $loader Record loader * @param \VuFind\Record\Loader $loader Record loader
*/ */
public function __construct(\VuFind\Record\Loader $loader) public function __construct(\Zend\Config\Config $config,
{ \VuFind\Record\Loader $loader
) {
parent::__construct($config);
$this->loader = $loader; $this->loader = $loader;
} }
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
* @link http://vufind.org/wiki/vufind2:record_tabs Wiki * @link http://vufind.org/wiki/vufind2:record_tabs Wiki
*/ */
namespace VuFind\RecordTab; namespace VuFind\RecordTab;
use VuFind\Config\Reader as ConfigReader;
/** /**
* HierarchyTree tab * HierarchyTree tab
...@@ -53,6 +52,16 @@ class HierarchyTree extends AbstractBase ...@@ -53,6 +52,16 @@ class HierarchyTree extends AbstractBase
*/ */
protected $config = null; protected $config = null;
/**
* Constructor
*
* @param \Zend\Config\Config $config Configuration
*/
public function __construct(\Zend\Config\Config $config)
{
$this->config = $config;
}
/** /**
* Get the VuFind configuration. * Get the VuFind configuration.
* *
...@@ -60,9 +69,6 @@ class HierarchyTree extends AbstractBase ...@@ -60,9 +69,6 @@ class HierarchyTree extends AbstractBase
*/ */
protected function getConfig() protected function getConfig()
{ {
if (null === $this->config) {
$this->config = ConfigReader::getConfig();
}
return $this->config; return $this->config;
} }
......
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