Newer
Older
<?php
/**
* Copyright (C) 2019 Leipzig University Library
*
* 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.
*
* @author Gregor Gawol <gawol@ub.uni-leipzig.de>
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
*/
use fid\Controller\MyResearchController;

Alexander Purr
committed
use fid\FormModel\PasswordChangeModel;
use fid_adlr\Controller\FeedbackController;

Alexander Purr
committed
use fid_adlr\Controller\FeedbackControllerDelegatorFactory;

Alexander Purr
committed
use fid_adlr\Controller\RecordController;
use fid_adlr\Controller\RecordControllerDelegatorFactory;
use fid_adlr\Controller\SearchController;
use fid_adlr\Helper\Rss;

Alexander Purr
committed
use VuFind\Controller\AbstractBaseWithConfigFactory;
use Laminas\Router\Http\Regex;
use Laminas\ServiceManager\Factory\InvokableFactory;
Robert Lange
committed
'forms' => [
'user-create-form' => require 'user-create-form.php',
'user-update-form' => require 'user-update-form.php',
'admin-edit-form' => require 'admin-edit-form.php',
PasswordChangeModel::class => require 'password-change-form.php',
],
'controllers' => [
Robert Lange
committed
'factories' => [
FeedbackController::class => 'VuFind\Controller\AbstractBaseFactory',

Alexander Purr
committed
RecordController::class => AbstractBaseWithConfigFactory::class,
SearchController::class => AbstractBaseWithConfigFactory::class,
Robert Lange
committed
],
'aliases' => [
'feedback' => FeedbackController::class,

Alexander Purr
committed
'Feedback' => FeedbackController::class,
'Search' => SearchController::class,
'search' => SearchController::class,

Alexander Purr
committed
\VuFind\Controller\RecordController::class => RecordController::class,
],
'delegators' => [
RecordController::class => [
RecordControllerDelegatorFactory::class,
],

Alexander Purr
committed
FeedbackController::class => [
FeedbackControllerDelegatorFactory::class,
],
Robert Lange
committed
],
],
'view_helpers' => [
'aliases' => [
'rss' => Rss::class,
],
'factories' => [
Rss::class => InvokableFactory::class,
],
],
'router' => [
Robert Lange
committed
'routes' => [
'myresearch' => [
'type' => Regex::class,
'options' => [
'regex' => '/(?i)myresearch',
'spec' => '/myresearch'
Robert Lange
committed
],
'may_terminate' => true,
'child_routes' => [
'databases' => [
'type' => Regex::class,
'options' => [
Robert Lange
committed
'regex' => '/(?i)(databases|dbis|licenses)',
'defaults' => [
'controller' => MyResearchController::class,
'action' => 'databases',
],
'spec' => '/databases'
Robert Lange
committed
],
],
],
],
],
],
'vufind' => [
'plugin_managers' => [
'recorddriver' => [
'factories' => [

Alexander Purr
committed
'fid_adlr\RecordDriver\SolrDefault' => 'VuFind\RecordDriver\SolrDefaultFactory',
'fid_adlr\RecordDriver\SolrMarcFinc' => 'VuFind\RecordDriver\SolrDefaultFactory',
'fid_adlr\RecordDriver\SolrAI' => \finc\RecordDriver\SolrAIFactory::class
'solrai' => 'fid_adlr\RecordDriver\SolrAI',
'VuFind\RecordDriver\SolrDefault' => 'fid_adlr\RecordDriver\SolrDefault',
'solrmarcfinc' => 'fid_adlr\RecordDriver\SolrMarcFinc',
'solrdefault' => 'fid_adlr\RecordDriver\SolrDefault'
],
'recordtab' => [
'invokables' => [
'toc' => 'fid_adlr\RecordTab\TOC'
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
$nonTabRecordActions = [
'PDA',
'EmailHold',
'ReportErrors',
'Acquisition'
];
// Define record view routes -- route name => controller
// Define record view routes once again to add new nonTabRecordActions
$recordRoutes = [
'record' => 'Record',
'export' => 'Export',
'resources' => 'Resources'
];
// Define static routes -- Controller/Action strings
$staticRoutes = [
'MyResearch/Acquisition',
'MyResearch/ResetPassword',
'dds/Home',
'dds/Email',
'Record/EblLink',
'Search/Sources'
];
$routeGenerator = new \VuFind\Route\RouteGenerator($nonTabRecordActions);
$routeGenerator->addRecordRoutes($config, $recordRoutes);
$routeGenerator->addStaticRoutes($config, $staticRoutes);
return $config;