diff --git a/module/fid_adlr/config/module.config.php b/module/fid_adlr/config/module.config.php index da3910a05bdecbe613a2f2bea3a9b8c89d6e4fd9..59baa41cef46fdcb4b7a130b8cee56cfd060c8fd 100644 --- a/module/fid_adlr/config/module.config.php +++ b/module/fid_adlr/config/module.config.php @@ -98,8 +98,8 @@ $config = [ 'plugin_managers' => [ 'recorddriver' => [ 'factories' => [ - 'fid_adlr\RecordDriver\SolrDefault' => 'fid_adlr\RecordDriver\RecordDriverWithSearchServiceFactory', - 'fid_adlr\RecordDriver\SolrMarcFinc' => 'fid_adlr\RecordDriver\RecordDriverWithSearchServiceFactory', + 'fid_adlr\RecordDriver\SolrDefault' => 'VuFind\RecordDriver\SolrDefaultFactory', + 'fid_adlr\RecordDriver\SolrMarcFinc' => 'VuFind\RecordDriver\SolrDefaultFactory', ], 'aliases' => [ 'VuFind\RecordDriver\SolrDefault' => 'fid_adlr\RecordDriver\SolrDefault', @@ -107,9 +107,6 @@ $config = [ ], ], 'recordtab' => [ - 'factories' => [ - 'hierarchytree' => 'finc\RecordTab\Factory::getHierarchyTree', - ], 'invokables' => [ 'toc' => 'fid_adlr\RecordTab\TOC' ], diff --git a/module/fid_adlr/src/RecordDriver/RecordDriverWithSearchServiceFactory.php b/module/fid_adlr/src/RecordDriver/RecordDriverWithSearchServiceFactory.php deleted file mode 100644 index 791903d12a50a7b54d154a5dcafbbfe8f96ec712..0000000000000000000000000000000000000000 --- a/module/fid_adlr/src/RecordDriver/RecordDriverWithSearchServiceFactory.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Factory for solr record driver with search service - * - * PHP version 7 - * - * Copyright (C) Leipzig University Library 2022. - * - * 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 RecordDrivers - * @author Alexander Purr <purr@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace fid_adlr\RecordDriver; - -use Interop\Container\ContainerInterface; -use Zend\ServiceManager\Factory\FactoryInterface; - -/** - * Factory for solr record driver with search service - * - * @category VuFind - * @package RecordDrivers - * @author Alexander Purr <purr@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class RecordDriverWithSearchServiceFactory implements FactoryInterface -{ - /** - * Create an record driver object - * - * @param ContainerInterface $container Service manager - * @param string $requestedName Service being created - * @param null|array $options Extra options (optional) - * - * @return object - * - * @throws ServiceNotFoundException if unable to resolve the service. - * @throws ServiceNotCreatedException if an exception is raised when - * creating a service. - * @throws ContainerException if any other error occurs - */ - public function __invoke( - ContainerInterface $container, - $requestedName, - array $options = null - ) { - if ($options !== null) { - throw new \Exception('Unexpected options sent to factory!'); - } - $driver = new $requestedName( - $container->get('VuFind\Config')->get('config'), - null, - $container->get('VuFind\Config')->get('searches') - ); - $driver->attachSearchService($container->get('VuFind\Search')); - return $driver; - } -} diff --git a/module/fid_adlr/src/View/Helper/Root/RecordViewHelperFactory.php b/module/fid_adlr/src/View/Helper/Root/RecordViewHelperFactory.php deleted file mode 100644 index 71792889ccfc69355f4efc8b98d186a18b879ee4..0000000000000000000000000000000000000000 --- a/module/fid_adlr/src/View/Helper/Root/RecordViewHelperFactory.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * RecordViewHelper Factory Class - * - * PHP version 7 - * - * Copyright (C) Leipzig University Library 2022. - * - * 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 View_Helpers - * @author Alexander Purr <purr@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 fid_adlr\View\Helper\Root; - -use finc\Rewrite\EblRewrite; -use Interop\Container\ContainerInterface; -use Zend\ServiceManager\Factory\FactoryInterface; - -/** - * ViewHelper Factory Class - * - * @category VuFind - * @package View_Helpers - * @author Alexander Purr <purr@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 - */ -class RecordViewHelperFactory implements FactoryInterface -{ - /** - * Create an object - * - * @param ContainerInterface $container Service manager - * @param string $requestedName Service being created - * @param null|array $options Extra options (optional) - * - * @return Record - * - * @throws ServiceNotFoundException if unable to resolve the service. - * @throws ServiceNotCreatedException if an exception is raised when - * creating a service. - * @throws ContainerException if any other error occurs - */ - public function __invoke( - ContainerInterface $container, - $requestedName, - array $options = null - ) { - if (!empty($options)) { - throw new \Exception('Unexpected options sent to factory.'); - } - $recordViewHelper = new Record( - $container->get('VuFind\Config')->get('config'), - $container->get('ViewHelperManager')->get('url'), - $container->get('VuFind\AuthManager'), - $container->get(EblRewrite::class), - $container->get('VuFind\Config')->get('Resolver'), - $container->get('VuFind\Config')->get('iconMapping') - ); - - //due to https://github.com/vufind-org/vufind/pull/718 - //we have to explicitly add the cover router (cf. # - $recordViewHelper->setCoverRouter($container->get('VuFind\Cover\Router')); - - return $recordViewHelper; - } -} diff --git a/themes/fid_adlr/theme.config.php b/themes/fid_adlr/theme.config.php index 231e6d9f36553431e882d145487a6c0d41421cbb..54b2c9a4bfdd0ebef8eef051399015da511ab077 100644 --- a/themes/fid_adlr/theme.config.php +++ b/themes/fid_adlr/theme.config.php @@ -13,7 +13,7 @@ return [ 'VuFind\View\Helper\Root\RecordDataFormatter' => 'fid_adlr\View\Helper\Root\RecordDataFormatterFactory', \fid_adlr\View\Helper\Root\Record::class => - \fid_adlr\View\Helper\Root\RecordViewHelperFactory::class, + \finc\View\Helper\Root\RecordViewHelperFactory::class, ], 'aliases' => [ 'record' => \fid_adlr\View\Helper\Root\Record::class,