diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index e4c87f8747a1047147f1bb86f943620debe10972..ecf42016f54dc70d5771fe8c0667493b58d1c9d4 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -88,6 +88,11 @@ $config = [ 'finctheca' => 'finc\ILS\Driver\FincTheca', 'finclibero' => 'finc\ILS\Driver\FincLibero' ], + 'delegators' => [ + 'finc\ILS\Driver\FincLibero' => [ + 'finc\ILS\Driver\StaticStatusRulesDelegatorFactory' + ] + ] ], 'recommend' => [ 'factories' => [ diff --git a/module/finc/src/finc/ILS/Driver/Factory.php b/module/finc/src/finc/ILS/Driver/Factory.php index 56c3a0e7806bbab31d9a85002f23b3ad4f2ac376..dc4f25edffe8a4615b45184dad57fbb71270dc5e 100644 --- a/module/finc/src/finc/ILS/Driver/Factory.php +++ b/module/finc/src/finc/ILS/Driver/Factory.php @@ -137,12 +137,16 @@ class Factory /** * Factory for FincLibero driver. * - * @param \Psr\Container\ContainerInterface $container Service manager. + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object * - * @return FincLibero */ - public static function getFincLibero(ContainerInterface $container) - { + public static function getFincLibero(ContainerInterface $container, $requestedName, + array $options = null + ) { $factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory($container->get('VuFind\ProxyConfig')); $callback = function (& $wrapped, $proxy) use ($container) { @@ -151,7 +155,7 @@ class Factory $proxy->setProxyInitializer(null); }; - $fl = new FincLibero( + $fl = new $requestedName( $container->get('VuFind\DateConverter'), $container->get('VuFind\SessionManager'), $container->get('VuFind\RecordLoader'), @@ -164,8 +168,7 @@ class Factory $container->get('VuFind\CacheManager')->getCache('object') ); - $fl->staticStatusRules = $container->get('VuFind\YamlReader')->get('StaticStatusRules.yaml'); - return $fl; } + } diff --git a/module/finc/src/finc/ILS/Driver/StaticStatusRulesDelegatorFactory.php b/module/finc/src/finc/ILS/Driver/StaticStatusRulesDelegatorFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..ffc988c2d4f1ba668ca1f76ad680419b3556e7c0 --- /dev/null +++ b/module/finc/src/finc/ILS/Driver/StaticStatusRulesDelegatorFactory.php @@ -0,0 +1,80 @@ +<?php +/** + * Munger Injection Factory + * + * A Delegator Factory that registers several listeners at events triggered by the + * VuFind\Search service. + * + * PHP version 7 + * + * Copyright (C) Leipzig University Library 2019. + * + * 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 Finc/Service + * @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 Main Page + */ +namespace finc\ILS\Driver; + +use Interop\Container\ContainerInterface; +use VuFindSearch\Query\Query; +use VuFindSearch\Query\QueryGroup; +use VuFindSearch\Service as SearchService; +use Zend\Config\Config; +use Zend\EventManager\EventInterface; +use Zend\ServiceManager\Factory\DelegatorFactoryInterface; + +/** + * Munger Injection Factory + * + * + * @category VuFind + * @package Finc/ILS + * @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 Main Page + */ +class StaticStatusRulesDelegatorFactory implements DelegatorFactoryInterface +{ + /** + * Adds staticStatusRules if there is a valid StaticStatusRules.json available + * + * @param ContainerInterface $container + * @param string $name + * @param callable $callback + * @param array|null $options + * + * @return mixed + */ + public function __invoke( + ContainerInterface $container, + $name, + callable $callback, + array $options = null + ) { + $instance = call_user_func($callback); + + $staticStatusRules = $container->get('VuFind\YamlReader')->get('StaticStatusRules.yaml'); + if (!empty($staticStatusRules)) { + if (isset($staticStatusRules['rules']) && isset($staticStatusRules['stopFlags'])) { + $instance->staticStatusRules = $staticStatusRules; + } + } + + return $instance; + } +} diff --git a/themes/fid/templates/fid/user/init.phtml b/themes/fid/templates/fid/user/init.phtml index 059c44c0effbe2016cbe9ce6e0b46723560d4939..9f2077e5585703db859bafa09217e9f70c06584b 100644 --- a/themes/fid/templates/fid/user/init.phtml +++ b/themes/fid/templates/fid/user/init.phtml @@ -129,7 +129,7 @@ $elemSubmit->setAttributes(['class' => 'btn btn-primary']); <a class="back-to-login btn btn-link" href="<?= $this->url('myresearch-userlogin') ?>"> <i class="fa fa-chevron-left" aria-hidden="true"></i> - <?= $this->transEsc('Back') ?> + <span class="decorate"><?=$this->transEsc('Back')?></span> </a> <?= $this->formElement($elemSubmit) ?> </div> diff --git a/themes/fid/templates/fid/user/password-reset.phtml b/themes/fid/templates/fid/user/password-reset.phtml index 02cb1122f8b6b725b91a335cc9131575041139ad..811343424b167fc2292a9a39b6c302a008ee0859 100644 --- a/themes/fid/templates/fid/user/password-reset.phtml +++ b/themes/fid/templates/fid/user/password-reset.phtml @@ -78,7 +78,7 @@ $elemSubmit->setAttributes(['class' => 'btn btn-primary']); <div class="form-group"> <a class="back-to-login btn btn-link" href="<?=$this->url('myresearch-userlogin') ?>"> <i class="fa fa-chevron-left" aria-hidden="true"></i> - <?=$this->transEsc('Back')?> + <span class="decorate"><?=$this->transEsc('Back')?></span> </a> <?= $this->formElement($elemSubmit) ?> </div> diff --git a/themes/fid/templates/fid/user/username-change.phtml b/themes/fid/templates/fid/user/username-change.phtml index 80331a37350bed8bd9c2178bd8ffe066d0311e2e..a87075ee820517dca9d6486bafa98acb5476814b 100644 --- a/themes/fid/templates/fid/user/username-change.phtml +++ b/themes/fid/templates/fid/user/username-change.phtml @@ -93,7 +93,7 @@ $elemSubmit->setAttributes(['class' => 'btn btn-primary']); <div class="form-group"> <a class="back-to-login btn btn-link" href="<?=$this->url('myresearch-userlogin') ?>"> <i class="fa fa-chevron-left" aria-hidden="true"></i> - <?=$this->transEsc('Back')?> + <span class="decorate"><?=$this->transEsc('Back')?></span> </a> <?= $this->formElement($elemSubmit) ?> </div> diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index e9dd655e78a6f31ce82ed4037acf91337daa2ea5..5de35874c1530a7d73e880eecd1ac4017d48d688 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -1648,12 +1648,34 @@ footer { //// Off-Canvas @media only screen and (max-width: $screen-sm-max) { // Define position of VF5.1 offcanvas toggler + // FIXME: CHECK THIS! CK .search-stats, .search-controls { clear: both; } } +//// Re-define button arrows by adding space to the :after/:before elements -- see offcanvas.scss +.offcanvas-left { + .close-offcanvas::after { + content: '\00a0\f105'; + } + + .search-filter-toggle::before { + content: '\f100\00a0'; + } +} + +.offcanvas-right { + .close-offcanvas::before { + content: '\f104\00a0'; + } + + .search-filter-toggle::after { + content: '\00a0\f101'; + } +} + // make 100% wide to avoid conflict with other elements, for back-toggler see below .offcanvas-toggler, .offcanvas-toggler button { diff --git a/themes/finc/templates/RecordDriver/SolrAI/data-jTitle.phtml b/themes/finc/templates/RecordDriver/SolrAI/data-jTitle.phtml new file mode 100644 index 0000000000000000000000000000000000000000..3d22ec4d5be98a477657be64e84d2a39267f2184 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrAI/data-jTitle.phtml @@ -0,0 +1,35 @@ +<!-- finc: RecordDriver - SolrAI - data-jTitle --> +<?php $jtitle = []; ?> +<?php if (!(empty($data))): ?> + <?php $issns = $this->driver->tryMethod('getISSNs'); ?> + <?php ob_start(); ?> + <?php if (!empty($issns)): ?> + <a href="<?=$this->record($this->driver)->getLink('isn', $issns)?>"> + <?=$this->escapeHtml($data)?> + </a> + <?php else: ?> + <?=$this->escapeHtml($data)?> + <?php endif; ?> + <?php + $jtitle[] = trim(preg_replace('/\s+<\//', '</', ob_get_contents())); + ob_end_clean(); + ?> +<?php endif; ?> +<?php +// please note: direction of iteration will be displayed +$methods = ['getVolume', 'getPublishDateSort', 'getIssues', 'getPages']; +foreach ($methods as $method) { + if (!(empty($retval = $this->driver->tryMethod($method)))) { + $jtitle[] = ($method == 'getPages') + ? $this->transEsc('p.') . ' ' . $this->escapeHtml($retval) + : $this->escapeHtml($retval); + } +} +?> +<?php /* finc: add schema tags for parent publication #13850 - VE */ ?> +<span property="isPartOf" typeof="Periodical" resource="#periodical"> + <span property="name"> + <?=implode(', ', $jtitle)?> + </span> +</span> +<!-- finc: RecordDriver - SolrAi - data-jTitle - END -->