Skip to content
Snippets Groups Projects
module.config.php 5.1 KiB
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;
use fid\FormModel\PasswordChangeModel;
use fid_adlr\Controller\FeedbackController;
use fid_adlr\Controller\FeedbackControllerDelegatorFactory;
use fid_adlr\Controller\RecordControllerDelegatorFactory;
use fid_adlr\Controller\SearchController;
use fid_adlr\Helper\Rss;
use VuFind\Controller\AbstractBaseWithConfigFactory;
use Zend\ServiceManager\Factory\InvokableFactory;
    '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',
            FeedbackController::class => 'VuFind\Controller\AbstractBaseFactory',
            RecordController::class => AbstractBaseWithConfigFactory::class,
            SearchController::class => AbstractBaseWithConfigFactory::class,
            'feedback' => FeedbackController::class,
            'Search' => SearchController::class,
            'search' => SearchController::class,
            \VuFind\Controller\RecordController::class => RecordController::class,
        ],
        'delegators' => [
            RecordController::class => [
                RecordControllerDelegatorFactory::class,
            ],
            FeedbackController::class => [
                FeedbackControllerDelegatorFactory::class,
            ],
            'rss' => Rss::class,
        ],
        'factories' => [
            Rss::class => InvokableFactory::class,
        ],
    ],
        'routes' => [
            'myresearch' => [
                'type'          => Regex::class,
                'options'       => [
                    'regex' => '/(?i)myresearch',
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'databases' => [
                        'type'    => Regex::class,
                        'options' => [
                            'regex'    => '/(?i)(databases|dbis|licenses)',
                            'defaults' => [
                                'controller' => MyResearchController::class,
                                'action'     => 'databases',
                            ],
        'plugin_managers'              => [
            'recorddriver' => [
                'factories' => [
                    'fid_adlr\RecordDriver\SolrDefault'     => 'VuFind\RecordDriver\SolrDefaultFactory',
                    'fid_adlr\RecordDriver\SolrMarcFinc'    => 'VuFind\RecordDriver\SolrDefaultFactory',
                'aliases' => [
                    'VuFind\RecordDriver\SolrDefault' => 'fid_adlr\RecordDriver\SolrDefault',
                    'solrmarcfinc' => 'fid_adlr\RecordDriver\SolrMarcFinc'
                ],
            ],
            'recordtab'    => [
                'invokables' => [
                    'toc'             => 'fid_adlr\RecordTab\TOC'

$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);