Skip to content
Snippets Groups Projects
Commit 1da440c5 authored by Dorian Merz's avatar Dorian Merz Committed by André Lahmann
Browse files

refs #18069 [master] fix hierarchy tab config

* use finc-specific generalized factory
parent 1560cf29
No related merge requests found
......@@ -155,7 +155,7 @@ $config = [
'finc\RecordTab\AcquisitionPDA' => 'Zend\ServiceManager\Factory\InvokableFactory',
'finc\RecordTab\Topics' => 'Zend\ServiceManager\Factory\InvokableFactory',
'finc\RecordTab\DescriptionLido' => 'Zend\ServiceManager\Factory\InvokableFactory',
'finc\RecordTab\HierarchyTree' => 'VuFind\RecordTab\Factory::getHierarchyTree',
'finc\RecordTab\HierarchyTree' => 'finc\RecordTab\HierarchyTreeFactory',
],
'aliases' => [
'VuFind\RecordTab\HierarchyTree' => 'finc\RecordTab\HierarchyTree',
......
......@@ -45,23 +45,6 @@ class HierarchyTree extends \VuFind\RecordTab\HierarchyTree
*/
protected $treeList = null;
/**
* Configuration
*
* @var \Zend\Config\Config
*/
protected $config = null;
/**
* Constructor
*
* @param \Zend\Config\Config $config Configuration
*/
public function __construct(\Zend\Config\Config $config)
{
$this->config = $config;
}
public function getDescription()
{
if ($this->driver->isCollection()) return 'collection_hierarchy_tree_tab';
......
<?php
/**
* Record Tab Invokable Factory Class
* for HierarchyTree tab
*
* PHP version 7
*
* Copyright (C) Leipzig University Library, 2020.
*
* 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 RecordTab
* @author Dorian Merz <merz@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki
*/
namespace finc\RecordTab;
use Zend\ServiceManager\ServiceManager;
/**
* Record Tab Invokable Factory Class
* for HierarchyTree tab
*
* @category VuFind
* @package RecordTab
* @author Dorian Merz <merz@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki
*
* @codeCoverageIgnore
*/
class HierarchyTreeFactory
{
/**
* Factory for HierarchyTree tab plugin.
*
* @param ServiceManager $sm Service manager.
*
* @return HierarchyTree
*/
public function __invoke(ServiceManager $sm, $requestedName, array $options = null)
{
if (!empty($options)) {
throw new \ConfigurationException('Unexpected options');
}
return new $requestedName(
$sm->get('VuFind\Config\PluginManager')->get('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