diff --git a/local/config/vufind/config.ini b/local/config/vufind/config.ini index 94f2c250dbc9f9c716c3315f47da1dbbee3deda2..74d06650a8018c38b7b8ffb506df9d74fae21aae 100644 --- a/local/config/vufind/config.ini +++ b/local/config/vufind/config.ini @@ -59,6 +59,19 @@ theme = finc ; Example: "development:off; production:js,css" ;asset_pipeline = "production:js" +; File size limit for inlining of css @import resources in kilobytes when the asset +; pipeline is enabled (see above) for css files. Set to 0 to disable inlining. Note +; that you will need to delete any css files from local/cache/public directory for +; changes to this setting to take effect. +; +; N.B. The default here is 0 for compatibility with the content security policy. +; A suggested non-zero value is 5, which improves performance by avoiding http +; requests for small images, but any non-zero value requires that data: URIs are +; added as allowed for images in contentsecuritypolicy.ini e.g. with the following +; line: +; img-src[] = "data:" +asset_pipeline_max_css_import_size = 0 + ; This is a comma-separated list of themes that may be accessed via the ?ui GET ; parameter. Each entry has two parts: the value used on the URL followed by the ; actual theme name. For example, http://library.myuniversity.edu/vufind?ui=theme1 @@ -603,6 +616,20 @@ sms = enabled ; store its path in the database (default "none"). url_shortener = none +; Which method to use for generating the short link key. Options: +; - base62: Base62-encode the database row ID (insecure, but makes very short URLs) +; - md5: Create a salted MD5 hash of the URL (DEFAULT: more private, but also longer) +; ...or any hash algorithm supported by PHP's hash() function. +url_shortener_key_type = md5 + +; Which redirect mechanism to use when shortlinks are resolved. +; threshold:1000 (default) : If the URL is shorter than the given size, HTTP is used, else HTML. +; html : HTML meta redirect after 3 seconds with infobox. +; http : Use HTTP location header for redirects. +; May cause problems if the HTTP header is longer than 8192 bytes +; due to long URL's. +;url_shortener_redirect_method = threshold:1000 + ; This section needs to be changed to match your database connection information [Database] ; Connection string format is [platform]://[username]:[password]@[host]:[port]/[db] diff --git a/local/config/vufind/contentsecuritypolicy.ini b/local/config/vufind/contentsecuritypolicy.ini new file mode 100644 index 0000000000000000000000000000000000000000..c6b181a0f4056025c2616c31584d1fbd11d062d4 --- /dev/null +++ b/local/config/vufind/contentsecuritypolicy.ini @@ -0,0 +1,76 @@ +;#################################################################### +;##################### DO NOT DELETE THIS HEADER #################### +;################### Leipzig University Library © 2015 ############## +; +; This is the ISIL-instance-specific default INI-file and inherits +; all the settings from the INI-file defined in [Parent_Config] which +; points to the default INI-file located in the folder vufind2/local +; + +;[Parent_Config] +;relative_path = ../../../local/config/vufind/contentsecuritypolicy.ini + +; A comma-separated list of config sections from the parent which should be +; completely overwritten by the equivalent sections in this configuration; +; any sections not listed here will be merged on a section-by-section basis. +;override_full_sections = "Ezb" + +; +; Add instance-specific customization after this header. +; +;##################### DO NOT DELETE THIS HEADER #################### +;#################################################################### + +; Settings for Content Security Policy header; you can learn more here: +; https://vufind.org/wiki/administration:security:content_security_policy +[CSP] +; This setting can be used to control the operating mode for each APPLICATION_ENV +; value (written as an array key below). Please note that the Whoops error handler +; (enabled in development mode) does not show correctly when enabled[development] is +; set to true. +; +; Following options are supported: +; false - Disabled +; "report_only" - Enabled in report-only mode (default). See report-to setting below. +; true - Enabled in enforcing mode +enabled[production] = "false" +enabled[development] = "report_only" + +; The nonce (number used once) - unique number for each request. It is strongly +; recommended to keep this setting on. The generated nonce directive is automatically +; added to script-src directives if any are set in [Directives] below. +use_nonce = true + +; Directives; you can find a list of available directives on this page: +; https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy +; For evaluation of CSP you can use this tool provided by Google: +; https://csp-evaluator.withgoogle.com/ +; See also the VuFind wiki for additional recommendations and tools: +; https://vufind.org/wiki/administration:security:content_security_policy +[Directives] +default-src[] = "'none'" +script-src[] = "'strict-dynamic'" +; 'unsafe-inline' is set for compatibility with older or buggy browsers. Newer ones +; will ignore it. +script-src[] = "'unsafe-inline'" +script-src[] = "http:" +script-src[] = "https:" +connect-src[] = "'self'" +style-src[] = "'self'" +style-src[] = "'unsafe-inline'" +img-src[] = "'self'" +; If you are using MapSelection recommendation module, uncomment a line below +; for the basemap you are using: +;img-src[] = "https://maps.wikimedia.org" +;img-src[] = "http://tile.stamen.com" +;img-src[] = "http://basemaps.cartocdn.com" +; If you are using ObalkyKnih as cover service you will need to uncomment the two +; lines below. Note these are default URLs; their change is unlikely but possible, +; so you should ensure they are still valid. +;img-src[] = https://cache.obalkyknih.cz +;img-src[] = https://cache2.obalkyknih.cz +font-src[] = "'self'" +base-uri[] = "'self'" +; Set URI that the browser should use to report CSP violation; you should provide +; this URL when you enable report_only mode to capture the violations. +;report-to[] = 'https://example.report-uri.com' diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Factory.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Factory.php deleted file mode 100644 index 0e25396a1ba8dc2681e64510a6221e5a65a3dac3..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/Factory.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php -/** - * Factory for Foundation view helpers. - * - * PHP version 5 - * - * Copyright (C) Villanova University 2014. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace VuFind\View\Helper\Foundation; -use Zend\ServiceManager\ServiceManager; - -/** - * Factory for Foundation view helpers. - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - * - * @codeCoverageIgnore - */ -class Factory -{ - /** - * Construct the Flashmessages helper. - * - * @param ServiceManager $sm Service manager. - * - * @return Flashmessages - */ - public static function getFlashmessages(ServiceManager $sm) - { - $messenger = $sm->getServiceLocator()->get('ControllerPluginManager') - ->get('FlashMessenger'); - return new Flashmessages($messenger); - } - - /** - * Construct the LayoutClass helper. - * - * @param ServiceManager $sm Service manager. - * - * @return LayoutClass - */ - public static function getLayoutClass(ServiceManager $sm) - { - $config = $sm->getServiceLocator()->get('VuFind\Config')->get('config'); - $left = !isset($config->Site->sidebarOnLeft) - ? false : $config->Site->sidebarOnLeft; - $mirror = !isset($config->Site->mirrorSidebarInRTL) - ? true : $config->Site->mirrorSidebarInRTL; - $offcanvas = !isset($config->Site->offcanvas) - ? false : $config->Site->offcanvas; - // The right-to-left setting is injected into the layout by the Bootstrapper; - // pull it back out here to avoid duplicate effort, then use it to apply - // the mirror setting appropriately. - $layout = $sm->getServiceLocator()->get('viewmanager')->getViewModel(); - if ($layout->rtl && !$mirror) { - $left = !$left; - } - return new LayoutClass($left, $offcanvas); - } - - /** - * Construct the Recaptcha helper. - * - * @param ServiceManager $sm Service manager. - * - * @return Recaptcha - */ - public static function getRecaptcha(ServiceManager $sm) - { - return new Recaptcha( - $sm->getServiceLocator()->get('VuFind\Recaptcha'), - $sm->getServiceLocator()->get('VuFind\Config')->get('config') - ); - } -} diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Flashmessages.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Flashmessages.php deleted file mode 100644 index 4f088dcc2a93d7d39bdd4ce5ca3ebc248666131e..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/Flashmessages.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * Flash message view helper - * - * PHP version 5 - * - * Copyright (C) Villanova University 2010. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace VuFind\View\Helper\Foundation; - -/** - * Flash message view helper - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class Flashmessages extends \VuFind\View\Helper\Root\Flashmessages -{ - /** - * Get the CSS class to correspond with a messenger namespace - * - * @param string $ns Namespace - * - * @return string - */ - protected function getClassForNamespace($ns) - { - if ($ns == 'error') { - $ns = 'warning'; - } - return 'flash-message alert-box ' . $ns; - } -} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Highlight.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Highlight.php deleted file mode 100644 index 0e9129684455ff19bffbd6b6e6e9578c91d4d845..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/Highlight.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Highlight view helper - * - * PHP version 5 - * - * Copyright (C) Villanova University 2010. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace VuFind\View\Helper\Foundation; - -/** - * Highlight view helper - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class Highlight extends \VuFind\View\Helper\Root\Highlight -{ - /** - * Constructor - */ - public function __construct() - { - $this->startTag = '<mark>'; - $this->endTag = '</mark>'; - } -} diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/LayoutClass.php b/module/VuFind/src/VuFind/View/Helper/Foundation/LayoutClass.php deleted file mode 100644 index 8920d6312884d630f94f4f0428aff131c5790f04..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/LayoutClass.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * Helper class for managing bootstrap theme's high-level (body vs. sidebar) page - * layout. - * - * PHP version 5 - * - * Copyright (C) Villanova University 2011. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace VuFind\View\Helper\Foundation; - -/** - * Helper class for managing bootstrap theme's high-level (body vs. sidebar) page - * layout. - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class LayoutClass extends \VuFind\View\Helper\AbstractLayoutClass -{ - /** - * Helper to allow easily configurable page layout -- given a broad class - * name, return appropriate CSS classes to lay out the page according to - * the current configuration file settings. - * - * @param string $class Type of class to return ('mainbody' or 'sidebar') - * - * @return string CSS classes to apply - */ - public function __invoke($class) - { - switch ($class) { - case 'mainbody': - return $this->left - ? 'medium-9 columns medium-push-3' - : 'medium-9 columns'; - case 'sidebar': - return $this->left - ? 'sidebar medium-3 columns medium-pull-9 hide-for-print' - : 'sidebar medium-3 columns hide-for-print'; - case 'offcanvas-row': - if (!$this->offcanvas) { - return ""; - } - return $this->left - ? 'offcanvas offcanvas-left' - : 'offcanvas offcanvas-right'; - } - } -} diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Recaptcha.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Recaptcha.php deleted file mode 100644 index 66af1aab393e113be771cbdebb76f1c390c58969..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/Recaptcha.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * Recaptcha view helper - * - * PHP version 5 - * - * Copyright (C) Villanova University 2016. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind - * @package View_Helpers - * @author Chris Hallberg <crhallberg@gmail.com> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace VuFind\View\Helper\Foundation; - -/** - * Recaptcha view helper - * - * @category VuFind - * @package View_Helpers - * @author Chris Hallberg <crhallberg@gmail.com> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class Recaptcha extends \VuFind\View\Helper\Root\Recaptcha -{ - /** - * Constructor - * - * @param \ZendService\Recaptcha\Recaptcha $rc Custom formatted Recaptcha - * @param \VuFind\Config $config Config object - */ - public function __construct($rc, $config) - { - $this->prefixHtml = '<div class="form-group">' . - '<div class="medium-9 columns medium-offset-3">'; - $this->suffixHtml = '</div></div>'; - parent::__construct($rc, $config); - } -} diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Search.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Search.php deleted file mode 100644 index e4a4afdd17cca3d9be4a9310df874e94d377bb02..0000000000000000000000000000000000000000 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/Search.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * Helper class for displaying search-related HTML chunks. - * - * PHP version 5 - * - * Copyright (C) Villanova University 2011. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace VuFind\View\Helper\Foundation; - -/** - * Helper class for displaying search-related HTML chunks. - * - * @category VuFind - * @package View_Helpers - * @author Demian Katz <demian.katz@villanova.edu> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class Search extends \VuFind\View\Helper\AbstractSearch -{ - /** - * Get the CSS classes for the container holding the suggestions. - * - * @return string - */ - protected function getContainerClass() - { - return 'alert-box info'; - } - - /** - * Render an expand link. - * - * @param string $url Link href - * @param \Zend\View\Renderer\PhpRenderer $view View renderer object - * - * @return string - */ - protected function renderExpandLink($url, $view) - { - return '<a href="' . $url . '" title="' . $view->transEsc('spell_expand_alt') - . '"><i class="icon-circle-arrow-right"></i></a>'; - } -} diff --git a/themes/finc-accessibility/js/cart.js b/themes/finc-accessibility/js/cart.js index 4fe3d72471d57e740a526e05c77d7bc29d40801a..4847061a3d2b5f096adcac43a8518384ec545702 100644 --- a/themes/finc-accessibility/js/cart.js +++ b/themes/finc-accessibility/js/cart.js @@ -1,4 +1,4 @@ -/*global Cookies, VuFind */ +/*global VuFind */ /*exported cartFormHandler */ VuFind.register('cart', function Cart() { @@ -7,6 +7,7 @@ VuFind.register('cart', function Cart() { var _COOKIE_DELIM = "\t"; var _COOKIE_DOMAIN = false; var _COOKIE_PATH = '/'; + var _COOKIE_SAMESITE = 'Lax'; function setDomain(domain) { _COOKIE_DOMAIN = domain; @@ -16,6 +17,14 @@ VuFind.register('cart', function Cart() { _COOKIE_PATH = path; } + function setCookieSameSite(sameSite) { + _COOKIE_SAMESITE = sameSite; + } + + function _getCookieParams() { + return { path: _COOKIE_PATH, domain: _COOKIE_DOMAIN, SameSite: _COOKIE_SAMESITE }; + } + function _uniqueArray(op) { var ret = []; for (var i = 0; i < op.length; i++) { @@ -27,14 +36,14 @@ VuFind.register('cart', function Cart() { } function _getItems() { - var items = Cookies.getItem(_COOKIE); + var items = window.Cookies.get(_COOKIE); if (items) { return items.split(_COOKIE_DELIM); } return []; } function _getSources() { - var items = Cookies.getItem(_COOKIE_SOURCES); + var items = window.Cookies.get(_COOKIE_SOURCES); if (items) { return items.split(_COOKIE_DELIM); } @@ -96,11 +105,11 @@ VuFind.register('cart', function Cart() { // Add source to source cookie cartItems[cartItems.length] = String.fromCharCode(65 + cartSources.length) + id; cartSources[cartSources.length] = source; - Cookies.setItem(_COOKIE_SOURCES, cartSources.join(_COOKIE_DELIM), false, _COOKIE_PATH, _COOKIE_DOMAIN); + window.Cookies.set(_COOKIE_SOURCES, cartSources.join(_COOKIE_DELIM), _getCookieParams()); } else { cartItems[cartItems.length] = String.fromCharCode(65 + sIndex) + id; } - Cookies.setItem(_COOKIE, _uniqueArray(cartItems).join(_COOKIE_DELIM), false, _COOKIE_PATH, _COOKIE_DOMAIN); + window.Cookies.set(_COOKIE, _uniqueArray(cartItems).join(_COOKIE_DELIM), _getCookieParams()); updateCount(); return true; } @@ -135,11 +144,11 @@ VuFind.register('cart', function Cart() { } } if (cartItems.length > 0) { - Cookies.setItem(_COOKIE, _uniqueArray(cartItems).join(_COOKIE_DELIM), false, _COOKIE_PATH, _COOKIE_DOMAIN); - Cookies.setItem(_COOKIE_SOURCES, _uniqueArray(cartSources).join(_COOKIE_DELIM), false, _COOKIE_PATH, _COOKIE_DOMAIN); + window.Cookies.set(_COOKIE, _uniqueArray(cartItems).join(_COOKIE_DELIM), _getCookieParams()); + window.Cookies.set(_COOKIE_SOURCES, _uniqueArray(cartSources).join(_COOKIE_DELIM), _getCookieParams()); } else { - Cookies.removeItem(_COOKIE, _COOKIE_PATH, _COOKIE_DOMAIN); - Cookies.removeItem(_COOKIE_SOURCES, _COOKIE_PATH, _COOKIE_DOMAIN); + window.Cookies.remove(_COOKIE, _getCookieParams()); + window.Cookies.remove(_COOKIE_SOURCES, _getCookieParams()); } updateCount(); return true; @@ -267,6 +276,7 @@ VuFind.register('cart', function Cart() { hasItem: hasItem, removeItem: removeItem, setCookiePath: setCookiePath, + setCookieSameSite: setCookieSameSite, setDomain: setDomain, updateCount: updateCount, // Init diff --git a/themes/finc/images/arrow_down.svg b/themes/finc/images/arrow_down.svg new file mode 100644 index 0000000000000000000000000000000000000000..21fc7eaa023a4b92dcf89ee4b6735bf508478fea --- /dev/null +++ b/themes/finc/images/arrow_down.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="12px" y="0px" width="24px" height="3px" viewBox="0 0 6 3" enable-background="new 0 0 6 3" xml:space="preserve"><polygon points="5.992,0 2.992,3 -0.008,0 "/></svg> \ No newline at end of file diff --git a/themes/finc/scss/_customVariables.scss b/themes/finc/scss/_customVariables.scss index 025f14fca52c7484a1755f7155bca6ba52a2ec78..c2e385ca16f1b79173ccd322d0b870f11b4006e0 100644 --- a/themes/finc/scss/_customVariables.scss +++ b/themes/finc/scss/_customVariables.scss @@ -456,7 +456,7 @@ $select-bg-color: $snow !default; $select-remove-standard-down-arrow-background-image: none !default; $select-remove-standard-down-arrow-height: auto !default; // The next settings replaces the select down arrow -$select-default-arrow: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMTJweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIzcHgiIHZpZXdCb3g9IjAgMCA2IDMiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDYgMyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gcG9pbnRzPSI1Ljk5MiwwIDIuOTkyLDMgLTAuMDA4LDAgIi8+PC9zdmc+) !default; +$select-default-arrow: url('../../finc/images/arrow_down.svg') !default; $select-default-border-styles: $border-default-styles !default; $select-default-border-radius: 0 !default; $select-default-height: $navigation-element-default-height !default; diff --git a/themes/finc/scss/components/_record.scss b/themes/finc/scss/components/_record.scss new file mode 100644 index 0000000000000000000000000000000000000000..3343f986bec3de2b74e684a002d0f61026b79e3f --- /dev/null +++ b/themes/finc/scss/components/_record.scss @@ -0,0 +1,8 @@ +.record { + .media-body { + /* override */ + display: table-cell; + flex: none; + width: 10000px; + } +} \ No newline at end of file diff --git a/themes/finc/scss/finc.scss b/themes/finc/scss/finc.scss index 09d457ebc7a5fe7f347b71c30e21913578899a3b..c21d128ffddac15c0dc43cd0e3f53d6b81d227ff 100644 --- a/themes/finc/scss/finc.scss +++ b/themes/finc/scss/finc.scss @@ -33,6 +33,7 @@ @import 'components/modal'; @import 'components/offcanvas'; @import 'components/pagination'; +@import 'components/record'; @import 'components/record-tabs'; @import 'components/resolver-links'; @import 'components/result-list'; diff --git a/themes/finc/templates/Recommend/CollectionSideFacets.phtml b/themes/finc/templates/Recommend/CollectionSideFacets.phtml index 857aaebe70290cb3a96990151b81fb19478e9bc0..0c5e382c29fcc51f6d016aacd16528cf3bff8086 100644 --- a/themes/finc/templates/Recommend/CollectionSideFacets.phtml +++ b/themes/finc/templates/Recommend/CollectionSideFacets.phtml @@ -1,7 +1,7 @@ <!-- finc: recommend - collectionSideFacets --> <?php // finc changes 'Filter Collection' to 'In This Collection' - $this->overrideSideFacetCaption = 'In This Collection'; + $this->slot('side-facet-caption')->set('In This Collection'); $this->baseUriExtra = $this->recommend->getResults()->getParams()->getCollectionId(); ?> <?=$this->render('Recommend/SideFacets.phtml')?> diff --git a/themes/finc/templates/Recommend/SideFacets.phtml b/themes/finc/templates/Recommend/SideFacets.phtml index 571a5a3d95eba6f0d1c6d32259647a64e592a3f3..4b736c986512c0bc55c8cebe2ffe73ea3c7329a4 100644 --- a/themes/finc/templates/Recommend/SideFacets.phtml +++ b/themes/finc/templates/Recommend/SideFacets.phtml @@ -30,7 +30,7 @@ <?php /* finc changes btn-link to btn-primary */ ?> <button class="close-offcanvas btn btn-primary" data-toggle="offcanvas"><?=$this->transEsc('navigate_back') ?></button> <?php if ($results->getResultTotal() > 0): ?> - <h2><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></h2> + <h2><?=$this->transEsc($this->slot('side-facet-caption')->get('Narrow Search')) ?></h2> <?php endif; ?> <?php $checkboxFilters = $this->recommend->getCheckboxFacetSet(); ?> <?php $checkboxesShown = false; ?> diff --git a/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml b/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml index d70fbc1bbd2c0cf823977f3fdd22723b4946e8a8..d7bf4492353b0f3ca4da8cfd8f26ff005e0a7420 100644 --- a/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml +++ b/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml @@ -3,7 +3,7 @@ // also for germans: https://www.ub.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaaptikv&download=1 $filter = new Zend\Filter\Word\CamelCaseToSeparator(); // A driver-specific template may pass in format overrides; check for these before going to the driver itself: -$formats = isset($this->overrideFormats) ? $this->overrideFormats : $this->driver->tryMethod('getFormats'); +$formats = $this->slot('citavi-formats')->get($this->driver->tryMethod('getFormats')); if (is_array($formats) && !empty($formats)) { foreach ($formats as $format) { switch ($format) { diff --git a/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml b/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml index 19a6e94b4b2ae6f4fd4cce8283d06ecf3eebc58b..368d733b8e6bcb64acd821480a1ddb0667910cad 100644 --- a/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml +++ b/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml @@ -1,7 +1,7 @@ <?php $filter = new Zend\Filter\Word\CamelCaseToSeparator(); // A driver-specific template may pass in format overrides; check for these before going to the driver itself: -$formats = isset($this->overrideFormats) ? $this->overrideFormats : $this->driver->tryMethod('getFormats'); +$formats = $this->slot('endnote-formats')->get($this->driver->tryMethod('getFormats')); if (is_array($formats) && !empty($formats)) { foreach ($formats as $format) { $format = $filter->filter($format); diff --git a/themes/finc/templates/footer.phtml b/themes/finc/templates/footer.phtml deleted file mode 100644 index 1d10374d3bdb894f38d4ad241eeb6eae145e5fee..0000000000000000000000000000000000000000 --- a/themes/finc/templates/footer.phtml +++ /dev/null @@ -1,46 +0,0 @@ -<!-- finc: footer --> -<footer class="hidden-print"> - <div class="footer-container"> - <div class="footer-column"> - <h2><?=$this->transEsc('Search Options')?></h2> - <ul> - <li><a href="<?=$this->url('search-history')?>"><?=$this->transEsc('Search History')?></a></li> - <li><a href="<?=$this->url('search-advanced')?>"><?=$this->transEsc('Advanced Search')?></a></li> - </ul> - </div> - <div class="footer-column"> - <h2><?=$this->transEsc('Find More')?></h2> - <ul> - <li><a href="<?=$this->url('browse-home')?>"><?=$this->transEsc('Browse the Catalog')?></a></li> - <?php /* finc: activate, if necessary */ /* - <li><a href="<?=$this->url('alphabrowse-home')?>"><?=$this->transEsc('Browse Alphabetically')?></a></li> - */ ?> - <li><a href="<?=$this->url('channels-home')?>"><?=$this->transEsc('channel_explore')?></a></li> - <li><a href="<?=$this->url('search-reserves')?>"><?=$this->transEsc('Course Reserves')?></a></li> - <li><a href="<?=$this->url('search-newitem')?>"><?=$this->transEsc('New Items')?></a></li> - <?php /* finc-specific - CK */ ?> - <li><a href="<?=$this->url('myresearch-acquisition')?>"><?=$this->transEsc('Suggestions for acquisition')?></a></li> - </ul> - </div> - <div class="footer-column"> - <h2><?=$this->transEsc('Need Help?')?></h2> - <ul> - <li><a href="<?=$this->url('help-home')?>?topic=search&_=<?=time() ?>" data-lightbox class="help-link"><?=$this->transEsc('Search Tips')?></a></li> - <li><a href="<?=$this->url('content-page', ['page' => 'asklibrary']) ?>"><?=$this->transEsc('Ask a Librarian')?></a></li> - <li><a href="<?=$this->url('content-page', ['page' => 'faq']) ?>"><?=$this->transEsc('FAQs')?></a></li> - </ul> - </div> - </div> - <?php /* finc branding footer */ ?> - <hr> - <div class="footer-container poweredBy"> - <div class="footer-column"> - <span> - <?= $this->transEsc("Footer-Powered-By-Text") ?> - </span> - <?= $this->externalLink("https://vufind.org", '<img src="' . $this->imageLink('vufind_logo.png') . '" alt="' . $this->translate('vufind-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('vufind-logo_title')], true) ?> - <?= $this->externalLink("https://finc.info", '<img src="' . $this->imageLink('finc_logo.png') . '" alt="' . $this->translate('finc-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('finc-logo_title')], true) ?> - </div> - </div> -</footer> -<!-- finc: Footer - END --> diff --git a/themes/finc/templates/layout/layout.phtml b/themes/finc/templates/layout/layout.phtml index a96b33e8288f222db5daf4a09b6891f14cd8a3c2..98ac358d8a66f64b4aa1530ef00dbca2d4f3d5f5 100644 --- a/themes/finc/templates/layout/layout.phtml +++ b/themes/finc/templates/layout/layout.phtml @@ -96,7 +96,7 @@ // Deal with cart stuff: $cart = $this->cart(); if ($cart->isActive()) { - $this->headScript()->appendFile("vendor/cookies.js"); + $this->headScript()->appendFile("vendor/js.cookie.js"); $this->headScript()->appendFile("cart.js"); $domain = $cart->getCookieDomain(); if (!empty($domain)) { @@ -217,7 +217,7 @@ if (!isset($this->layout()->searchbox)) { <?php elseif (strcmp($this->layout()->userLang, 'de') == 0): ?> <a class="sr-only skip-to hidden-xs" href="#control-for-side-collapse-facet_avail"><?=$this->transEsc($this->overrideSideFacetCaption ?? 'Narrow Search')?></a> <?php else: ?> - <a class="sr-only skip-to hidden-xs" href="#control-for-side-collapse-facet_avail"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc($this->overrideSideFacetCaption ?? 'Narrow Search'))?></a> + <a class="sr-only skip-to hidden-xs" href="#control-for-side-collapse-facet_avail"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc($this->slot('side-facet-caption')->get('Narrow Search')))?></a> <?php endif; ?> <?php endif; ?> </div> @@ -260,8 +260,10 @@ if (!isset($this->layout()->searchbox)) { <?=$this->layout()->content?> </div> </div> -<?=$this->render('footer.phtml')?> +<?=$this->render('slots/footer-center.phtml')?> +<?=$this->render('slots/footer-bottom.phtml')?> +<?=$this->render('footer.phtml')?> <!-- MODAL IN CASE WE NEED ONE --> <?php /* finc: move X button to logical pos. in structure + use 'aria-describedby' instead of 'aria-labelledby - CK */ ?> diff --git a/themes/finc/templates/search/results.phtml b/themes/finc/templates/search/results.phtml index 10915467d2991d20e3d8bcbaa0bb5c6be7b91108..b2c415449912a52cbf12cfdc9979f3c413176b43 100644 --- a/themes/finc/templates/search/results.phtml +++ b/themes/finc/templates/search/results.phtml @@ -4,12 +4,10 @@ $this->context = 'search_result'; // Set up page title: - $lookfor = $this->results->getUrlQuery()->isQuerySuppressed() ? '' : $this->params->getDisplayQuery(); - if (isset($this->overrideTitle)) { - $this->headTitle($this->overrideTitle); - } else { - $this->headTitle($this->translate('Search Results') . (empty($lookfor) ? '' : " - {$lookfor}")); - } + $lookfor = $this->results->getUrlQuery()->isQuerySuppressed() ? '' : $this->params->getDisplayQuery(); + $headTitle = $this->slot('head-title') + ->get($this->translate('Search Results') . (empty($lookfor) ? '' : " - {$lookfor}")); + $this->headTitle($headTitle); // Set up search box: $this->layout()->searchbox = $this->context($this)->renderInContext( @@ -30,11 +28,7 @@ ); // Set up breadcrumbs: - if (isset($this->overrideTitle)) { - $this->layout()->breadcrumbs .= '<li class="active">' . $this->escapeHtml($this->overrideTitle) . '</li>'; - } else { - $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc('Search') . ': ' . $this->escapeHtml($lookfor) . '</li>'; - } + $this->layout()->breadcrumbs = '<li class="active">' . $this->escapeHtml($headTitle) . '</li>'; // Enable cart if appropriate: $this->showBulkOptions = $this->params->getOptions()->supportsCart() && $this->showBulkOptions; @@ -143,12 +137,7 @@ <?php if ($recordTotal < 1): ?> <p> - <?php if (isset($this->overrideEmptyMessage)): ?> - <?=$this->overrideEmptyMessage?> - <?php else: ?> - <?php $this->layout()->srmessage = $this->translate('nohit_lookfor_html', ['%%lookfor%%' => $this->escapeHtml($lookfor)]); ?> - <?=$this->layout()->srmessage ?> - <?php endif; ?> + <?=$this->slot('empty-message')->get($this->translate('nohit_lookfor_html', ['%%lookfor%%' => $this->escapeHtml($lookfor)])); ?> </p> <?php if (isset($this->parseError)): ?> <p class="alert alert-danger" aria-live="polite"><?=$this->transEsc('nohit_parse_error')?></p> diff --git a/themes/finc/templates/slots/footer-bottom.phtml b/themes/finc/templates/slots/footer-bottom.phtml new file mode 100644 index 0000000000000000000000000000000000000000..4565c06a4680963196cd2e8b743f329ed068b4b3 --- /dev/null +++ b/themes/finc/templates/slots/footer-bottom.phtml @@ -0,0 +1,13 @@ +<?php $this->slot('footer-bottom')->start(); ?> +<hr> +<div class="footer-container poweredBy"> + <div class="footer-column"> + <span> + <?= $this->transEsc("Footer-Powered-By-Text") ?> + </span> + <?= $this->externalLink("https://vufind.org", '<img src="' . $this->imageLink('vufind_logo.png') . '" alt="' . $this->translate('vufind-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('vufind-logo_title')], true) ?> + <?= $this->externalLink("https://finc.info", '<img src="' . $this->imageLink('finc_logo.png') . '" alt="' . $this->translate('finc-logo_alt') . '" aria-hidden="true"/>', ['title' => $this->translate('finc-logo_title')], true) ?> + </div> +</div> +<?php $this->layout()->poweredBy = $this->slot('footer-bottom')->end(); ?> + diff --git a/themes/finc/templates/slots/footer-center.phtml b/themes/finc/templates/slots/footer-center.phtml new file mode 100644 index 0000000000000000000000000000000000000000..4c03d82c8118b76c23c1258747ca6983c90d1fee --- /dev/null +++ b/themes/finc/templates/slots/footer-center.phtml @@ -0,0 +1,10 @@ +<?php $this->slot('footer-center')->start(); ?> +<h2><?=$this->transEsc('Find More')?></h2> +<ul> + <li><a href="<?=$this->url('browse-home')?>"><?=$this->transEsc('Browse the Catalog')?></a></li> + <li><a href="<?=$this->url('channels-home')?>"><?=$this->transEsc('channel_explore')?></a></li> + <li><a href="<?=$this->url('search-reserves')?>"><?=$this->transEsc('Course Reserves')?></a></li> + <li><a href="<?=$this->url('search-newitem')?>"><?=$this->transEsc('New Items')?></a></li> + <li><a href="<?=$this->url('myresearch-acquisition')?>"><?=$this->transEsc('Suggestions for acquisition')?></a></li> +</ul> +<?php $this->slot('footer-center')->end(); ?>