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

Rearranged configuration to get VuFind-specific components out of global configuration namespace.

parent 927bedaf
No related merge requests found
This diff is collapsed.
...@@ -94,10 +94,11 @@ class Bootstrap ...@@ -94,10 +94,11 @@ class Bootstrap
$serviceName = 'VuFind\\' . str_replace('\\', '', $ns) . 'PluginManager'; $serviceName = 'VuFind\\' . str_replace('\\', '', $ns) . 'PluginManager';
$factory = function ($sm) use ($config, $ns) { $factory = function ($sm) use ($config, $ns) {
$className = 'VuFind\\' . $ns . '\PluginManager'; $className = 'VuFind\\' . $ns . '\PluginManager';
$configKey = strtolower(str_replace('\\', '_', $ns)) $configKey = strtolower(str_replace('\\', '_', $ns));
. '_plugin_manager';
return new $className( return new $className(
new \Zend\ServiceManager\Config($config[$configKey]) new \Zend\ServiceManager\Config(
$config['vufind']['plugin_managers'][$configKey]
)
); );
}; };
$serviceManager->setFactory($serviceName, $factory); $serviceManager->setFactory($serviceName, $factory);
...@@ -106,7 +107,7 @@ class Bootstrap ...@@ -106,7 +107,7 @@ class Bootstrap
// Set up search manager a little differently -- it is a more complex class // Set up search manager a little differently -- it is a more complex class
// that doesn't work like the other standard plugin managers. // that doesn't work like the other standard plugin managers.
$factory = function ($sm) use ($config) { $factory = function ($sm) use ($config) {
return new \VuFind\Search\Manager($config['search_manager']); return new \VuFind\Search\Manager($config['vufind']['search_manager']);
}; };
$serviceManager->setFactory('SearchManager', $factory); $serviceManager->setFactory('SearchManager', $factory);
......
...@@ -542,7 +542,7 @@ class AbstractRecord extends AbstractBase ...@@ -542,7 +542,7 @@ class AbstractRecord extends AbstractBase
protected function getTabConfiguration() protected function getTabConfiguration()
{ {
$cfg = $this->getServiceLocator()->get('Config'); $cfg = $this->getServiceLocator()->get('Config');
return $cfg['recorddriver_tabs']; return $cfg['vufind']['recorddriver_tabs'];
} }
/** /**
......
...@@ -74,12 +74,13 @@ class AuthorityController extends AbstractSearch ...@@ -74,12 +74,13 @@ class AuthorityController extends AbstractSearch
{ {
$id = $this->params()->fromQuery('id'); $id = $this->params()->fromQuery('id');
$cfg = $this->getServiceLocator()->get('Config'); $cfg = $this->getServiceLocator()->get('Config');
$tabConfig = $cfg['vufind']['recorddriver_tabs'];
$driver = $this->getSearchManager()->setSearchClassId('SolrAuth') $driver = $this->getSearchManager()->setSearchClassId('SolrAuth')
->getResults()->getRecord($id); ->getResults()->getRecord($id);
$request = $this->getRequest(); $request = $this->getRequest();
$tabs = $this->getServiceLocator() $tabs = $this->getServiceLocator()
->get('VuFind\RecordTabPluginManager') ->get('VuFind\RecordTabPluginManager')
->getTabsForRecord($driver, $cfg['recorddriver_tabs'], $request); ->getTabsForRecord($driver, $tabConfig, $request);
return $this->createViewModel(array('driver' => $driver, 'tabs' => $tabs)); return $this->createViewModel(array('driver' => $driver, 'tabs' => $tabs));
} }
......
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