Skip to content
Snippets Groups Projects
module.config.php 9 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\FormModel\PasswordChangeModel;
use fid_adlr\Controller\FeedbackController;
use fid_adlr\Controller\FeedbackControllerDelegatorFactory;
use fid_adlr\Controller\MyResearchController;
use fid_adlr\Controller\MyResearchControllerFactory;
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',
            MyResearchController::class => MyResearchControllerFactory::class,
            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' => [
                    'solrdefault'        => 'finc\RecordDriver\Factory::getSolrDefault',
                    'solrmarc'           => 'finc\RecordDriver\Factory::getSolrMarc',
                    'solrmarcfinc'       => 'finc\RecordDriver\Factory::getSolrMarcFinc',
                    'solrmarcfincpda'    => 'finc\RecordDriver\Factory::getSolrMarcFincPDA',
                    'solrmarcremote'     => 'finc\RecordDriver\Factory::getSolrMarcRemote',
                    'solrmarcremotefinc' => 'finc\RecordDriver\Factory::getSolrMarcRemoteFinc',
                    'solrai'             => 'finc\RecordDriver\Factory::getSolrAI',
                    'solris'             => 'finc\RecordDriver\Factory::getSolrIS',
                    'solrlido'           => 'finc\RecordDriver\Factory::getSolrLido',
                    'solrlidondl'        => 'finc\RecordDriver\Factory::getSolrLidoNdl'
                ],
            ],
            'recordtab'    => [
                'factories'  => [
                    'hierarchytree' => 'finc\RecordTab\Factory::getHierarchyTree',
                ],
                'invokables' => [
                    'staffviewai'     => 'finc\RecordTab\StaffViewAI',
                    'acquisitionpda'  => 'finc\RecordTab\AcquisitionPDA',
                    'topics'          => 'finc\RecordTab\Topics',
                    'descriptionlido' => 'finc\RecordTab\DescriptionLido',
                    'toc'             => 'fid_adlr\RecordTab\TOC'
                ],
            ],
        ],
        'recorddriver_tabs'            => [
            'finc\RecordDriver\SolrDefault'  => [
                'tabs'       => [
                    'Description'   => 'Description',
                    'Holdings'      => 'HoldingsILS',
                    'AcquisitionPDA' => 'AcquisitionPDA',
                    'TOC'           => 'TOC',
                    'UserComments'  => 'UserComments',
                    'Reviews'       => 'Reviews',
                    'Excerpt'       => 'Excerpt',
                    'Preview'       => 'preview',
                    'HierarchyTree' => 'HierarchyTree',
                    'Map'           => 'Map',
                    'Similar'       => null,
                    'Details'       => 'StaffViewArray',
                    'Worldcat'      => null,
                ],
                'defaultTab' => null,
            ],
            'finc\RecordDriver\SolrMarcFinc' => [
                'tabs'       => [
                    'Description'   => 'Description',
                    'Holdings'      => 'HoldingsILS',
                    'AcquisitionPDA' => 'AcquisitionPDA',
                    'TOC'           => 'TOC',
                    'UserComments'  => 'UserComments',
                    'Reviews'       => 'Reviews',
                    'Excerpt'       => 'Excerpt',
                    'Preview'       => 'preview',
                    'HierarchyTree' => 'HierarchyTree',
                    'Map'           => 'Map',
                    'Similar'       => null,
                    'Details'       => 'StaffViewMARC',
                    'Worldcat'      => 'Worldcat',
                ],
                'defaultTab' => null,
            ],
            'finc\RecordDriver\SolrAI'       => [
                'tabs'       => [
                    'Description'   => 'Description',
                    'Holdings'      => 'HoldingsILS',
                    'AcquisitionPDA' => 'AcquisitionPDA',
                    'TOC'           => 'TOC',
                    'UserComments'  => 'UserComments',
                    'Reviews'       => 'Reviews',
                    'Excerpt'       => 'Excerpt',
                    'Preview'       => 'preview',
                    'HierarchyTree' => 'HierarchyTree',
                    'Map'           => 'Map',
                    'Similar'       => null,
                    'Details'       => 'StaffViewAI',
                    'Worldcat'      => 'Worldcat'
                ],
                'defaultTab' => null,
            ],
        ],
        'recorddriver_collection_tabs' => [
            'VuFind\RecordDriver\AbstractBase' => [
                'tabs'       => [
                    'CollectionList' => 'CollectionList',
                    'HierarchyTree'  => 'CollectionHierarchyTree',
                    'Details'        => 'StaffViewArray',
                ],
                'defaultTab' => null,
            ],
        ],
    ],

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