From 1028a08b36a8ea34723e4da7262f04e9e356a579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Maa=C3=9F?= <mathias.maass@uni-leipzig.de> Date: Mon, 27 Feb 2023 12:39:54 +0100 Subject: [PATCH] refs #23073 [finc] vf7 update templates * update all finc theme files * change serveral namespace paths from 'Zend' to 'Laminas' * fix style of record table and cover * update channels.js and channelList.phtml * update all finc-accessibility theme files * update js: advanced_search.js, check_item_statuses.js, lightbox.js, record.js * in advanced search: fix focus for added search field * fix breadcrumb color * disable list tags * update config to translate facet values * fix record data table size * fix facet list expand/collapse --- local/config/vufind/config.ini | 2 +- local/config/vufind/facets.ini | 3 +- themes/finc-accessibility/js/record.js | 72 ++++++++++++++---- .../templates/Auth/AbstractBase/login.phtml | 2 +- .../Auth/AbstractBase/newpassword.phtml | 4 +- .../templates/Auth/Database/create.phtml | 4 +- .../templates/Auth/MultiILS/loginfields.phtml | 2 +- .../templates/Recommend/DOI.phtml | 4 +- .../Recommend/SideFacets/cluster-list.phtml | 15 ++-- .../Recommend/SideFacets/facet.phtml | 3 +- .../RecordDriver/EDS/result-list.phtml | 38 ++++++---- .../RecordTab/similaritemscarousel.phtml | 10 +-- .../templates/channels/channelList.phtml | 5 +- .../templates/myresearch/delete.phtml | 2 +- .../templates/myresearch/menu.phtml | 6 +- .../templates/search/facet-list.phtml | 4 +- themes/finc/js/advanced_search.js | 27 +++++-- themes/finc/js/channels.js | 15 +++- themes/finc/js/check_item_statuses.js | 75 ++++++++++++------- themes/finc/js/lightbox.js | 42 +++++++---- themes/finc/scss/components/_breadcrumbs.scss | 10 ++- themes/finc/scss/components/_record.scss | 15 ++-- themes/finc/scss/components/_sidebar.scss | 4 + .../templates/ContentBlock/FacetList.phtml | 2 +- themes/finc/templates/Helpers/openurl.phtml | 6 +- .../finc/templates/Recommend/SideFacets.phtml | 3 +- .../Recommend/SideFacets/range-slider.phtml | 6 +- .../Recommend/SideFacets/single-facet.phtml | 4 +- .../AbstractBase/export-citavi.phtml | 2 +- .../AbstractBase/export-endnote.phtml | 2 +- .../DefaultRecord/collection-info.phtml | 4 +- .../RecordDriver/DefaultRecord/core.phtml | 8 +- .../DefaultRecord/data-authors.phtml | 2 +- .../DefaultRecord/result-list.phtml | 24 +++--- .../RecordDriver/DefaultRecord/toolbar.phtml | 3 +- .../templates/RecordTab/collectionlist.phtml | 4 +- .../templates/RecordTab/hierarchytree.phtml | 10 +-- .../templates/RecordTab/holdingsils.phtml | 10 +-- themes/finc/templates/admin/i18n/home.phtml | 2 +- themes/finc/templates/ajax/resolverLink.phtml | 2 +- themes/finc/templates/alphabrowse/home.phtml | 10 +-- themes/finc/templates/amsl/sources-list.phtml | 2 +- themes/finc/templates/breadcrumbs/multi.phtml | 3 +- themes/finc/templates/browse/home.phtml | 6 +- themes/finc/templates/cart/cart.phtml | 19 +++-- themes/finc/templates/cart/contents.phtml | 2 +- themes/finc/templates/cart/email.phtml | 4 +- themes/finc/templates/cart/save.phtml | 6 +- themes/finc/templates/collection/view.phtml | 67 ++++++++--------- .../documentdeliveryservice/zform.phtml | 14 ++-- themes/finc/templates/layout/layout.phtml | 46 +++++++----- .../templates/librarycards/editcard.phtml | 8 +- themes/finc/templates/librarycards/home.phtml | 4 +- .../finc/templates/myresearch/account.phtml | 2 +- .../templates/myresearch/cataloglogin.phtml | 4 +- .../templates/myresearch/checkedout.phtml | 6 +- themes/finc/templates/myresearch/edit.phtml | 2 +- .../finc/templates/myresearch/editlist.phtml | 9 ++- themes/finc/templates/myresearch/fines.phtml | 2 + themes/finc/templates/myresearch/holds.phtml | 18 +++-- .../templates/myresearch/illrequests.phtml | 16 ++-- themes/finc/templates/myresearch/mylist.phtml | 5 +- .../templates/myresearch/newpassword.phtml | 2 +- .../myresearch/storageretrievalrequests.phtml | 16 ++-- themes/finc/templates/record/addtag.phtml | 4 +- .../finc/templates/record/cart-buttons.phtml | 4 +- themes/finc/templates/record/checkbox.phtml | 2 +- themes/finc/templates/record/prev-next.phtml | 10 +-- .../templates/record/reporterrorsform.phtml | 2 +- themes/finc/templates/record/save.phtml | 4 +- themes/finc/templates/record/view.phtml | 12 ++- .../templates/search/advanced/layout.phtml | 35 +++++---- .../templates/search/advanced/ranges.phtml | 2 +- .../finc/templates/search/advanced/solr.phtml | 22 +++++- .../search/bulk-action-buttons.phtml | 8 +- .../templates/search/controls/limit.phtml | 5 +- .../search/controls/results-tools.phtml | 20 +++++ .../finc/templates/search/controls/sort.phtml | 2 +- themes/finc/templates/search/filters.phtml | 4 +- .../finc/templates/search/history-table.phtml | 12 +-- themes/finc/templates/search/history.phtml | 2 +- themes/finc/templates/search/home.phtml | 6 +- themes/finc/templates/search/newitem.phtml | 2 +- themes/finc/templates/search/pagination.phtml | 12 +-- themes/finc/templates/search/reserves.phtml | 6 +- .../templates/search/reservessearch.phtml | 12 +-- themes/finc/templates/search/results.phtml | 59 ++++++--------- themes/finc/templates/search/searchbox.phtml | 15 ++-- themes/finc/theme.config.php | 2 +- 89 files changed, 596 insertions(+), 399 deletions(-) create mode 100644 themes/finc/templates/search/controls/results-tools.phtml diff --git a/local/config/vufind/config.ini b/local/config/vufind/config.ini index 07d9024f1cb..89af80c4d1c 100644 --- a/local/config/vufind/config.ini +++ b/local/config/vufind/config.ini @@ -2032,7 +2032,7 @@ lists_view=full ; When disabling tags, don't forget to also turn off tag search in searches.ini. tags = disabled ; User list tags may be "enabled" or "disabled" (default = "disabled") -listTags = enabled +listTags = disabled ; This controls the maximum length of a single tag; it should correspond with the ; field size in the tags database table. max_tag_length = 64 diff --git a/local/config/vufind/facets.ini b/local/config/vufind/facets.ini index cc9ae187fd5..98211df0c00 100644 --- a/local/config/vufind/facets.ini +++ b/local/config/vufind/facets.ini @@ -241,7 +241,8 @@ special_facets = "daterange" ; below, no facets will be translated. ;translated_facets[] = institution ;translated_facets[] = building -translated_facets[] = format +translated_facets[] = facet_avail +translated_facets[] = format_finc translated_facets[] = language translated_facets[] = mega_collection translated_facets[] = finc_class_facet diff --git a/themes/finc-accessibility/js/record.js b/themes/finc-accessibility/js/record.js index d9b01b9a996..c8dd83ad256 100644 --- a/themes/finc-accessibility/js/record.js +++ b/themes/finc-accessibility/js/record.js @@ -90,17 +90,11 @@ function registerAjaxCommentRecord(_context) { var id = form.id.value; var recordSource = form.source.value; var url = VuFind.path + '/AJAX/JSON?' + $.param({ method: 'commentRecord' }); - var data = { - comment: form.comment.value, - id: id, - source: recordSource - }; - if (typeof grecaptcha !== 'undefined') { - var recaptcha = $(form).find('.g-recaptcha'); - if (recaptcha.length > 0) { - data['g-recaptcha-response'] = grecaptcha.getResponse(recaptcha.data('captchaId')); - } - } + var data = {}; + $(form).find("input,textarea").each(function appendCaptchaData() { + var input = $(this); + data[input.attr('name')] = input.val(); + }); $.ajax({ type: 'POST', url: url, @@ -134,6 +128,28 @@ function registerAjaxCommentRecord(_context) { return false; } +// Forward declaration +var ajaxLoadTab = function ajaxLoadTabForward() { +}; + +function handleAjaxTabLinks(_context) { + var context = typeof _context === "undefined" ? document : _context; + // Form submission + $(context).find('a').each(function handleLink() { + var $a = $(this); + var href = $a.attr('href'); + if (typeof href !== 'undefined' && href.match(/\/AjaxTab[/?]/)) { + $a.unbind('click').click(function linkClick() { + var tabid = $('.record-tabs .nav-tabs li.active').data('tab'); + var $tab = $('.' + tabid + '-tab'); + $tab.html('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i> ' + VuFind.translate('loading') + '...</div>'); + ajaxLoadTab($tab, '', false, href); + return false; + }); + } + }); +} + function registerTabEvents() { // Logged in AJAX registerAjaxCommentRecord(); @@ -142,16 +158,31 @@ function registerTabEvents() { setUpCheckRequest(); + handleAjaxTabLinks(); + VuFind.lightbox.bind('.tab-pane.active'); + + if (typeof VuFind.openurl !== 'undefined') { + VuFind.openurl.init($('.tab-pane.active')); + } } // 'function removeHashFromLocation()' removed in #21555 to irritating prevent jump to content -function ajaxLoadTab($newTab, tabid, setHash) { +ajaxLoadTab = function ajaxLoadTabReal($newTab, tabid, setHash, tabUrl) { // Request the tab via AJAX: + var url = ''; + var postData = {}; + // If tabUrl is defined, it overrides base URL and tabid + if (typeof tabUrl !== 'undefined') { + url = tabUrl; + } else { + url = VuFind.path + getUrlRoot(document.URL) + '/AjaxTab'; + postData.tab = tabid; + } $.ajax({ - url: VuFind.path + getUrlRoot(document.URL) + '/AjaxTab', + url: url, type: 'POST', - data: {tab: tabid} + data: postData, }) .always(function ajaxLoadTabDone(data) { if (typeof data === 'object') { @@ -167,7 +198,7 @@ function ajaxLoadTab($newTab, tabid, setHash) { $('.tab-pane.active').find(':focusable').eq(0).focus(); }); return false; -} +}; function refreshTagList(_target, _loggedin) { var loggedin = !!_loggedin || userIsLoggedIn; @@ -236,7 +267,18 @@ function backgroundLoadTab(tabid) { } // 'function applyRecordTabHash() ...' replaced in #21555 to irritating prevent jump to content + +function removeCheckRouteParam() { + if (window.location.search.indexOf('checkRoute=1') >= 0) { + var newHref = window.location.href.replace('?checkRoute=1&', '?').replace(/[?&]checkRoute=1/, ''); + if (window.history && window.history.replaceState) { + window.history.replaceState({}, '', newHref); + } + } +} + function recordDocReady() { + removeCheckRouteParam(); $('.record-tabs .nav-tabs a').click(function recordTabsClick() { var $li = $(this).parent(); // If it's an active tab, click again to follow to a shareable link. diff --git a/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml b/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml index 374f8f82b89..7d7d015eb33 100644 --- a/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml +++ b/themes/finc-accessibility/templates/Auth/AbstractBase/login.phtml @@ -8,7 +8,7 @@ <input type="hidden" name="csrf" value="<?=$this->escapeHtmlAttr($account->getCsrfHash())?>" /> <div class="form-group"> <?php /* finc adds aria-label */ ?> - <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEsc("Login-to-account") ?>" value="<?=$this->transEsc('Login')?>"> + <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEscAttr("Login-to-account") ?>" value="<?=$this->transEscAttr('Login')?>"> <?php if ($account->supportsCreation()): ?> <a class="btn btn-link createAccountLink" href="<?=$this->url('myresearch-account') ?>?auth_method=<?=$account->getAuthMethod()?>"><?=$this->transEsc('Create New Account')?></a> <?php endif; ?> diff --git a/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml b/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml index 35626b63116..d8535cac4d0 100644 --- a/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml +++ b/themes/finc-accessibility/templates/Auth/AbstractBase/newpassword.phtml @@ -30,7 +30,7 @@ <?php /* finc adds 'for' + 'autocomplete' + 'aria-describedby' for accessibility */ ?> <label for="password" class="control-label"><?=$this->transEsc('new_password') ?>:</label> <input type="password" id="password" name="password" class="form-control" required aria-required="true" - <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : '' ?> + <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->transEscAttr('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']]) . '"' : '' ?> <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : '' ?> <?=$pattern ? ' pattern="' . $pattern . '"' : '' ?> autocomplete="new-password" @@ -45,7 +45,7 @@ <div class="form-group"> <?php /* finc adds 'for' + 'ids' + 'autocomplete' + 'aria-describedby' for accessibility */ ?> <label for="password2" class="control-label"><?=$this->transEsc('confirm_new_password') ?>:</label> - <input id="password2" type="password" name="password2" class="form-control" required aria-required="true" data-match="#password" data-match-error="<?=$this->escapeHtmlAttr($this->translate('Passwords do not match'))?>" autocomplete="new-password" aria-describedby="password2-error"/> + <input id="password2" type="password" name="password2" class="form-control" required aria-required="true" data-match="#password" data-match-error="<?=$this->transEscAttr('Passwords do not match')?>" autocomplete="new-password" aria-describedby="password2-error"/> <div id="password2-error" class="help-block with-errors"></div> </div> <!-- finc-accessibility: Auth - AbstractBase - newpassword - END --> \ No newline at end of file diff --git a/themes/finc-accessibility/templates/Auth/Database/create.phtml b/themes/finc-accessibility/templates/Auth/Database/create.phtml index c3f5c573737..6bd51a7ab58 100644 --- a/themes/finc-accessibility/templates/Auth/Database/create.phtml +++ b/themes/finc-accessibility/templates/Auth/Database/create.phtml @@ -34,7 +34,7 @@ <div class="form-group"> <label class="control-label" for="account_password"><?=$this->transEsc('Password')?>:</label> <input id="account_password" type="password" name="password" required aria-required="true" class="form-control" - <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->escapeHtmlAttr($this->translate('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']])) . '"' : ''?> + <?=isset($this->passwordPolicy['minLength']) ? ' data-minlength="' . $this->passwordPolicy['minLength'] . '" data-minlength-error="' . $this->transEscAttr('password_minimum_length', ['%%minlength%%' => $this->passwordPolicy['minLength']]) . '"' : ''?> <?=isset($this->passwordPolicy['maxLength']) ? ' maxlength="' . $this->passwordPolicy['maxLength'] . '"' : ''?> <?=$pattern ? ' pattern="' . $pattern . '"' : '' ?> autocomplete="new-password" @@ -46,7 +46,7 @@ </div> <div class="form-group"> <label class="control-label" for="account_password2"><?=$this->transEsc('Password Again')?>:</label> - <input id="account_password2" type="password" name="password2" required aria-required="true" class="form-control" data-match="#account_password" data-match-error="<?=$this->escapeHtmlAttr($this->translate('Passwords do not match'))?>" autocomplete="new-password"/> + <input id="account_password2" type="password" name="password2" required aria-required="true" class="form-control" data-match="#account_password" data-match-error="<?=$this->transEscAttr('Passwords do not match')?>" autocomplete="new-password"/> <div class="help-block with-errors"></div> </div> <!-- finc-accessibility: auth - database - create - END --> diff --git a/themes/finc-accessibility/templates/Auth/MultiILS/loginfields.phtml b/themes/finc-accessibility/templates/Auth/MultiILS/loginfields.phtml index 96043af54d5..ffba7c42ae2 100644 --- a/themes/finc-accessibility/templates/Auth/MultiILS/loginfields.phtml +++ b/themes/finc-accessibility/templates/Auth/MultiILS/loginfields.phtml @@ -32,6 +32,6 @@ $script = "setupMultiILSLoginFields($methods, 'login_{$topClass}_');"; // Inline the script for lightbox compatibility - echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); + echo $this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> <!-- finc-accessibility: auth - multiils - loginfields.phtml - END --> diff --git a/themes/finc-accessibility/templates/Recommend/DOI.phtml b/themes/finc-accessibility/templates/Recommend/DOI.phtml index 4aadae42a17..1a1581032a6 100644 --- a/themes/finc-accessibility/templates/Recommend/DOI.phtml +++ b/themes/finc-accessibility/templates/Recommend/DOI.phtml @@ -6,9 +6,9 @@ <p class="alert alert-info" aria-live="polite"> <?=$this->translate('doi_detected_html', ['%%url%%' => $url, '%%doi%%' => $doi])?> </p> - <?php if ($this->recommend->isFullMatch()): ?> + <?php if ($this->recommend->isFullMatch() && $this->recommend->redirectFullMatch()): ?> <?php $redirect = 'document.location.href = "' . $this->escapeJs($url) . '";'; ?> - <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $redirect, 'SET')?> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $redirect, 'SET')?> <?php endif; ?> <?php endif; ?> <!-- finc-accessibility: Recommend - DOI - END --> diff --git a/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml b/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml index 76fd394bd1e..f63a04b056b 100644 --- a/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml +++ b/themes/finc-accessibility/templates/Recommend/SideFacets/cluster-list.phtml @@ -1,5 +1,5 @@ <!-- finc-accessibility - Recommend - SideFacets - cluster-list --> -<?php $idAndClass = 'id="more-narrowGroupHidden-' . $this->escapeHtmlAttr($this->title) . '" class="facet narrow-toggle"'; ?> +<?php $idAndClass = 'id="more-narrowGroupHidden-' . $this->escapeHtmlAttr($this->title) . '" class="facet narrow-toggle more-facets"'; ?> <?php $moreClass = 'narrowGroupHidden-' . $this->escapeHtmlAttr($this->title) . ' hidden'; ?> <?php foreach ($this->cluster['list'] as $i => $thisFacet): ?> <?php if ($i == $this->facets_before_more): ?> @@ -15,9 +15,9 @@ <?php break; ?> <?php endif; ?> <?php /* finc adds li for correct list entries and uses 'a class="text"' */ ?> - <li <?=$idAndClass ?>> - <a class="text" href="<?=$moreUrl ?>" onclick="event.stopImmediatePropagation(); return moreFacets('narrowGroupHidden-<?=$this->escapeHtmlAttr($this->title) ?>');" rel="nofollow"> - <?=$this->transEsc('more')?> ... + <li> + <a <?=$idAndClass ?> href="<?=$moreUrl ?>" data-title="<?=$this->escapeHtmlAttr($this->title) ?>" rel="nofollow"> + <span class="text"><?=$this->transEsc('more')?> ...</span> </a> </li> <?php endif; ?> @@ -51,9 +51,10 @@ </a> </li> <?php endif; ?> - <li class="facet narrow-toggle <?=$moreClass ?>"> - <a class="text" href="#" onclick="event.stopImmediatePropagation(); return lessFacets('narrowGroupHidden-<?=$this->escapeHtmlAttr($this->title) ?>');"> - <?=$this->transEsc('less')?> ... + <?php /* finc: li */ ?> + <li> + <a class="facet narrow-toggle <?=$moreClass ?> less-facets" href="#" data-title="<?=$this->escapeHtmlAttr($this->title) ?>"> + <span class="text"><?=$this->transEsc('less')?> ...</span> </a> </li> <?php endif; ?> diff --git a/themes/finc-accessibility/templates/Recommend/SideFacets/facet.phtml b/themes/finc-accessibility/templates/Recommend/SideFacets/facet.phtml index 5a57cbf7ac6..474469d760d 100644 --- a/themes/finc-accessibility/templates/Recommend/SideFacets/facet.phtml +++ b/themes/finc-accessibility/templates/Recommend/SideFacets/facet.phtml @@ -33,7 +33,8 @@ 'allowExclude' => $this->recommend->excludeAllowed($facet), 'title' => $facet, 'sortOptions' => $hierarchicalFacetSortOptions[$facet] ?? $hierarchicalFacetSortOptions['*'] ?? null, - 'collapsedFacets' => $this->collapsedFacets + 'collapsedFacets' => $this->collapsedFacets, + 'results' => $this->results ] ); ?> <noscript> diff --git a/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml b/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml index e467a2bbf53..24f8e44d39e 100644 --- a/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml +++ b/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml @@ -6,6 +6,7 @@ $accessLevel = $this->driver->getAccessLevel(); $restrictedView = empty($accessLevel) ? false : true; $coverDetails = $this->record($this->driver)->getCoverDetails('result-list', 'medium', $this->recordLink()->getUrl($this->driver)); + $cover = $coverDetails['html']; ?> <?php $thumbnail = false; @@ -13,14 +14,9 @@ ob_start(); ?> <?php /* finc adds aria and tabindex - Fixme: Re-evaluate during updates */ ?> <div class="media-<?=$thumbnailAlignment ?> <?=$this->escapeHtml($coverDetails['size'])?>" aria-hidden="true"> - <?php if ($coverDetails['cover']): ?> - <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="_record_link" tabindex="-1"> - <img src="<?=$this->escapeHtmlAttr($coverDetails['cover'])?>" class="recordcover" alt="<?=$this->transEsc('Cover Image')?>"/> - </a> - <?php else: ?> - <span class="recordcover pt-icon pt-<?=$this->driver->getPubTypeId()?>"></span> - <div><?=$this->driver->getPubType()?></div> - <?php endif; ?> + <div class="media-<?=$thumbnailAlignment ?> <?=$this->escapeHtmlAttr($coverDetails['size'])?>"> + <?=$cover ?> + </div> </div> <?php $thumbnail = ob_get_contents(); ?> <?php ob_end_clean(); ?> @@ -32,7 +28,7 @@ <?php endif; ?> <div class="media-body"> <div class="result-body"> - <?php $items = $this->driver->getItems(); + <?php $items = $this->driver->getItems('result-list'); if (isset($items) && !empty($items)): foreach ($items as $item): if (!empty($item)): ?> @@ -57,7 +53,7 @@ <p> <?=$this->transEsc('This result is not displayed to guests')?> <br /> - <a class="login" href="<?=$this->url('myresearch-home')?>"> + <a class="login" href="<?=$this->url('myresearch-userlogin')?>"> <strong><?=$this->transEsc('Login for full access')?></strong> </a> </p> @@ -90,15 +86,27 @@ <?php endif; ?> + <?php if ($this->driver->hasLinkedFullTextAvailable()): ?> + <a href="<?= $this->recordLink()->getTabUrl($this->driver, 'LinkedText'); ?>" class="fulltext" target="_blank"> + <?=$this->transEsc('Linked Full Text')?> + </a> + <?php endif; ?> + <?php if ($this->driver->hasPdfAvailable()): ?> <a href="<?= $this->recordLink()->getTabUrl($this->driver, 'PDF'); ?>" class="icon pdf fulltext" target="_blank"> <?=$this->transEsc('PDF Full Text')?> </a> <?php endif; ?> + <?php if ($this->driver->hasEpubAvailable()): ?> + <a href="<?= $this->recordLink()->getTabUrl($this->driver, 'Epub'); ?>" class="icon epub fulltext" target="_blank"> + <?=$this->transEsc('ePub Full Text')?> + </a> + <?php endif; ?> + <?php /* Links from DOI linker */ ?> <?php $doi = $this->doi($this->driver, 'results'); if ($doi->isActive()):?> - <?=$doi->renderTemplate()?> + <div><?=$doi->renderTemplate()?><div> <?php endif; ?> </div> <div class="result-links hidden-print"> @@ -112,7 +120,7 @@ <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> <div class="qrcode hidden"> <script class="qrCodeImgTag"> - <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + <img alt="<?=$this->transEscAttr('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> </script> </div><br/> </span> @@ -124,7 +132,7 @@ <?php if ($this->userlist()->getMode() !== 'disabled'): ?> <?php /* Add to favorites */ ?> - <i class="fa fa-fw fa-star" aria-hidden="true"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record" data-lightbox id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/> + <i class="fa fa-fw fa-star" aria-hidden="true"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record" data-lightbox id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEscAttr('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/> <?php /* Saved lists, finc uses aria-live */ ?> <p class="savedLists" aria-live="polite"> @@ -138,12 +146,14 @@ <div class="hierarchyTreeLink"> <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" /> <i class="fa fa-fw fa-sitemap" aria-hidden="true"></i> - <a class="hierarchyTreeLinkText" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>"> + <a class="hierarchyTreeLinkText" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEscAttr('hierarchy_tree')?>"> <?=$this->transEsc('hierarchy_view_context')?><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?> </a> </div> <?php endforeach; ?> <?php endif; ?> + + <?=(!$restrictedView && $this->driver->supportsCoinsOpenUrl())?'<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()) . '"></span>':''?> </div> </div> <?php if ($thumbnail && $thumbnailAlignment == 'right'): ?> diff --git a/themes/finc-accessibility/templates/RecordTab/similaritemscarousel.phtml b/themes/finc-accessibility/templates/RecordTab/similaritemscarousel.phtml index a740f71d776..1eb9630e71f 100644 --- a/themes/finc-accessibility/templates/RecordTab/similaritemscarousel.phtml +++ b/themes/finc-accessibility/templates/RecordTab/similaritemscarousel.phtml @@ -1,7 +1,7 @@ <!-- finc-accessibility - RecordTab - similaritemscarousel --> <?php /* finc adds language-specific translations for carousel */ ?> <?php if (strcmp($this->layout()->userLang, 'de') == 0): ?> - <?=$this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'vendor/bootstrap-accessibility-de.min.js', 'SET');?> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, 'vendor/bootstrap-accessibility-de.min.js', 'SET');?> <?php endif; ?> <h2><?=$this->transEsc('Similar Items')?></h2> <?php $similarRecords = $this->tab->getResults(); ?> @@ -22,8 +22,7 @@ <?php foreach ($similarRecords as $index => $data): ?> <div class="carousel-item"> <a class="hover-overlay" href="<?=$this->recordLink()->getUrl($data)?>"> - <?php $thumb = $this->record($data)->getThumbnail('large'); ?> - <img src="<?=$thumb ?>" title="<?=$data->getTitle() ?>"/> + <?=$this->record($data)->getCoverDetails('core', 'large')['html']?> <div class="content"> <?php $formats = $data->getFormats(); ?> <i class="fa fa-x<?php if (count($formats) > 0): ?> fa-<?=preg_replace('/[^a-z0-9]/', '', strtolower($formats[0]))?>" title="<?=$formats[0] ?><?php endif; ?>"></i> @@ -57,7 +56,8 @@ <p><?=$this->transEsc('Cannot find similar records')?></p> <?php endif; ?> <?php - $script = <<<JS + $script = $this->config()->ajaxCoversEnabled() ? "loadCovers();\n" : ""; + $script .= <<<JS var normalizeHeightCount = $('#similar-items-carousel img').length; function normalizeHeights() { if(--normalizeHeightCount > 0) return; @@ -73,5 +73,5 @@ function normalizeHeights() { $('#similar-items-carousel img').load(normalizeHeights); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> <!-- finc-accessibility - RecordTab - similaritemscarousel - END --> diff --git a/themes/finc-accessibility/templates/channels/channelList.phtml b/themes/finc-accessibility/templates/channels/channelList.phtml index db441a53c01..468f950fce5 100644 --- a/themes/finc-accessibility/templates/channels/channelList.phtml +++ b/themes/finc-accessibility/templates/channels/channelList.phtml @@ -5,7 +5,6 @@ $this->headLink()->appendStylesheet('vendor/slick-theme.css'); $this->headScript()->appendFile('vendor/slick.min.js'); $this->headScript()->appendFile('channels.js'); - $this->headScript()->appendFile('vendor/jquery.dotdotdot.min.js'); $this->jsTranslations()->addStrings([ 'channel_browse' => 'channel_browse', 'channel_expand' => 'channel_expand', @@ -31,7 +30,7 @@ <?=$this->transEsc('channel_searchbox_label')?> <?php /* finc adds 'aria-labels' for accessibility */ ?> <input type="text" name="lookfor" class="form-control" value="<?=$this->escapeHtmlAttr($this->lookfor) ?>" aria-label="<?=$this->transEsc('search_terms') ?>"/> - <input type="submit" value="<?=$this->escapeHtmlAttr($this->translate('Submit'))?>" class="btn btn-default" aria-label="<?=$this->transEsc('Submit') ?>" /> + <input type="submit" value="<?=$this->transEscAttr('Submit')?>" class="btn btn-default" aria-label="<?=$this->transEsc('Submit') ?>" /> </form> <?php endif; ?> @@ -68,7 +67,7 @@ <div class="thumb"> <img <?=$index < 6 ? "src" : "data-lazy" ?>="<?=$this->escapeHtmlAttr($item['thumbnail'] ? $item['thumbnail'] : $this->url('cover-unavailable'))?>"/> </div> - <?=$this->escapeHtml($item['title'])?> + <p class="channel-record-title"><?=$this->escapeHtml($item['title'])?></p> </a> <?php endforeach; ?> </div> diff --git a/themes/finc-accessibility/templates/myresearch/delete.phtml b/themes/finc-accessibility/templates/myresearch/delete.phtml index 65de8b04d3f..07d48aa825c 100644 --- a/themes/finc-accessibility/templates/myresearch/delete.phtml +++ b/themes/finc-accessibility/templates/myresearch/delete.phtml @@ -19,7 +19,7 @@ <?php endforeach; ?> </ul> <br /> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Delete')?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Delete')?>"/> <?php foreach ($this->deleteIDS as $deleteID): ?> <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($deleteID)?>" /> <?php endforeach; ?> diff --git a/themes/finc-accessibility/templates/myresearch/menu.phtml b/themes/finc-accessibility/templates/myresearch/menu.phtml index cd4def5af7a..1fc6bc68bf5 100644 --- a/themes/finc-accessibility/templates/myresearch/menu.phtml +++ b/themes/finc-accessibility/templates/myresearch/menu.phtml @@ -87,7 +87,11 @@ <a href="<?=$this->url('myresearch-fines')?>" class="flex<?=$this->active == 'fines' ? ' active' : ''?>" <?=$this->active == 'fines' ? ' aria-current="page"' : ''?> > - <span class="flex-col"><i class="fa fa-fw fa-usd" aria-hidden="true"></i> <?=$this->transEsc('Fines')?></span> + <?php + // Use a "fines" icon based on the configured default currency symbol: + $currency = strtolower($this->config()->get('config')->Site->defaultCurrency ?? 'usd'); + ?> + <span class="flex-col"><i class="fa fa-fw fa-<?=$this->escapeHtmlAttr($currency)?>" aria-hidden="true"></i> <?=$this->transEsc('Fines')?></span> <span class="fines-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span> </a> </li> diff --git a/themes/finc-accessibility/templates/search/facet-list.phtml b/themes/finc-accessibility/templates/search/facet-list.phtml index 3fdc40df2b5..e1d2067da5f 100644 --- a/themes/finc-accessibility/templates/search/facet-list.phtml +++ b/themes/finc-accessibility/templates/search/facet-list.phtml @@ -6,7 +6,7 @@ $this->sort = 'default'; $this->sortOptions = [ 'default' => 'default' ]; } - $urlBase = $this->url($facetLightbox) . $results->getUrlQuery()->getParams() . '&facet=' . urlencode($this->facet) . '&facetexclude=' . $this->exclude . '&facetop=' . $this->operator; + $urlBase = $this->url($facetLightbox) . $results->getUrlQuery()->getParams() . '&facet=' . urlencode($this->facet) . '&facetexclude=' . urlencode($this->exclude) . '&facetop=' . $this->operator; $searchAction = $this->url($options->getSearchAction()); if (!empty($this->baseUriExtra)) { $searchAction .= urlencode($this->baseUriExtra); @@ -53,5 +53,5 @@ <?php endforeach; ?> </div> <button class="btn btn-default lightbox-only" data-dismiss="modal"><?=$this->translate('close') ?></button> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '(typeof VuFind.lightbox_facets !== "undefined") && VuFind.lightbox_facets.setup();', 'SET'); ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, '(typeof VuFind.lightbox_facets !== "undefined") && VuFind.lightbox_facets.setup();', 'SET'); ?> <!-- finc-accessibility: search - facet-list - END --> diff --git a/themes/finc/js/advanced_search.js b/themes/finc/js/advanced_search.js index daafce424e0..04598bd2a6a 100644 --- a/themes/finc/js/advanced_search.js +++ b/themes/finc/js/advanced_search.js @@ -2,6 +2,7 @@ /* exported addGroup, addSearch, deleteGroup, deleteSearch */ var nextGroup = 0; var groupLength = []; +var deleteGroup, deleteSearch; function addSearch(group, _fieldValues, isUser) { var fieldValues = _fieldValues || {}; @@ -22,7 +23,11 @@ function addSearch(group, _fieldValues, isUser) { .attr('id', 'search_type' + inputID) .attr('name', 'type' + group + '[]'); $newSearch.find('.adv-term-remove') - .attr('onClick', 'return deleteSearch(' + group + ',' + groupLength[group] + ')'); + .data('group', group) + .data('groupLength', groupLength[group]) + .click(function deleteSearchHandler() { + return deleteSearch($(this).data('group'), $(this).data('groupLength')); + }); // Preset Values if (typeof fieldValues.term !== "undefined") { $newSearch.find('input.form-control').val(fieldValues.term); @@ -62,7 +67,7 @@ function addSearch(group, _fieldValues, isUser) { return false; } -function deleteSearch(group, sindex) { +deleteSearch = function _deleteSearch(group, sindex) { for (var i = sindex; i < groupLength[group] - 1; i++) { var $search0 = $('#search' + group + '_' + i); var $search1 = $('#search' + group + '_' + (i + 1)); @@ -84,7 +89,7 @@ function deleteSearch(group, sindex) { } } return false; -} +}; function addGroup(_firstTerm, _firstField, _join) { var firstTerm = _firstTerm || ''; @@ -103,10 +108,16 @@ function addGroup(_firstTerm, _firstField, _join) { .removeClass('hidden'); $newGroup.find('.add_search_link') .attr('id', 'add_search_link_' + nextGroup) - .attr('onClick', 'return addSearch(' + nextGroup + ', {}, true)') + .data('nextGroup', nextGroup) + .click(function addSearchHandler() { + return addSearch($(this).data('nextGroup'), {}, true); + }) .removeClass('hidden'); $newGroup.find('.adv-group-close') - .attr('onClick', 'return deleteGroup(' + nextGroup + ')'); + .data('nextGroup', nextGroup) + .click(function deleteGroupHandler() { + return deleteGroup($(this).data('nextGroup')); + }); $newGroup.find('select.form-control') .attr('id', 'search_bool' + nextGroup) .attr('name', 'bool' + nextGroup + '[]'); @@ -133,7 +144,7 @@ function addGroup(_firstTerm, _firstField, _join) { return nextGroup++; } -function deleteGroup(group) { +deleteGroup = function _deleteGroup(group) { // Find the group and remove it $("#group" + group).remove(); // If the last group was removed, add an empty group @@ -144,12 +155,12 @@ function deleteGroup(group) { $('.adv-group .adv-group-close').addClass('hidden'); // Hide x } return false; -} +}; $(document).ready(function advSearchReady() { $('.clear-btn').click(function clearBtnClick() { $('input[type="text"]').val(''); - $('select').not('#limit').find('option:selected').removeAttr('selected'); + $('select').not('#limit').find('option:selected').prop("selected", false); if (typeof defaultLimit !== 'undefined') { $("#limit").val(defaultLimit); } diff --git a/themes/finc/js/channels.js b/themes/finc/js/channels.js index c6f232cdf3a..988bb062386 100644 --- a/themes/finc/js/channels.js +++ b/themes/finc/js/channels.js @@ -61,6 +61,16 @@ VuFind.register('channels', function Channels() { } record.data('bs.popover').options.content = html; } + + // Truncate lines to height with ellipses + function clampLines(el) { + var words = el.innerHTML.split(" "); + while (el.scrollHeight > el.offsetHeight) { + words.pop(); + el.innerHTML = words.join(" ") + VuFind.translate("eol_ellipsis"); + } + } + function setupChannelSlider(i, op) { $(op).find(".slide").removeClass("hidden"); $(op).slick({ @@ -88,8 +98,6 @@ VuFind.register('channels', function Channels() { $(op).on('swipe', function channelDrag() { switchPopover(false); }); - // truncate long titles and add hover - $(op).find('.channel-record').dotdotdot(); $(op).find('.channel-record').unbind('click').click(function channelRecord(event) { var record = $(event.delegateTarget); if (!record.data("popover-loaded")) { @@ -129,6 +137,9 @@ VuFind.register('channels', function Channels() { .clone() .removeClass('hidden') .prependTo($(op).parent(".channel-wrapper")); + + // Fix title overflow + op.querySelectorAll(".channel-record-title").forEach(clampLines); } var bindChannelAddMenu; // circular dependency fix for jshint diff --git a/themes/finc/js/check_item_statuses.js b/themes/finc/js/check_item_statuses.js index e3571bd61d4..8cb2d9c7955 100644 --- a/themes/finc/js/check_item_statuses.js +++ b/themes/finc/js/check_item_statuses.js @@ -28,7 +28,7 @@ VuFind.register('itemStatuses', function ItemStatuses() { $item.find('.callnumAndLocation').empty().append(result.full_status); $item.find('.callnumber,.hideIfDetailed,.location,.status').addClass('hidden'); } else if (typeof(result.missing_data) !== 'undefined' - && result.missing_data + && result.missing_data ) { // No data is available -- hide the entire status area: $item.find('.callnumAndLocation,.status').addClass('hidden'); @@ -40,17 +40,17 @@ VuFind.register('itemStatuses', function ItemStatuses() { locationListHTML += '<div class="groupLocation">'; if (result.locationList[x].availability) { locationListHTML += '<span class="text-success"><i class="fa fa-ok" aria-hidden="true"></i> ' - + result.locationList[x].location + '</span> '; + + result.locationList[x].location + '</span> '; } else if (typeof(result.locationList[x].status_unknown) !== 'undefined' - && result.locationList[x].status_unknown + && result.locationList[x].status_unknown ) { if (result.locationList[x].location) { locationListHTML += '<span class="text-warning"><i class="fa fa-status-unknown" aria-hidden="true"></i> ' - + result.locationList[x].location + '</span> '; + + result.locationList[x].location + '</span> '; } } else { locationListHTML += '<span class="text-danger"><i class="fa fa-remove" aria-hidden="true"></i> ' - + result.locationList[x].location + '</span> '; + + result.locationList[x].location + '</span> '; } locationListHTML += '</div>'; locationListHTML += '<div class="groupCallnumber">'; @@ -60,7 +60,7 @@ VuFind.register('itemStatuses', function ItemStatuses() { } $item.find('.locationDetails').removeClass('hidden'); $item.find('.locationDetails').html(locationListHTML); - // next three lines finc-specific, added in #5737, check functionality, CK - Fixme 5.1 + // next three lines finc-specific, added in #5737, check functionality, CK - Fixme 5.1 } else if (result.callnumber.length == 0 && result.location.length == 0) { // hide location and callnumber information if both are empty $item.find('.callnumAndLocation').addClass('hidden'); @@ -77,8 +77,8 @@ VuFind.register('itemStatuses', function ItemStatuses() { var ItemStatusHandler = { name: "default", - //array to hold IDs and elements - itemStatusIds: [], itemStatusEls: [], + // Object that holds item IDs, states and elements + items: {}, url: '/AJAX/JSON?method=getItemStatuses', itemStatusRunning: false, dataType: 'json', @@ -90,8 +90,11 @@ VuFind.register('itemStatuses', function ItemStatuses() { var data = response.data; for (var j = 0; j < data.statuses.length; j++) { var status = data.statuses[j]; - displayItemStatus(status, this.itemStatusEls[status.id]); - this.itemStatusIds.splice(this.itemStatusIds.indexOf(status.id), 1); + this.items[status.id].result = status; + this.items[status.id].state = 'done'; + for (var e = 0; e < this.items[status.id].elements.length; e++) { + displayItemStatus(status, this.items[status.id].elements[e]); + } } }, itemStatusFail: function itemStatusFail(response, textStatus) { @@ -103,14 +106,27 @@ VuFind.register('itemStatuses', function ItemStatuses() { .append(typeof response.responseJSON.data === 'string' ? response.responseJSON.data : VuFind.translate('error_occurred')); }, itemQueueAjax: function itemQueueAjax(id, el) { - clearTimeout(this.itemStatusTimer); - this.itemStatusIds.push(id); - this.itemStatusEls[id] = el; - this.itemStatusTimer = setTimeout(this.runItemAjaxForQueue.bind(this), this.itemStatusDelay); el.addClass('js-item-pending').removeClass('hidden'); el.find('.callnumAndLocation').removeClass('hidden'); el.find('.callnumAndLocation .ajax-availability').removeClass('hidden'); el.find('.status').removeClass('hidden'); + // If this id has already been queued, just add it to the elements or display a + // cached result. + if (typeof this.items[id] !== 'undefined') { + if ('done' === this.items[id].state) { + displayItemStatus(this.items[id].result, el); + } else { + this.items[id].elements.push(el); + } + return; + } + clearTimeout(this.itemStatusTimer); + this.items[id] = { + id: id, + state: 'queued', + elements: [el] + }; + this.itemStatusTimer = setTimeout(this.runItemAjaxForQueue.bind(this), this.itemStatusDelay); }, runItemAjaxForQueue: function runItemAjaxForQueue() { @@ -118,19 +134,27 @@ VuFind.register('itemStatuses', function ItemStatuses() { this.itemStatusTimer = setTimeout(this.runItemAjaxForQueue.bind(this), this.itemStatusDelay); return; } + var ids = []; + var self = this; + $.each(this.items, function selectQueued() { + if ('queued' === this.state) { + self.items[this.id].state = 'running'; + ids.push(this.id); + } + }); $.ajax({ dataType: this.dataType, method: this.method, url: VuFind.path + this.url, context: this, - data: { 'id': this.itemStatusIds } + data: { 'id': ids } }) .done(this.checkItemStatusDone) .fail( this.itemStatusFail) .always(function queueAjaxAlways() { this.itemStatusRunning = false; }); - }//end runItemAjax + }//end runItemAjaxForQueue }; //add you own overridden handler here @@ -138,8 +162,7 @@ VuFind.register('itemStatuses', function ItemStatuses() { OdItemStatusHandler.url = '/Overdrive/getStatus'; OdItemStatusHandler.itemStatusDelay = 200; OdItemStatusHandler.name = "overdrive"; - OdItemStatusHandler.itemStatusIds = []; - OdItemStatusHandler.itemStatusEls = []; + OdItemStatusHandler.items = {}; //store the handlers in a "hash" obj var checkItemHandlers = { @@ -157,7 +180,9 @@ VuFind.register('itemStatuses', function ItemStatuses() { } var id = $item.find('.hiddenId').val(); var handlerName = 'ils'; - if ($item.find('.handler-name').length > 0) { + if ($item.data("handler-name")) { + handlerName = $item.data("handler-name"); + } else if ($item.find('.handler-name').length > 0) { handlerName = $item.find('.handler-name').val(); } @@ -172,15 +197,7 @@ VuFind.register('itemStatuses', function ItemStatuses() { var ajaxItems = $(container).find('.ajaxItem'); for (var i = 0; i < ajaxItems.length; i++) { - var id = $(ajaxItems[i]).find('.hiddenId').val(); - var handlerName = 'ils'; - if ($(ajaxItems[i]).find('.handler-name').length > 0) { - handlerName = $(ajaxItems[i]).find('.handler-name').val(); - } - if ($(ajaxItems[i]).data("handler-name")) { - handlerName = $(ajaxItems[i]).data("handler-name"); - } - checkItemHandlers[handlerName].itemQueueAjax(id, $(ajaxItems[i])); + checkItemStatus($(ajaxItems[i])); } } function init(_container) { @@ -197,5 +214,5 @@ VuFind.register('itemStatuses', function ItemStatuses() { } } - return { init: init, check: checkItemStatuses }; + return { init: init, check: checkItemStatuses, checkRecord: checkItemStatus }; }); diff --git a/themes/finc/js/lightbox.js b/themes/finc/js/lightbox.js index c6c302fba63..fb9ce55c1f8 100644 --- a/themes/finc/js/lightbox.js +++ b/themes/finc/js/lightbox.js @@ -18,7 +18,7 @@ VuFind.register('lightbox', function Lightbox() { function _html(content) { _modalBody.html(content); // Set or update title if we have one - var $h2 = _modalBody.find('h2:first-of-type'); + var $h2 = _modalBody.find("h2:first-of-type"); if (_lightboxTitle && $h2) { $h2.text(_lightboxTitle); } @@ -72,7 +72,7 @@ VuFind.register('lightbox', function Lightbox() { var _constrainLink; var _formSubmit; function render(content) { - if (typeof content !== 'string') { + if (typeof content !== "string") { return; } // Isolate successes @@ -157,7 +157,11 @@ VuFind.register('lightbox', function Lightbox() { .done(function lbAjaxDone(content, status, jq_xhr) { var errorMsgs = []; var flashMessages = []; - if (jq_xhr.status !== 205) { + if (jq_xhr.status === 204) { + // No content, close lightbox + close(); + return; + } else if (jq_xhr.status !== 205) { var testDiv = $('<div/>').html(content); errorMsgs = testDiv.find('.flash-message.alert-danger:not([data-lightbox-ignore])'); flashMessages = testDiv.find('.flash-message:not([data-lightbox-ignore])'); @@ -375,7 +379,7 @@ VuFind.register('lightbox', function Lightbox() { var FOCUSABLE_ELEMENTS = ['a[href]', 'area[href]', 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 'select:not([disabled]):not([aria-hidden])', 'textarea:not([disabled]):not([aria-hidden])', 'button:not([disabled]):not([aria-hidden])', 'iframe', 'object', 'embed', '[contenteditable]', '[tabindex]:not([tabindex^="-"])']; function getFocusableNodes () { var nodes = _modal[0].querySelectorAll(FOCUSABLE_ELEMENTS); - return Array.apply(null, nodes); + return [].slice.apply(nodes); } /** * Tries to set focus on a node which is not a close trigger @@ -388,15 +392,19 @@ VuFind.register('lightbox', function Lightbox() { if (focusableNodes.length === 0) return; // remove nodes on whose click, the modal closes - var nodesWhichAreNotCloseTargets = focusableNodes.filter(function(node) { + var nodesWhichAreNotCloseTargets = focusableNodes.filter(function nodeFilter(node) { return !node.hasAttribute("data-lightbox-close") && ( - !node.hasAttribute("data-dismiss") || - node.getAttribute("data-dismiss") != "modal" + !node.hasAttribute("data-dismiss") || + node.getAttribute("data-dismiss") !== "modal" ); }); - if (nodesWhichAreNotCloseTargets.length > 0) nodesWhichAreNotCloseTargets[0].focus(); - if (nodesWhichAreNotCloseTargets.length === 0) focusableNodes[0].focus(); + if (nodesWhichAreNotCloseTargets.length > 0) { + nodesWhichAreNotCloseTargets[0].focus(); + } + if (nodesWhichAreNotCloseTargets.length === 0) { + focusableNodes[0].focus(); + } } function retainFocus(event) { @@ -409,7 +417,7 @@ VuFind.register('lightbox', function Lightbox() { * Filters nodes which are hidden to prevent * focus leak outside modal */ - focusableNodes = focusableNodes.filter(function(node) { + focusableNodes = focusableNodes.filter(function nodeHiddenFilter(node) { return (node.offsetParent !== null); }); @@ -424,17 +432,23 @@ VuFind.register('lightbox', function Lightbox() { event.preventDefault(); } - if (!event.shiftKey && focusableNodes.length > 0 && focusedItemIndex === focusableNodes.length - 1) { + if ( + !event.shiftKey && + focusableNodes.length > 0 && + focusedItemIndex === focusableNodes.length - 1 + ) { focusableNodes[0].focus(); event.preventDefault(); } } } + // finc: restore focus after deleting records, #20379 function setOrigin(origin) { _origin = origin; } - function onKeydown(e) { + + function onKeydown(event) { if (event.keyCode === 27) { // esc close(); } @@ -506,7 +520,6 @@ VuFind.register('lightbox', function Lightbox() { if (VuFind.lightbox.refreshOnClose) { VuFind.refreshPage(); } else { - // finc: keep 'unbindFocus()' unbindFocus(); this.setAttribute('aria-hidden', true); _emit('VuFind.lightbox.closing'); @@ -527,6 +540,9 @@ VuFind.register('lightbox', function Lightbox() { VuFind.modal = function modalShortcut(cmd) { if (cmd === 'show') { _modal.modal($.extend({ show: true }, _modalParams)).attr('aria-hidden', false); + + // Set keyboard focus + setFocusToFirstNode(); } else { _modal.modal(cmd); } diff --git a/themes/finc/scss/components/_breadcrumbs.scss b/themes/finc/scss/components/_breadcrumbs.scss index 766fe2afd95..394fc9109a1 100644 --- a/themes/finc/scss/components/_breadcrumbs.scss +++ b/themes/finc/scss/components/_breadcrumbs.scss @@ -35,7 +35,10 @@ // color of links in breadcrumbs a { - color: $breadcrumb-color; + // Actually `$breadcrumb-color` would be appropriate here but can not be used + // as VuFind did not use `!default` for this variable. + // Will be fixed in VuFind 10. + color: $white; text-decoration: $breadcrumb-link-text-decoration; // more contrast: switch the colors @@ -47,6 +50,9 @@ } > .active a { - color: $breadcrumb-active-color; + // Actually `$breadcrumb-active-color` would be appropriate here but can not be used + // as VuFind did not use `!default` for this variable. + // Will be fixed in VuFind 10. + color: $white; } } diff --git a/themes/finc/scss/components/_record.scss b/themes/finc/scss/components/_record.scss index 13a0174369b..90891f05584 100644 --- a/themes/finc/scss/components/_record.scss +++ b/themes/finc/scss/components/_record.scss @@ -1,18 +1,19 @@ // Use this for all record element styles (record view) // excluding record tabs -> see _record-tabs.scss -.record { - .media-body { - // override - display: table-cell; - flex: none; - width: 10000px; - } + +.record .media { + display: unset; +} + +.record .media-body { + width: 100%; } // center access icon / cover on (mobile) record view by using full view port width: #23135 .record .media-left, .record .media-right { @media (max-width: $screen-xs-max) { + margin: auto; width: revert; } } \ No newline at end of file diff --git a/themes/finc/scss/components/_sidebar.scss b/themes/finc/scss/components/_sidebar.scss index 2d75b1571c4..7e63987a9db 100644 --- a/themes/finc/scss/components/_sidebar.scss +++ b/themes/finc/scss/components/_sidebar.scss @@ -113,6 +113,10 @@ padding: $sidebar-facet-title-padding; } + .facet { + text-decoration: none; + } + // Re-APPLY PADDING HERE to facet inner items a, diff --git a/themes/finc/templates/ContentBlock/FacetList.phtml b/themes/finc/templates/ContentBlock/FacetList.phtml index 72432fe6135..ca2c7cfee10 100644 --- a/themes/finc/templates/ContentBlock/FacetList.phtml +++ b/themes/finc/templates/ContentBlock/FacetList.phtml @@ -28,7 +28,7 @@ $(document).ready(function() { initFacetTree($('#facet_{$this->escapeHtml($field)}'), false); }); JS; - echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); + echo $this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> <div id="facet_<?=$this->escapeHtml($field)?>_container" class="home-facet <?=$this->escapeHtmlAttr($field)?> hide"> <h2><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></h2> diff --git a/themes/finc/templates/Helpers/openurl.phtml b/themes/finc/templates/Helpers/openurl.phtml index 7005998d80e..e311093adc1 100644 --- a/themes/finc/templates/Helpers/openurl.phtml +++ b/themes/finc/templates/Helpers/openurl.phtml @@ -1,6 +1,6 @@ <!-- finc: helpers - openurl --> <?php - echo $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'openurl.js', 'SET'); + echo $this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, 'openurl.js', 'SET'); $classes = ''; if ($this->openUrlEmbed) { $classes = "fulltext"; @@ -34,7 +34,7 @@ $style .= 'height:' . $this->escapeHtmlAttr($this->openUrlGraphicHeight) . 'px;'; } ?> - <img src="<?=$this->escapeHtmlAttr($this->openUrlGraphic)?>" alt="<?=$this->transEsc('Get full text')?>" style="<?=$style?>" /> + <img src="<?=$this->escapeHtmlAttr($this->openUrlGraphic)?>" alt="<?=$this->transEscAttr('Get full text')?>" style="<?=$style?>" /> <?php else: ?> <?=$this->transEsc('Get full text')?> <?php endif; ?> @@ -46,7 +46,7 @@ <?php $ibOpenUrl = $this->openUrlImageBasedOverride ? $this->openUrlImageBasedOverride : $this->inputOpenUrl; ?> <a href="<?=$this->escapeHtmlAttr($this->openUrlBase . '?' . $ibOpenUrl)?>"<?=$class_ib?>> <span title="<?=$this->escapeHtmlAttr($ibOpenUrl)?>" class="openUrl"></span> - <img data-recordid="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" src="<?=$this->escapeHtmlAttr($this->openUrlImageBasedSrc)?>" alt="<?=$this->transEsc('Get full text')?>" /> + <img data-recordid="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" src="<?=$this->escapeHtmlAttr($this->openUrlImageBasedSrc)?>" alt="<?=$this->transEscAttr('Get full text')?>" /> </a> <?php endif; ?> </span> diff --git a/themes/finc/templates/Recommend/SideFacets.phtml b/themes/finc/templates/Recommend/SideFacets.phtml index 4b736c98651..da4361deea0 100644 --- a/themes/finc/templates/Recommend/SideFacets.phtml +++ b/themes/finc/templates/Recommend/SideFacets.phtml @@ -48,7 +48,7 @@ </div> <?php endif; ?> <?php endif; ?> -<?= isset($this->sideFacetExtraControls) ? $this->sideFacetExtraControls : '' ?> +<?= $this->sideFacetExtraControls ?? '' ?> <?php $sideFacetSet = $this->sideFacet()->displayAllowedFacetValues($this->recommend->getFacetSet()); ?> <?php $hierarchicalFacets = $this->recommend->getHierarchicalFacets() ?> <?php $hierarchicalFacetSortOptions = $this->recommend->getHierarchicalFacetSortOptions() ?> @@ -76,4 +76,5 @@ </div> <?php endforeach; ?> <?php endif; ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, "registerMoreLessFacetsEventHandlers();", 'SET');?> <!-- finc: recommend - sidefacets - END --> diff --git a/themes/finc/templates/Recommend/SideFacets/range-slider.phtml b/themes/finc/templates/Recommend/SideFacets/range-slider.phtml index f535319ed66..8dfd0377a5d 100644 --- a/themes/finc/templates/Recommend/SideFacets/range-slider.phtml +++ b/themes/finc/templates/Recommend/SideFacets/range-slider.phtml @@ -56,9 +56,9 @@ <?php if ($this->facet['type'] == 'date'): ?> <?php /* finc adds aria-label */?> <div class="slider-container"> - <input type="text" class="hidden" id="<?=$this->escapeHtmlAttr($this->title)?><?=$this->escapeHtml($this->facet['type'])?>Slider" aria-label="<?=$this->transEsc('Range-from-to')?>"/></div> + <input type="text" class="hidden" id="<?=$this->escapeHtmlAttr($this->title)?><?=$this->escapeHtml($this->facet['type'])?>Slider" aria-label="<?=$this->transEscAttr('Range-from-to')?>"/></div> <?php endif; ?> - <input class="btn btn-default" type="submit" value="<?=$this->transEsc('Set')?>"/> + <input class="btn btn-default" type="submit" value="<?=$this->transEscAttr('Set')?>"/> </form> </li> @@ -104,6 +104,6 @@ $('#{$this->escapeHtmlAttr($this->title)}from, #{$this->escapeHtmlAttr($this->ti }); JS; ?> - <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> <?php endif; ?> <!-- finc - recommend - sidefacets - rangeslider - END --> diff --git a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml index b798a0513aa..6ba7488ce3b 100644 --- a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml +++ b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml @@ -42,7 +42,7 @@ <?php else: ?> <li> <a - <?php if ($this->facet['isApplied']): ?>id="<?=$this->sideFacet()->setAppliedFacet($this->transEsc('Skip to facet', ['%%filter_name%%' => $this->facet['displayText']])) ?>"<?php endif; ?> + <?php if ($this->facet['isApplied']): ?>id="<?=$this->sideFacet()->setAppliedFacet($this->transEscAttr('Skip to facet', ['%%filter_name%%' => $this->facet['displayText']])) ?>"<?php endif; ?> href="<?=$toggleUrl ?>" class="<?=implode(' ', $classList) ?>" data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>" @@ -83,7 +83,7 @@ <?php if ($hasSubLinks): ?> <?php $excludeURL = $this->urlBase . $this->url->addFacet($this->group, $this->facet['value'], 'NOT'); ?> <?php /* finc: Barf for exclude facets #19392 */ ?> - <a href="<?=$excludeURL ?>" data-lightbox-ignore class="exclude" title="<?= $this->transEsc('exclude_filter', ['%%filter_name%%' => $this->facet['displayText']]) ?>, <?= $this->transEsc('page_reload_on_exclude_hint', ['%%filter_name%%' => $this->facet['displayText']]) ?>"> + <a href="<?=$excludeURL ?>" data-lightbox-ignore class="exclude" title="<?= $this->transEscAttr('exclude_filter', ['%%filter_name%%' => $this->facet['displayText']]) ?>, <?= $this->transEscAttr('page_reload_on_exclude_hint', ['%%filter_name%%' => $this->facet['displayText']]) ?>"> <i class="fa fa-times" aria-hidden="true"></i> <span class="sr-only"><?=$this->transEsc('exclude_filter', ['%%filter_name%%' => $this->facet['displayText']]) ?>, <?= $this->transEsc('page_reload_on_exclude_hint', ['%%filter_name%%' => $this->facet['displayText']]) ?></span> </a> diff --git a/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml b/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml index d7bf4492353..88c4ac6387b 100644 --- a/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml +++ b/themes/finc/templates/RecordDriver/AbstractBase/export-citavi.phtml @@ -1,7 +1,7 @@ <?php // per https://www1.citavi.com/sub/manual5/en/importing_an_endnote_tagged_file.html // also for germans: https://www.ub.rwth-aachen.de/global/show_document.asp?id=aaaaaaaaaaptikv&download=1 -$filter = new Zend\Filter\Word\CamelCaseToSeparator(); +$filter = new \Laminas\Filter\Word\CamelCaseToSeparator(); // A driver-specific template may pass in format overrides; check for these before going to the driver itself: $formats = $this->slot('citavi-formats')->get($this->driver->tryMethod('getFormats')); if (is_array($formats) && !empty($formats)) { diff --git a/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml b/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml index 368d733b8e6..1bbe79254a4 100644 --- a/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml +++ b/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml @@ -1,5 +1,5 @@ <?php -$filter = new Zend\Filter\Word\CamelCaseToSeparator(); +$filter = new \Laminas\Filter\Word\CamelCaseToSeparator(); // A driver-specific template may pass in format overrides; check for these before going to the driver itself: $formats = $this->slot('endnote-formats')->get($this->driver->tryMethod('getFormats')); if (is_array($formats) && !empty($formats)) { diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml index 4954642870c..648a3b2ba88 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml @@ -17,7 +17,7 @@ <?php /* Display qrcode if appropriate: */ ?> <?php if($QRCode): ?> <?php /* finc removes span + class for accessibility */ ?> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + <br/><img alt="<?=$this->transEscAttr('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> <?php endif; ?> <?php if ($preview): ?><?=$preview?><?php endif; ?> @@ -54,7 +54,7 @@ <table id="collectionInfo" class="table table-striped table-resp-data collapse in"> <caption><span class="sr-only"><?=$this->transEsc('Bibliographic Details')?></span></caption> <?php foreach ($fields as $current): ?> - <tr><th><?=$this->transEsc($current['label'])?>:</th><td data-title="<?= $this->transEsc($current['label']) ?>:"><?=$current['value']?></td></tr> + <tr><th><?=$this->transEsc($current['label'])?>:</th><td data-title="<?= $this->transEscAttr($current['label']) ?>:"><?=$current['value']?></td></tr> <?php endforeach; ?> </table> <?php endif; ?> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml index 29ef0a26d87..3535d07483a 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml @@ -20,7 +20,7 @@ <?php /* Display qrcode if appropriate: */ /* finc removes span + class for accessibility */ ?> <?php if($QRCode): ?> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + <br/><img alt="<?=$this->transEscAttr('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> <?php endif; ?> <?php // if you have a preview tab but want to move or remove the preview link @@ -51,6 +51,10 @@ <?=$this->extraControls['actionControls'] ?? ''?> <?=$this->extraControls['availabilityInfo'] ?? ''?> <?php endif; ?> + + <?php if ($this->searchOptions($this->driver->getSourceIdentifier())->getVersionsAction()): ?> + <?=$this->record($this->driver)->renderTemplate('versions-link.phtml')?> + <?php endif; ?> <?php /* #18307 finc removes summary from core */ /* <?php $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> @@ -82,7 +86,7 @@ <?php foreach ($coreFields as $current): ?> <tr> <th><?= $this->transEsc($current['label']) ?>:</th> - <td lang="" data-title="<?= $this->transEsc($current['label']) ?>:"><?= $current['value'] ?></td> + <td lang="" data-title="<?= $this->transEscAttr($current['label']) ?>:"><?= $current['value'] ?></td> </tr> <?php endforeach; ?> </table> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml index b49356749ad..58c0246d9a8 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml @@ -26,7 +26,7 @@ $types = [ <span class="author-data" property="<?=$this->escapeHtml($schemaLabel)?>" typeof="Person"> <span property="name"> <a href="<?=$this->record($this->driver)->getLink('author', $author)?>"> - <?=$this->escapeHtml($author)?> + <?=$this->escapeHtml(rtrim($author, ','))?> </a> </span> <?php diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml index f376f551c61..97e8025f3b3 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml @@ -37,7 +37,7 @@ if ($cover): <header> <h2> <?php /* finc adds aria and lang code */ ?> - <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang=""> + <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=isset($this->params) ? $this->params->getOptions()->getListViewOption(): 'list' ?>" lang=""> <?=$this->record($this->driver)->getTitleHtml()?> </a> </h2> @@ -51,7 +51,7 @@ if ($cover): <?=$this->transEsc('by')?> <?php $authorCount = count($summAuthors); foreach ($summAuthors as $i => $summAuthor): ?> - <a href="<?=$this->record($this->driver)->getLink('author', $this->highlight($summAuthor, null, true, false))?>" class="author"><?=$this->highlight($summAuthor)?></a><?=$i + 1 < $authorCount ? ',' : ''?> + <a href="<?=$this->record($this->driver)->getLink('author', $this->highlight($summAuthor, null, true, false))?>" class="author"><?=$this->highlight(rtrim($summAuthor, ','))?></a><?=$i + 1 < $authorCount ? ',' : ''?> <?php endforeach; ?> <?php endif; ?> </header> @@ -125,6 +125,10 @@ if ($cover): <?php endif; ?> */ ?> + <?php if ($this->driver->tryMethod('getWorkKeys') && $this->searchOptions($this->driver->getSourceIdentifier())->getVersionsAction()): ?> + <div class="record-versions ajax"></div> + <?php endif; ?> + <?php /* finc adds ' ' for correct ellipsis formatting */ ?> <div class="callnumAndLocation ajax-availability hidden"> <?php if ($this->driver->supportsAjaxStatus()): ?> @@ -144,10 +148,8 @@ if ($cover): <?php endif; ?> </div> - <?php /* We need to find out if we're supposed to display an OpenURL link ($openUrlActive), - but even if we don't plan to display the link, we still want to get the $openUrl - value for use in generating a COinS (Z3988) tag -- see bottom of file. - */ + <?php + // Display an OpenURL link if configured to do so: $openUrl = $this->openUrl($this->driver, 'results'); $openUrlActive = $openUrl->isActive(); $doi = $this->doi($this->driver, 'results'); @@ -207,13 +209,13 @@ if ($cover): <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i><a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> <div class="qrcode hidden"> <script class="qrCodeImgTag"> - <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + <img alt="<?=$this->transEscAttr('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> </script> </div> <br/> <?php endif; ?> - <?php if ($this->cart()->isActiveInSearch() && $this->params->getOptions()->supportsCart() && $this->cart()->isActive()): ?> + <?php if ($this->cart()->isActiveInSearch() && isset($this->params) && $this->params->getOptions()->supportsCart() && $this->cart()->isActive()): ?> <?php /* finc: remove break after bookbag #22379 */ ?> <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]); ?> <?php endif; ?> @@ -223,7 +225,7 @@ if ($cover): <?php /* Add to favorites; finc: keep Icon inside link finc adds accessibility code */ ?> - <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>?refreshOnClose=false" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" aria-label="<?=$this->transEsc('Add to favorites')?>"> + <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>?refreshOnClose=false" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" aria-label="<?=$this->transEscAttr('Add to favorites')?>"> <i class="fa fa-fw fa-star" aria-hidden="true"></i><span><?=$this->transEsc('Add to favorites')?></span> </a><br/> <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> @@ -243,8 +245,8 @@ if ($cover): <?php foreach ($trees as $hierarchyID => $hierarchyTitle): ?> <div class="hierarchyTreeLink"> <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" /> - <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab', ['hierarchy' => $hierarchyID])?>" data-lightbox-post="tab=hierarchytree"> - <i class="result-link-icon fa fa-fw fa-sitemap" aria-hidden="true"></i><span><?=$this->transEsc('hierarchy_view_context')?></span><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?> + <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree', ['hierarchy' => $hierarchyID])?>#tabnav" title="<?=$this->transEscAttr('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab', ['hierarchy' => $hierarchyID])?>" data-lightbox-post="tab=hierarchytree"> + <i class="result-link-icon fa fa-fw fa-sitemap" aria-hidden="true"></i><span><?=$this->transEscAttr('hierarchy_view_context')?></span><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?> </a> </div> <?php endforeach; ?> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml index 3c3928a92b2..9e243714b8a 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml @@ -10,7 +10,7 @@ $cartId = $this->driver->getSourceIdentifier() . '|' . $this->driver->getUniqueId(); ?> -<nav class="record-nav hidden-print" aria-label="<?= $this->transEsc('Toolbar') ?>"> +<nav class="record-nav hidden-print" aria-label="<?= $this->transEscAttr('Toolbar') ?>"> <?php /* finc adds toggler-off button, CK */ ?> <button class="close-offcanvas btn btn-primary" data-toggle="offcanvas"><?= $this->transEsc('navigate_back') ?></button> <?php /* finc: we use nav-stacked for display in sidebar, CK */ @@ -29,6 +29,7 @@ class="staff-view-btn"> <i class="fa fa-info-circle" aria-hidden="true"></i> <?=$this->translate('Staff View')?> </a> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, 'staff_view_button.js', 'SET');?> </li> <?php endif; ?> <?php /* finc: we don't use sms, CK diff --git a/themes/finc/templates/RecordTab/collectionlist.phtml b/themes/finc/templates/RecordTab/collectionlist.phtml index 54d4e61c391..1dd57ee7659 100644 --- a/themes/finc/templates/RecordTab/collectionlist.phtml +++ b/themes/finc/templates/RecordTab/collectionlist.phtml @@ -18,7 +18,7 @@ this one should hide the '.icon-bar' of the Record View and show only the Facets Sidebar for the collection - CK */ ?> <span class="offcanvas-toggler"> - <a class="search-filter-toggle collections visible-xs" href="javascript:" data-toggle="offcanvas" title="<?= $this->transEsc('sidebar_expand_collections') ?>"> + <a class="search-filter-toggle collections visible-xs" href="javascript:" data-toggle="offcanvas" title="<?= $this->transEscAttr('sidebar_expand_collections') ?>"> <?=$this->transEsc('sidebar_expand_collections')?> </a> </span> @@ -116,7 +116,7 @@ <h2><?=$this->transEsc('Search Collection Items')?></h2> <form class="form-inline" role="form" method="get" name="keywordFilterForm" id="keywordFilterForm"> <div class="input-group"> - <input id="keywordFilter_lookfor" type="text" name="lookfor" placeholder="<?=$this->transEsc('Search within collection')?>" value="<?=$params->getDisplayQuery()?>" class="form-control"> + <input id="keywordFilter_lookfor" type="text" name="lookfor" placeholder="<?=$this->transEscAttr('Search within collection')?>" value="<?=$params->getDisplayQuery()?>" class="form-control"> <?php foreach ($filterList as $field => $filters): ?> <?php foreach ($filters as $filter): ?> <input type="hidden" name="filter[]" value="<?=$this->escapeHtmlAttr($filter['field'])?>:"<?=$this->escapeHtmlAttr($filter['value'])?>"" /> diff --git a/themes/finc/templates/RecordTab/hierarchytree.phtml b/themes/finc/templates/RecordTab/hierarchytree.phtml index 50ef83fc7f6..1ed6c37f2c1 100644 --- a/themes/finc/templates/RecordTab/hierarchytree.phtml +++ b/themes/finc/templates/RecordTab/hierarchytree.phtml @@ -6,7 +6,7 @@ $activeTree = $this->tab->getActiveTree(); $this->inlineScript( - \Zend\View\Helper\HeadScript::SCRIPT, + \Laminas\View\Helper\HeadScript::SCRIPT, "var hierarchySettings = {\n" . " lightboxMode: " . ($this->layout()->getTemplate() == 'layout/lightbox' ? 'true' : 'false') . ",\n" . " fullHierarchy: " . ($this->tab->isFullHierarchyVisible() ? 'true' : 'false') . "\n" @@ -17,8 +17,8 @@ . ");\n", 'SET' ); - $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'vendor/jsTree/jstree.min.js'); - $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'hierarchyTree.js'); + $this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, 'vendor/jsTree/jstree.min.js'); + $this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, 'hierarchyTree.js'); echo $this->inlineScript(); ?> <?php if (count($hierarchyTreeList) > 1): ?> @@ -45,7 +45,7 @@ <option value="Title"><?=$this->transEsc('Title')?></option> </select> <?php /* finc changes btn-default to btn-transparent */ ?> - <input type="submit" class="btn btn-transparent" value="<?=$this->transEsc('Search') ?>"/> + <input type="submit" class="btn btn-transparent" value="<?=$this->transEscAttr('Search') ?>"/> <i id="treeSearchLoadingImg" class="fa fa-spinner fa-spin hidden" aria-hidden="true"></i> </div> <?php /* finc uses <p> and aria for alerts */ ?> @@ -57,7 +57,7 @@ <input type="hidden" value="<?=$this->escapeHtml($this->driver->getUniqueId())?>" class="hiddenRecordId" /> <input type="hidden" value="<?=$this->escapeHtml($activeTree)?>" class="hiddenHierarchyId" /> <input type="hidden" value="<?=$this->escapeHtml($this->driver->getSourceIdentifier())?>" class="hiddenHierarchySource" /> - <input type="hidden" value="<?=isset($this->treeContext) ? $this->treeContext : 'Record'?>" class="hiddenContext" /> + <input type="hidden" value="<?=$this->treeContext ?? 'Record'?>" class="hiddenContext" /> <?php if ($this->layout()->getTemplate() != 'layout/lightbox'): ?> <noscript> <?php if ($this->config()->nonJavascriptSupportEnabled()): ?> diff --git a/themes/finc/templates/RecordTab/holdingsils.phtml b/themes/finc/templates/RecordTab/holdingsils.phtml index df070aafc0c..ea104d21e34 100644 --- a/themes/finc/templates/RecordTab/holdingsils.phtml +++ b/themes/finc/templates/RecordTab/holdingsils.phtml @@ -64,7 +64,7 @@ <?php endif; ?> <?php $holdingTitleHold = $this->driver->tryMethod('getRealTimeTitleHold'); if (!empty($holdingTitleHold)): ?> - <a class="placehold" data-lightbox title="<?=$this->transEsc('request_place_text')?>" href="<?=$this->recordLink()->getRequestUrl($holdingTitleHold)?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc('title_hold_place')?></a> + <a class="placehold" data-lightbox title="<?=$this->transEscAttr('request_place_text')?>" href="<?=$this->recordLink()->getRequestUrl($holdingTitleHold)?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc('title_hold_place')?></a> <?php endif; ?> <?php /* finc adds 'Online Access' in holdings-tab #13770 - VE */ /* finc turns h3 into h3 */ ?> @@ -124,7 +124,7 @@ if (!empty($holdingTitleHold)): ?> <?php /* finc: this next section produces an empty table in some cases - the table borders collapse, producing a thick line - should be solved more elegantly - Fixme. finc adds code for responsive data table here - CK layout tables must not contain caption - CK */ ?> - <table class="table table-striped table-resp-data" aria-label="<?=$this->transEsc('holdings_details_from', ['%%location%%' => $this->transEsc($holding['location'])])?>"> + <table class="table table-striped table-resp-data" aria-label="<?=$this->transEscAttr('holdings_details_from', ['%%location%%' => $this->transEscAttr($holding['location'])])?>"> <?php /* finc changes order and structure of table #13606 - VE */ ?> <?php foreach ($holding['items'] as $row): ?> <?php @@ -148,7 +148,7 @@ if (!empty($holdingTitleHold)): ?> <?php $callNos = $this->tab->getUniqueCallNumbers($holding['items']); if (!empty($callNos)): ?> <tr> <th><?=$this->transEsc("Call Number")?>: </th> - <td data-title="<?= $this->transEsc("Call Number") ?>:"> + <td data-title="<?= $this->transEscAttr("Call Number") ?>:"> <?php foreach ($callNos as $callNo): ?> <?php if ($this->callnumberHandler): ?> <a href="<?=$this->url('alphabrowse-home') ?>?source=<?=$this->escapeHtmlAttr($this->callnumberHandler) ?>&from=<?=$this->escapeHtmlAttr($callNo) ?>"><?=$this->escapeHtml($callNo)?></a> @@ -164,7 +164,7 @@ if (!empty($holdingTitleHold)): ?> <tr> <?php // Translation for summary is a special case for backwards-compatibility ?> <th><?=$textFieldName == 'summary' ? $this->transEsc("Volume Holdings") : $this->transEsc(ucfirst($textFieldName))?>:</th> - <td data-title="<?= $this->transEsc("Volume Holdings") ?>:"> + <td data-title="<?= $this->transEscAttr("Volume Holdings") ?>:"> <?php foreach ($textFields as $current): ?> <?=$this->linkify($this->escapeHtml($current))?><br/> <?php endforeach; ?> @@ -175,7 +175,7 @@ if (!empty($holdingTitleHold)): ?> <?php if (!empty($holding['purchase_history'])): ?> <tr> <th><?=$this->transEsc("Most Recent Received Issues")?>:</th> - <td data-title="<?= $this->transEsc("Most Recent Received Issues") ?>:"> + <td data-title="<?= $this->transEscAttr("Most Recent Received Issues") ?>:"> <?php foreach ($holding['purchase_history'] as $current): ?> <?=$this->escapeHtml($current['issue'])?><br/> <?php endforeach; ?> diff --git a/themes/finc/templates/admin/i18n/home.phtml b/themes/finc/templates/admin/i18n/home.phtml index 0e634d2a265..e8e7bb28ba6 100644 --- a/themes/finc/templates/admin/i18n/home.phtml +++ b/themes/finc/templates/admin/i18n/home.phtml @@ -101,7 +101,7 @@ $script = <<<JS }); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> <?php $this->headScript() ->appendFile("vendor/datatables/jquery.dataTables.min.js"); ?> <?php $this->headScript() diff --git a/themes/finc/templates/ajax/resolverLink.phtml b/themes/finc/templates/ajax/resolverLink.phtml index 7c9b0376360..37f52c4d386 100644 --- a/themes/finc/templates/ajax/resolverLink.phtml +++ b/themes/finc/templates/ajax/resolverLink.phtml @@ -5,7 +5,7 @@ <span class="sr-only"> <?=$this->translate('Availability')?>: <?=$this->transEsc('resolver_link_access_' . $link['access'])?> </span> - <div aria-hidden="true"<?php if (!empty($link['access'])): ?> data-toggle="tooltip" title="<?=$this->transEsc('resolver_link_access_' . $link['access'])?>" class="traffic-light access-<?=$link['access']?>"<?php endif;?>> + <div aria-hidden="true"<?php if (!empty($link['access'])): ?> data-toggle="tooltip" title="<?=$this->transEscAttr('resolver_link_access_' . $link['access'])?>" class="traffic-light access-<?=$link['access']?>"<?php endif;?>> <span class="first"></span> <span class="second"></span> <span class="last"></span> diff --git a/themes/finc/templates/alphabrowse/home.phtml b/themes/finc/templates/alphabrowse/home.phtml index b4e7ca1ae1c..78472f5fd66 100644 --- a/themes/finc/templates/alphabrowse/home.phtml +++ b/themes/finc/templates/alphabrowse/home.phtml @@ -21,7 +21,7 @@ <ul class="pager"> <?php if (isset($this->prevpage)): ?> <li> - <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->prevpage]]))?>" aria-label="<?=$this->transEsc('page_prev')?>"> + <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->prevpage]]))?>" aria-label="<?=$this->transEscAttr('page_prev')?>"> <i class="fa fa-angle-left" aria-hidden="true"></i> <?=$this->transEsc('Prev')?> </a> @@ -33,7 +33,7 @@ <?php if (isset($this->nextpage)): ?> <li> - <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->nextpage]]))?>" aria-label="<?=$this->transEsc('page_next')?>"> + <a href="<?=$this->escapeHtmlAttr($this->url('alphabrowse-home', [], ['query' => $baseQuery + ['page' => $this->nextpage]]))?>" aria-label="<?=$this->transEscAttr('page_next')?>"> <?=$this->transEsc('Next')?> <i class="fa fa-angle-right" aria-hidden="true"></i> </a> @@ -58,7 +58,7 @@ </select> <label for="alphaBrowseForm_from"><?=$this->transEsc('starting from') ?></label> <input type="text" name="from" id="alphaBrowseForm_from" value="<?=$this->escapeHtmlAttr($this->from) ?>" class="form-control"/> - <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Browse') ?>"/> + <input class="btn btn-primary" type="submit" value="<?=$this->transEscAttr('Browse') ?>"/> </form> <?php endif; ?> @@ -91,7 +91,7 @@ <?php else: ?> <tr> <?php endif; ?> - <td data-title="<?=$this->transEsc('browse_' . $this->source) ?>" class="<?=$this->source ?>"> + <td data-title="<?=$this->transEscAttr('browse_' . $this->source) ?>" class="<?=$this->source ?>"> <b> <?php if ($url = $this->alphabrowse()->getUrl($this->source, $item)): ?> <a href="<?=$this->escapeHtmlAttr($url)?>"><?=$this->escapeHtml($item['heading'])?></a> @@ -144,7 +144,7 @@ </td> <?php endforeach; ?> - <td data-title="<?=$this->transEsc("browse_" . $e) ?>" class="titles"> + <td data-title="<?=$this->transEscAttr("browse_" . $e) ?>" class="titles"> <?php if ($item['count'] > 0): ?> <?=$item['count']; ?> <?php endif; ?> diff --git a/themes/finc/templates/amsl/sources-list.phtml b/themes/finc/templates/amsl/sources-list.phtml index 535605d7e12..71df9b3d25f 100644 --- a/themes/finc/templates/amsl/sources-list.phtml +++ b/themes/finc/templates/amsl/sources-list.phtml @@ -91,6 +91,6 @@ $this->layout()->breadcrumbs .= '</li> <li class="active">' . $this->transEsc('L <?php endif; ?> <?php /* run collapse togglers + introduce a case-insensitive filter that is capable of filtering multiple filtering terms */ -echo $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'sources-display.js', 'SET'); +echo $this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, 'sources-display.js', 'SET'); ?> <!-- finc: amsl/sources-list - home - END --> \ No newline at end of file diff --git a/themes/finc/templates/breadcrumbs/multi.phtml b/themes/finc/templates/breadcrumbs/multi.phtml index 50ed20608e0..d8d6fc30f64 100644 --- a/themes/finc/templates/breadcrumbs/multi.phtml +++ b/themes/finc/templates/breadcrumbs/multi.phtml @@ -19,5 +19,6 @@ <?php else: ?> <li class="active" aria-current="page" title="<?=$this->layout()->title ?>"><?=$this->truncate($this->layout()->title, 100) ?></li> <?php endif; ?> -<script>$('.dropdown-toggle').dropdown()</script> +<?php $dropdownToggle = '$(\'.dropdown-toggle\').dropdown()'; ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $dropdownToggle, 'SET'); ?> <!-- finc: breadcrumbs - multi - END --> diff --git a/themes/finc/templates/browse/home.phtml b/themes/finc/templates/browse/home.phtml index 3ae7857da7f..16a5280cbcd 100644 --- a/themes/finc/templates/browse/home.phtml +++ b/themes/finc/templates/browse/home.phtml @@ -20,7 +20,7 @@ <?php foreach ($this->browseOptions as $item => $currentOption): ?> <a href="<?=$this->url('browse-' . strtolower($currentOption['action'])); ?>" class="browse-item<?php if($currentOption['action'] == $this->currentAction): ?> active<?php endif; ?>"> <?=$this->transEsc($currentOption['description']) ?> - <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span> + <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEscAttr('more') ?>"></i></span> </a> <?php endforeach; ?> </div> @@ -31,7 +31,7 @@ <a href="<?=$BROWSE_BASE ?>?findby=<?=urlencode($findby) ?>&query_field=<?=$this->browse()->getSolrField($findby, $this->currentAction) ?>" class="browse-item<?php if (!is_string($category)): ?> with-badge<?php endif; ?><?php if ($this->findby == $findby): ?> active<?php endif; ?>"> <?php if(is_string($category)): ?> <?=$this->transEsc($category)?> - <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span> + <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEscAttr('more') ?>"></i></span> <?php else: ?> <?=$this->transEsc($category['text'])?> <span class="badge"><?=number_format($category['count'])?></span> @@ -63,7 +63,7 @@ <?php if ($hasBadge): ?> <span class="badge"><?=number_format($secondary['count']) ?></span> <?php else: ?> - <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEsc('more') ?>"></i></span> + <span class="pull-right flip"><i class="fa fa-angle-right" title="<?=$this->transEscAttr('more') ?>"></i></span> <?php endif; ?> </a> <?php if($viewRecord): ?> diff --git a/themes/finc/templates/cart/cart.phtml b/themes/finc/templates/cart/cart.phtml index 86a6df065a7..ca99a0462f5 100644 --- a/themes/finc/templates/cart/cart.phtml +++ b/themes/finc/templates/cart/cart.phtml @@ -22,19 +22,19 @@ </label> </div> <?php if ($this->userlist()->getMode() !== 'disabled'): ?> - <button type="submit" class="toolbar-btn btn-type-save" name="saveCart" title="<?=$this->transEsc('bookbag_save')?>" value="1"> + <button type="submit" class="toolbar-btn btn-type-save" name="saveCart" title="<?=$this->transEscAttr('bookbag_save')?>" value="1"> <?=$this->transEsc('Save')?> </button> <?php endif; ?> - <button type="submit" class="toolbar-btn btn-type-email" name="email" title="<?=$this->transEsc('bookbag_email')?>" value="1"> + <button type="submit" class="toolbar-btn btn-type-email" name="email" title="<?=$this->transEscAttr('bookbag_email')?>" value="1"> <?=$this->transEsc('Email')?> </button> <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?> - <button type="submit" class="toolbar-btn btn-type-export" name="export" title="<?=$this->transEsc('bookbag_export')?>" value="1"> + <button type="submit" class="toolbar-btn btn-type-export" name="export" title="<?=$this->transEscAttr('bookbag_export')?>" value="1"> <?=$this->transEsc('Export')?> </button> <?php endif; ?> - <button type="submit" class="toolbar-btn btn-type-print" name="print" title="<?=$this->transEsc('print_selected')?>" value="1"> + <button type="submit" class="toolbar-btn btn-type-print" name="print" title="<?=$this->transEscAttr('print_selected')?>" value="1"> <?=$this->transEsc('Print')?> </button> <div class="btn-group" id="cartDelete"> @@ -43,7 +43,7 @@ </button> <ul class="dropdown-menu" role="menu" aria-labelledby="cart-delete-label"> <li role="none"> - <a href="javascript:" id="cart-confirm-delete" title="<?=$this->transEsc('confirm_delete')?>" role="menuitem"><?=$this->transEsc('confirm_dialog_yes')?></a> + <a href="javascript:" id="cart-confirm-delete" title="<?=$this->transEscAttr('confirm_delete')?>" role="menuitem"><?=$this->transEscAttr('confirm_dialog_yes')?></a> </li> <li role="none"> <a href="javascript:" role="menuitem"><?=$this->transEsc('confirm_dialog_no')?></a> @@ -56,10 +56,10 @@ </button> <ul class="dropdown-menu" role="menu" aria-labelledby="cart-empty-label"> <li role="none"> - <a href="javascript:" id="cart-confirm-empty" title="<?=$this->transEsc('bookbag_confirm_empty')?>" role="menuitem"><?=$this->transEsc('confirm_dialog_yes')?></a> + <a href="javascript:" id="cart-confirm-empty" title="<?=$this->transEscAttr('bookbag_confirm_empty')?>" role="menuitem"><?=$this->transEsc('confirm_dialog_yes')?></a> </li> <li role="none"> - <a href="javascript:" id="cart-refuse-empty" onClick="$('.fa.fa-spinner').remove()" role="menuitem"><?=$this->transEsc('confirm_dialog_no')?></a> + <a href="javascript:" id="cart-refuse-empty" role="menuitem"><?=$this->transEsc('confirm_dialog_no')?></a> </li> </ul> </div> @@ -80,7 +80,10 @@ $("#cart-confirm-empty").click(function($e) { submitFormWithButton(this, 'empty'); }); + $("#cart-refuse-empty").click(function($e) { + $('.fa.fa-spinner').remove(); + }); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> <!-- finc: cart - cart - END --> diff --git a/themes/finc/templates/cart/contents.phtml b/themes/finc/templates/cart/contents.phtml index 3d9b570f75f..7eb666ee295 100644 --- a/themes/finc/templates/cart/contents.phtml +++ b/themes/finc/templates/cart/contents.phtml @@ -10,7 +10,7 @@ if (!empty($records)): ?> <?=$this->record($record)->getCheckbox('cart')?> <?php /* finc adds aria-label and -describedby + 'lang' - CK */ ?> <?php $describedById = $record->getSourceIdentifier() . '|' . $record->getUniqueId(); ?> - <a id="<?=$describedById?>" title="<?=$this->transEsc('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore lang=""><?=$this->escapeHtml($record->getBreadcrumb())?> + <a id="<?=$describedById?>" title="<?=$this->transEscAttr('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore lang=""><?=$this->escapeHtml($record->getBreadcrumb())?> <?php // finc-specific: Collect citation data: $helper = $this->citation($record); diff --git a/themes/finc/templates/cart/email.phtml b/themes/finc/templates/cart/email.phtml index 1327e5d4033..07218562155 100644 --- a/themes/finc/templates/cart/email.phtml +++ b/themes/finc/templates/cart/email.phtml @@ -6,7 +6,7 @@ $this->headTitle($this->translate('email_selected_favorites')); // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') + $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '<li>', '</li> ') . '<li><a href="' . $this->url('cart-home') . '">' . $this->transEsc('Cart') . '</a></li> ' . '<li class="active">' . $this->transEsc('email_selected_favorites') . '</li>'; ?> @@ -43,5 +43,5 @@ $('#itemhide').removeClass('in'); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> <!-- finc - templates - cart - email - END --> diff --git a/themes/finc/templates/cart/save.phtml b/themes/finc/templates/cart/save.phtml index e4350b364b2..4635e0c0112 100644 --- a/themes/finc/templates/cart/save.phtml +++ b/themes/finc/templates/cart/save.phtml @@ -6,7 +6,7 @@ $this->headTitle($this->translate('bookbag_save_selected')); // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') . + $this->layout()->breadcrumbs = $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '<li>', '</li> ') . '<li class="active">' . $this->transEsc('bookbag_save_selected') . '</li>'; ?> @@ -60,7 +60,7 @@ </div> <?php endif; ?> <div class="form-group"> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>"/> </div> </form> @@ -70,5 +70,5 @@ $('#itemhide').removeClass('in'); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> <!-- finc - templates - cart - save - END --> diff --git a/themes/finc/templates/collection/view.phtml b/themes/finc/templates/collection/view.phtml index 209fcffa801..f0f23b75101 100644 --- a/themes/finc/templates/collection/view.phtml +++ b/themes/finc/templates/collection/view.phtml @@ -8,6 +8,11 @@ $this->headScript()->appendFile($this->syndeticsPlus()->getScript()); } + // Add any extra scripts the tabs require: + foreach ($this->tabsExtraScripts as $script) { + $this->headScript()->appendFile($script); + } + // Add RDF header link if applicable: if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) { $this->headLink()->appendAlternate($this->recordLink()->getActionUrl($this->driver, 'RDF'), 'application/rdf+xml', 'RDF Representation'); @@ -31,14 +36,14 @@ <?php /* finc: add offcanvas-toggler here */ ?> <span class="offcanvas-toggler"> - <a class="search-filter-toggle top visible-xs" href="#myresearch-sidebar" data-toggle="offcanvas" title="<?= $this->transEsc('sidebar_expand') ?>"> + <a class="search-filter-toggle top visible-xs" href="#myresearch-sidebar" data-toggle="offcanvas" title="<?= $this->transEscAttr('sidebar_expand') ?>"> <?=$this->transEsc('offcanvas-toggler-record-view')?> </a> </span> <?php /* DON'T pull the toolbar in here but below, finc-specific, CK */ ?> -<div class="record"> +<div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>"> <?php /* finc - don't use '<?=count($sidebarList) < 1 ? ' solo' : '' ?>' or toolbar won't fit; BS count sidebars but our toolbar isn't counted */ ?> <div<?php if (!$tree): /* in tree mode, do not constrain width with a class */ ?> class="<?= $this->layoutClass('mainbody') ?>" <?php else: ?> class="mainbody left" <?php endif; ?>> <input type="hidden" value="<?= $this->escapeHtmlAttr($this->driver->getUniqueId()) ?>" class="hiddenId" id="record_id"/> @@ -62,38 +67,28 @@ <a id="tabnav"></a> <div class="record-tabs collection"> <ul class="nav nav-tabs"> - <?php foreach ($this->tabs as $tab => $obj): ?> - <?php // add current tab to breadcrumbs if applicable: - - if (strtolower($tab) === 'details' - && $this->config()->get('config')->Site->showStaffViewInLightbox - && strtolower($this->activeTab) !== 'details' /* load in new browser tab after right click */) { - // #21993 show button for staff view in toolbar instead - continue; - } - - $desc = $obj->getDescription(); - $tab_classes = []; - if (0 === strcasecmp($this->activeTab, $tab)) { - if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) { - $tab_classes[] = 'active'; - } - $tab_classes[] = 'initiallyActive'; - $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>'; - $activeTabObj = $obj; - } - if (!$obj->isVisible()) { - $tab_classes[] = 'hidden';} - if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; } - ?> - <li<?=count($tab_classes) > 0 ? ' class="' . implode(' ', $tab_classes) . '"' : ''?>> - <a class="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"<?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)):?> data-background<?php endif ?>> - <?=$this->transEsc($desc)?> - <?php /* finc: add span with icon #10126 */ ?> - <span class="visible-xs-inline right caret" aria-hidden="true"></span> - </a> - </li> - <?php endforeach; ?> + <?php foreach ($this->tabs as $tab => $obj): ?> + <?php // add current tab to breadcrumbs if applicable: + $desc = $obj->getDescription(); + $tabName = preg_replace("/\W/", "-", strtolower($tab)); + $tabClasses = [ 'record-tab', $tabName ]; + if (0 === strcasecmp($this->activeTab, $tab)) { + if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) { + $tabClasses[] = 'active'; + } + $tabClasses[] = 'initiallyActive'; + $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>'; + $activeTabObj = $obj; + } + if (!$obj->isVisible()) { $tabClasses[] = 'hidden'; } + if (!$obj->supportsAjax()) { $tabClasses[] = 'noajax'; } + ?> + <li class="<?=implode(' ', $tabClasses)?>" data-tab="<?=$tabName?>"<?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)):?> data-background<?php endif ?>> + <a href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav" data-lightbox-ignore> + <?=$this->transEsc($desc)?> + </a> + </li> + <?php endforeach; ?> </ul> </div> <?php endif; ?> @@ -101,12 +96,12 @@ <?php /* finc: show sidebar (rendered as tab) outside of '.mainbody' class #22956 */ ?> <?php if (!$this->loadInitialTabWithAjax || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?> - <div class="tab-pane active <?=$this->activeTab ?>-tab"> + <div class="tab-pane active <?=$this->escapeHtmlAttr($this->activeTab) ?>-tab"> <?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?> </div> <?php endif; ?> <?=$this->driver->supportsCoinsOpenURL()?'<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>':''?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?> <!-- finc: collection - view - END --> diff --git a/themes/finc/templates/documentdeliveryservice/zform.phtml b/themes/finc/templates/documentdeliveryservice/zform.phtml index fde5f06b3de..ce3c0daa9ff 100644 --- a/themes/finc/templates/documentdeliveryservice/zform.phtml +++ b/themes/finc/templates/documentdeliveryservice/zform.phtml @@ -20,13 +20,13 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 */ -use Zend\Form\Element; -use Zend\Form\Element\Submit; -use Zend\Form\Form; -use Zend\Form\View\Helper\FormElementErrors; -use Zend\Form\View\Helper\FormLabel; -use Zend\Form\View\Helper\FormSelect; -use Zend\Form\View\Helper\FormSubmit; +use \Laminas\Form\Element; +use \Laminas\Form\Element\Submit; +use \Laminas\Form\Form; +use \Laminas\Form\View\Helper\FormElementErrors; +use \Laminas\Form\View\Helper\FormLabel; +use \Laminas\Form\View\Helper\FormSelect; +use \Laminas\Form\View\Helper\FormSubmit; /** @var Form $form */ /** @var FormLabel $formLabel */ diff --git a/themes/finc/templates/layout/layout.phtml b/themes/finc/templates/layout/layout.phtml index 98ac358d8a6..4b4bcd421e0 100644 --- a/themes/finc/templates/layout/layout.phtml +++ b/themes/finc/templates/layout/layout.phtml @@ -24,7 +24,7 @@ '%%titleSeparator%%' => $siteConfig->titleSeparator ?? '::' ] ); - echo $this->headTitle($fullTitle, \Zend\View\Helper\Placeholder\Container\AbstractContainer::SET); + echo $this->headTitle($fullTitle, \Laminas\View\Helper\Placeholder\Container\AbstractContainer::SET); // Set up OpenSearch link: $this->headLink( @@ -51,6 +51,9 @@ <?=$this->headLink()?> <?=$this->headStyle()?> <?php + // Collect small scripts together and append as one block: + $appendScripts = []; + if (!isset($this->renderingError)) { // Add translation strings // finc: PDA... (BELOW) is a custom finc string - CK @@ -63,6 +66,7 @@ 'bulk_save_success' => 'bulk_save_success', 'close' => 'close', 'collection_empty' => 'collection_empty', + 'eol_ellipsis' => 'eol_ellipsis', 'error_occurred' => 'An error has occurred', 'go_to_list' => 'go_to_list', 'hold_available' => 'hold_available', @@ -100,15 +104,15 @@ $this->headScript()->appendFile("cart.js"); $domain = $cart->getCookieDomain(); if (!empty($domain)) { - $this->headScript()->appendScript( - 'VuFind.cart.setDomain("' . $domain . '");' - ); + $appendScripts[] = 'VuFind.cart.setDomain("' . $domain . '");'; } $cookiePath = $cart->getCookiePath(); if (!empty($cookiePath)) { - $this->headScript()->appendScript( - 'VuFind.cart.setCookiePath("' . $cookiePath . '");' - ); + $appendScripts[] = 'VuFind.cart.setCookiePath("' . $cookiePath . '");'; + } + $cookieSameSite = $cart->getCookieSameSite(); + if (null !== $cookieSameSite) { + $appendScripts[] = 'VuFind.cart.setCookieSameSite("' . $cookieSameSite . '");'; } $this->jsTranslations()->addStrings( [ @@ -132,8 +136,7 @@ // Session keep-alive if ($this->keepAlive()) { - $this->headScript()->appendScript('var keepAliveInterval = ' - . $this->keepAlive()); + $appendScripts[] = 'var keepAliveInterval = ' . $this->keepAlive() . ';'; $this->headScript()->appendFile("keep_alive.js"); } @@ -143,13 +146,12 @@ $this->headScript()->appendFile("account_ajax.js"); $this->jsTranslations()->addStrings( [ + 'account_checkouts_due' => 'account_checkouts_due', + 'account_checkouts_overdue' => 'account_checkouts_overdue', 'account_has_alerts' => 'account_has_alerts', - 'Checked Out Items' => 'Checked Out Items', - 'ill_request_available' => 'ill_request_available', - 'renew_item_due_tooltip' => 'renew_item_due_tooltip', - 'renew_item_overdue_tooltip' => 'renew_item_overdue_tooltip', - 'request_in_transit' => 'request_in_transit', - 'storage_retrieval_request_available' => 'storage_retrieval_request_available' + 'account_normal_checkouts' => 'account_normal_checkouts', + 'account_requests_available' => 'account_requests_available', + 'account_requests_in_transit' => 'account_requests_in_transit', ] ); } @@ -157,12 +159,16 @@ $root = rtrim($this->url('home'), '/'); $translations = $this->jsTranslations()->getJSON(); $dsb = DEFAULT_SEARCH_BACKEND; - $setupJS = <<<JS + $appendScripts[] = <<<JS VuFind.path = '{$root}'; VuFind.defaultSearchBackend = '{$dsb}'; VuFind.addTranslations({$translations}); JS; - $this->headScript()->appendScript($setupJS); + $this->headScript()->appendScript(implode("\n", $appendScripts)); + + if ($this->config()->ajaxCoversEnabled()) { + $this->headScript()->appendFile("covers.js"); + } ?> <?=$this->headScript()?> </head> @@ -270,7 +276,9 @@ if (!isset($this->layout()->searchbox)) { <div id="modal" class="modal fade hidden-print" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" aria-describedby="modal-description"> <div class="modal-dialog"> <div class="modal-content"> - <button type="button" class="close" data-dismiss="modal" tabindex="0" aria-label="<?= $this->transEsc('CloseModal') ?>"><i class="fa fa-times" aria-hidden="true"></i></button> + <button type="button" class="close" data-dismiss="modal"> + <svg aria-label="<?=$this->transEscAttr('Close') ?>" viewBox="0 0 24 24"><path d="M6 18L18 6M6 6l12 12"></path></svg> + </button> <?php /* finc: add div for screenreader #13547 */ ?> <div class="sr-only" id="modal-description"><?=$this->transEsc('Modal_description')?></div> <div class="modal-body"><?=$this->transEsc('Loading') ?> ...</div> @@ -281,7 +289,7 @@ if (!isset($this->layout()->searchbox)) { <?=$this->googleanalytics()?> <?=$this->piwik()?> <?php foreach ($this->captcha()->js() as $jsInclude):?> - <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, $jsInclude, 'SET')?> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::FILE, $jsInclude, 'SET')?> <?php endforeach; ?> <?php /* Enable Tooltips, finc-specific, CK */ ?> <script> diff --git a/themes/finc/templates/librarycards/editcard.phtml b/themes/finc/templates/librarycards/editcard.phtml index 09e3f5b61fe..cdf244b09a3 100644 --- a/themes/finc/templates/librarycards/editcard.phtml +++ b/themes/finc/templates/librarycards/editcard.phtml @@ -14,7 +14,7 @@ <?php /* finc uses h1 instead of h2 - #17596 */ ?> <h1><?=$this->transEsc($pageTitle); ?></h1> -<form class="form-edit-card" method="post" name="<?=empty($this->card->id) ? 'newCardForm' : 'editCardForm'?>" autocomplete="off"> +<form class="form-edit-card" method="post" name="<?=empty($this->card->id) ? 'newCardForm' : 'editCardForm'?>" autocomplete="off" data-clear-account-cache> <input type="hidden" name="id" value="<?=empty($this->card->id) ? 'NEW' : $this->card->id ?>"/> <div class="form-group"> <label class="control-label" for="card_name"><?=$this->transEsc('Library Card Name'); ?>:</label> @@ -42,12 +42,12 @@ <?php if (null === $this->loginMethod || 'password' === $this->loginMethod): ?> <div class="form-group"> <label class="control-label" for="login_password"><?=$this->transEsc('Password')?>:</label> - <input id="login_password" type="password" name="password" value="" placeholder="<?=!empty($this->card->id) ? $this->escapeHtmlAttr($this->translate('library_card_edit_password_placeholder')) : ''?>" class="form-control"/> + <input id="login_password" type="password" name="password" value="" placeholder="<?=!empty($this->card->id) ? $this->transEscAttr($this->translate('library_card_edit_password_placeholder')) : ''?>" class="form-control"/> </div> <?php endif; ?> <div class="form-group"> <?php /* finc adds aria-label - #17915 */?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>" aria-label="<?=$this->transEsc('Save') ?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>" aria-label="<?=$this->transEscAttr('Save') ?>"/> </div> </form> @@ -57,7 +57,7 @@ $script = "setupMultiILSLoginFields($methods, 'login_');"; // Inline the script for lightbox compatibility - echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); + echo $this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); } ?> <!-- finc - templates - librarycards - editcard - END --> diff --git a/themes/finc/templates/librarycards/home.phtml b/themes/finc/templates/librarycards/home.phtml index a0f191575f1..8d5cd5b3d03 100644 --- a/themes/finc/templates/librarycards/home.phtml +++ b/themes/finc/templates/librarycards/home.phtml @@ -42,12 +42,12 @@ <td><?=$this->escapeHtml($username)?></td> <td> <div class="btn-group"> - <a class="btn btn-link" href="<?=$this->url('editLibraryCard') . $this->escapeHtmlAttr($record['id']) ?>" title="<?=$this->transEsc('Edit Library Card')?>"><i class="fa fa-edit" aria-hidden="true"></i> <?=$this->transEsc('Edit')?></a> + <a class="btn btn-link" href="<?=$this->url('editLibraryCard') . $this->escapeHtmlAttr($record['id']) ?>" title="<?=$this->transEscAttr('Edit Library Card')?>"><i class="fa fa-edit" aria-hidden="true"></i> <?=$this->transEsc('Edit')?></a> <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="<?=$this->url('librarycards-deletecard') ?>?cardID=<?=urlencode($record['id'])?>"> <i class="fa fa-trash-o" aria-hidden="true"></i> <?=$this->transEsc('Delete')?> </a> <ul class="dropdown-menu"> - <li><a href="<?=$this->url('librarycards-deletecard') ?>?cardID=<?=urlencode($record['id'])?>&confirm=1"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a href="<?=$this->url('librarycards-deletecard') ?>?cardID=<?=urlencode($record['id'])?>&confirm=1" data-clear-account-cache><?=$this->transEsc('confirm_dialog_yes') ?></a></li> <li><a href="#"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> diff --git a/themes/finc/templates/myresearch/account.phtml b/themes/finc/templates/myresearch/account.phtml index 3ad064d7335..637eee68803 100644 --- a/themes/finc/templates/myresearch/account.phtml +++ b/themes/finc/templates/myresearch/account.phtml @@ -17,7 +17,7 @@ <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')?></a> <?php /* finc uses 'form-button-submit' here */ ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('form-button-submit')?>" /> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('form-button-submit')?>" /> </div> </form> <!-- finc: myresearch - account - END --> diff --git a/themes/finc/templates/myresearch/cataloglogin.phtml b/themes/finc/templates/myresearch/cataloglogin.phtml index fce09221b59..bbb19ec3c86 100644 --- a/themes/finc/templates/myresearch/cataloglogin.phtml +++ b/themes/finc/templates/myresearch/cataloglogin.phtml @@ -51,7 +51,7 @@ <?php endif; ?> <div class="form-group"> <?php /* finc adds aria-label to input */ ?> - <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEsc("Login-to-account") ?>" value="<?=$this->transEsc('Login')?>"> + <input class="btn btn-primary" type="submit" name="processLogin" aria-label="<?= $this->transEscAttr("Login-to-account") ?>" value="<?=$this->transEscAttr('Login')?>"> </div> </form> @@ -61,7 +61,7 @@ $script = "setupMultiILSLoginFields($methods, 'profile_cat_');"; // Inline the script for lightbox compatibility - echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); + echo $this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); } ?> <?php endif; ?> diff --git a/themes/finc/templates/myresearch/checkedout.phtml b/themes/finc/templates/myresearch/checkedout.phtml index e42b8aa1403..f69d67322c1 100644 --- a/themes/finc/templates/myresearch/checkedout.phtml +++ b/themes/finc/templates/myresearch/checkedout.phtml @@ -22,7 +22,7 @@ <?php if (!empty($this->transactions)): ?> <?php /* finc adds aria-label to nav */ ?> - <nav class="search-header hidden-print" aria-label="<?=$this->transEsc('aria_search_header')?>"> + <nav class="search-header hidden-print" aria-label="<?=$this->transEscAttr('aria_search_header')?>"> <?php if ($paginator): ?> <div class="search-stats"> <?php @@ -51,9 +51,9 @@ <input type="checkbox" name="selectAll" class="checkbox-select-all"/> <?=$this->transEsc('select_page')?> </label> - <input type="submit" class="btn btn-default" id="renewSelected" name="renewSelected" value="<?=$this->transEsc("renew_selected")?>" /> + <input type="submit" class="btn btn-default" id="renewSelected" name="renewSelected" value="<?=$this->transEscAttr("renew_selected")?>" /> <?php if ($renewAll): ?> - <input type="submit" class="btn btn-default" id="renewAll" name="renewAll" value="<?=$this->transEsc('renew_all')?>" /> + <input type="submit" class="btn btn-default" id="renewAll" name="renewAll" value="<?=$this->transEscAttr('renew_all')?>" /> <?php endif; ?> </div> </div> diff --git a/themes/finc/templates/myresearch/edit.phtml b/themes/finc/templates/myresearch/edit.phtml index caee1b907dd..b2df98f1d40 100644 --- a/themes/finc/templates/myresearch/edit.phtml +++ b/themes/finc/templates/myresearch/edit.phtml @@ -62,7 +62,7 @@ <?php if (!empty($this->savedData) || count($this->lists) > 0): ?> <div class="form-group"> <?php /* finc adds aria-label #17915 */ ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>" aria-label="<?=$this->transEsc('Save') ?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>" aria-label="<?=$this->transEscAttr('Save') ?>"/> </div> <?php endif; ?> </form> diff --git a/themes/finc/templates/myresearch/editlist.phtml b/themes/finc/templates/myresearch/editlist.phtml index 8f8f903431d..50ec22fbb7f 100644 --- a/themes/finc/templates/myresearch/editlist.phtml +++ b/themes/finc/templates/myresearch/editlist.phtml @@ -34,6 +34,13 @@ <label class="control-label" for="list_desc"><?=$this->transEsc('Description') ?></label> <textarea id="list_desc" class="form-control" name="desc" rows="3"><?=isset($this->list['description']) ? $this->escapeHtml($this->list['description']) : ''?></textarea> </div> + <?php if ($this->usertags()->getListMode() === 'enabled'): ?> + <div class="form-group"> + <label class="control-label" for="list_tags"><?=$this->transEsc('Tags') ?>:</label> + <input type="text" name="tags" id="list_tags" class="form-control" value="<?=$this->escapeHtmlAttr($this->listTags)?>"/> + <span class="help-block"><?=$this->transEsc("add_tag_note") ?></span> + </div> + <?php endif; ?> <?php if ($this->userlist()->getMode() === 'public_only'): ?> <input type="hidden" name="public" value="1" /> <?php elseif ($this->userlist()->getMode() === 'private_only'): ?> @@ -58,7 +65,7 @@ <?php endif; ?> <div class="form-group"> <?php /* finc adds aria-label */ ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>" aria-label="<?=$this->transEsc('Save') ?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Save') ?>" aria-label="<?=$this->transEscAttr('Save') ?>"/> </div> </form> diff --git a/themes/finc/templates/myresearch/fines.phtml b/themes/finc/templates/myresearch/fines.phtml index 5aeb1f342a0..10073a15f23 100644 --- a/themes/finc/templates/myresearch/fines.phtml +++ b/themes/finc/templates/myresearch/fines.phtml @@ -93,4 +93,6 @@ <div class="<?=$this->layoutClass('sidebar')?>" id="myresearch-sidebar"> <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'fines'])?> </div> + +<?=$this->render('myresearch/notify-account-status.phtml', ['method' => 'fines', 'accountStatus' => $this->accountStatus]); ?> <!-- finc: myresearch - fines - END --> diff --git a/themes/finc/templates/myresearch/holds.phtml b/themes/finc/templates/myresearch/holds.phtml index 00e1455f486..8a1f37f42b6 100644 --- a/themes/finc/templates/myresearch/holds.phtml +++ b/themes/finc/templates/myresearch/holds.phtml @@ -5,6 +5,8 @@ // Set up breadcrumbs: $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('My Holds') . '</li>'; + + $this->headScript()->appendFile('requests.js'); ?> <div class="<?=$this->layoutClass('mainbody')?>"> @@ -25,20 +27,20 @@ <input type="hidden" id="cancelConfirm" name="confirm" value="0"/> <div class="btn-group"> <?php /* finc adds aria-label */ ?> - <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEsc("hold_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-label="<?=$this->transEsc("hold_cancel_selected") ?>"/> + <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEscAttr("hold_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-label="<?=$this->transEscAttr("hold_cancel_selected") ?>"/> <ul class="dropdown-menu"> <li class="disabled"><a><?=$this->transEsc("confirm_hold_cancel_selected_text") ?></a></li> - <li><a href="#" onClick="$('#cancelConfirm').val(1);$('#submitType').attr('name','cancelSelected');$(this).parents('form').submit(); return false;"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> - <li><a href="#" onClick="return false;"><?=$this->transEsc('confirm_dialog_no')?></a></li> + <li><a href="#" id="confirm_cancel_selected_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a href="#" class="confirm_cancel_no"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> <div class="btn-group"> <?php /* finc adds aria-label */ ?> - <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEsc("hold_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-label="<?=$this->transEsc("hold_cancel_all") ?>"/> + <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr("hold_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-label="<?=$this->transEscAttr("hold_cancel_all") ?>"/> <ul class="dropdown-menu"> <li class="disabled"><a><?=$this->transEsc("confirm_hold_cancel_all_text") ?></a></li> - <li><a href="#" onClick="$('#cancelConfirm').val(1);$('#submitType').attr('name','cancelAll');$(this).parents('form').submit(); return false;"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> - <li><a href="#" onClick="return false;"><?=$this->transEsc('confirm_dialog_no')?></a></li> + <li><a href="#" id="confirm_cancel_all_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a href="#" class="confirm_cancel_no"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> <?php endif; ?> @@ -57,7 +59,7 @@ <input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" /> <div class="checkbox"> <label> - <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" aria-describedby="<?=$describedById?>" aria-label="<?=$this->transEsc('select_item_hold_cancel')?>" /> + <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" aria-describedby="<?=$describedById?>" aria-label="<?=$this->transEscAttr('select_item_hold_cancel')?>" /> </label> </div> <?php endif; ?> @@ -199,4 +201,6 @@ <div class="<?=$this->layoutClass('sidebar')?>" id="myresearch-sidebar"> <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'holds'])?> </div> + +<?=$this->render('myresearch/notify-account-status.phtml', ['method' => 'holds', 'accountStatus' => $this->accountStatus]); ?> <!-- finc: myresearch - holds - END --> diff --git a/themes/finc/templates/myresearch/illrequests.phtml b/themes/finc/templates/myresearch/illrequests.phtml index 39dff0da3ad..1f3e8fd31d6 100644 --- a/themes/finc/templates/myresearch/illrequests.phtml +++ b/themes/finc/templates/myresearch/illrequests.phtml @@ -6,6 +6,8 @@ // Set up breadcrumbs: $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li>' . '<li class="active">' . $this->transEsc('Interlibrary Loan Requests') . '</li>'; + + $this->headScript()->appendFile('requests.js'); ?> <div class="<?=$this->layoutClass('mainbody')?>"> @@ -25,19 +27,19 @@ <input type="hidden" id="submitType" name="cancelSelected" value="1"/> <input type="hidden" id="cancelConfirm" name="confirm" value="0"/> <div class="btn-group"> - <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEsc("ill_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> + <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEscAttr("ill_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> <ul class="dropdown-menu"> <li class="disabled"><a><?=$this->transEsc("confirm_ill_request_cancel_selected_text") ?></a></li> - <li><a href="#" onClick="$('#cancelConfirm').val(1);$('#submitType').attr('name','cancelSelected');$(this).parents('form').submit(); return false;"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> - <li><a href="#" onClick="return false;"><?=$this->transEsc('confirm_dialog_no')?></a></li> + <li><a href="#" id="confirm_cancel_selected_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a href="#" class="confirm_cancel_no"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> <div class="btn-group"> - <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEsc("ill_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> + <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr("ill_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> <ul class="dropdown-menu"> <li class="disabled"><a><?=$this->transEsc("confirm_ill_request_cancel_all_text") ?></a></li> - <li><a href="#" onClick="$('#cancelConfirm').val(1);$('#submitType').attr('name','cancelAll');$(this).parents('form').submit(); return false;"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> - <li><a href="#" onClick="return false;"><?=$this->transEsc('confirm_dialog_no')?></a></li> + <li><a href="#" id="confirm_cancel_all_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a href="#" class="confirm_cancel_no"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> <?php endif; ?> @@ -191,4 +193,6 @@ <div class="<?=$this->layoutClass('sidebar')?>" id="myresearch-sidebar"> <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'ILLRequests'])?> </div> + +<?=$this->render('myresearch/notify-account-status.phtml', ['method' => 'illRequests', 'accountStatus' => $this->accountStatus]); ?> <!-- finc: myresearch - illrequests - END --> diff --git a/themes/finc/templates/myresearch/mylist.phtml b/themes/finc/templates/myresearch/mylist.phtml index 8a3a90376be..df58466c73c 100644 --- a/themes/finc/templates/myresearch/mylist.phtml +++ b/themes/finc/templates/myresearch/mylist.phtml @@ -37,7 +37,7 @@ <?=$this->flashmessages()?> <?php /* finc adds aria-label */ ?> - <nav class="search-header hidden-print" aria-label="<?=$this->transEsc('aria_search_header')?>"> + <nav class="search-header hidden-print" aria-label="<?=$this->transEscAttr('aria_search_header')?>"> <div class="search-stats"> <?php if ($recordTotal > 0): ?> <?php @@ -76,6 +76,9 @@ <?php /* finc adds class-name */ ?> <p class="list-desc"><?=$this->escapeHtml($list->description)?></p> <?php endif; ?> + <?php if (!empty($listTags)): ?> + <div><strong><?=$this->transEsc('Tags')?>:</strong> <span class="list-tags"><?=implode(', ', array_map([$this, 'escapeHtml'], $listTags))?></span></div> + <?php endif; ?> <?php if ($recordTotal > 0): ?> <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-myresearchbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> <?=$this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', ['idPrefix' => '', 'list' => $list ?? null, 'account' => $this->account])?> diff --git a/themes/finc/templates/myresearch/newpassword.phtml b/themes/finc/templates/myresearch/newpassword.phtml index 3c7f5bbe169..b54a73883de 100644 --- a/themes/finc/templates/myresearch/newpassword.phtml +++ b/themes/finc/templates/myresearch/newpassword.phtml @@ -32,7 +32,7 @@ <?=$this->captcha()->html($this->useCaptcha) ?> <div class="form-group"> <?php /* finc uses 'form-button-submit' */ ?> - <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEsc('form-button-submit')?>" /> + <input class="btn btn-primary" name="submit" type="submit" value="<?=$this->transEscAttr('form-button-submit')?>" /> </div> </form> <?php endif; ?> diff --git a/themes/finc/templates/myresearch/storageretrievalrequests.phtml b/themes/finc/templates/myresearch/storageretrievalrequests.phtml index 363057160b5..86c4cc3cc0f 100644 --- a/themes/finc/templates/myresearch/storageretrievalrequests.phtml +++ b/themes/finc/templates/myresearch/storageretrievalrequests.phtml @@ -5,6 +5,8 @@ // Set up breadcrumbs: $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Storage Retrieval Requests') . '</li>'; + + $this->headScript()->appendFile('requests.js'); ?> <div class="<?=$this->layoutClass('mainbody')?>"> @@ -24,19 +26,19 @@ <input type="hidden" id="submitType" name="cancelSelected" value="1"/> <input type="hidden" id="cancelConfirm" name="confirm" value="0"/> <div class="btn-group"> - <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEsc("storage_retrieval_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> + <input id="cancelSelected" name="cancelSelected" type="submit" value="<?=$this->transEscAttr("storage_retrieval_request_cancel_selected") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> <ul class="dropdown-menu"> <li class="disabled"><a><?=$this->transEsc("confirm_storage_retrieval_request_cancel_selected_text") ?></a></li> - <li><a href="#" onClick="$('#cancelConfirm').val(1);$('#submitType').attr('name','cancelSelected');$(this).parents('form').submit(); return false;"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> - <li><a href="#" onClick="return false;"><?=$this->transEsc('confirm_dialog_no')?></a></li> + <li><a id="confirm_cancel_selected_yes" href="#"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a class="confirm_cancel_no" href="#"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> <div class="btn-group"> - <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEsc("storage_retrieval_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> + <input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr("storage_retrieval_request_cancel_all") ?>" class="btn btn-default dropdown-toggle" data-toggle="dropdown"/> <ul class="dropdown-menu"> <li class="disabled"><a><?=$this->transEsc("confirm_storage_retrieval_request_cancel_all_text") ?></a></li> - <li><a href="#" onClick="$('#cancelConfirm').val(1);$('#submitType').attr('name','cancelAll');$(this).parents('form').submit(); return false;"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> - <li><a href="#" onClick="return false;"><?=$this->transEsc('confirm_dialog_no')?></a></li> + <li><a href="#" id="confirm_cancel_all_yes"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a class="confirm_cancel_no" href="#"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> <?php endif; ?> @@ -188,4 +190,6 @@ <div class="<?=$this->layoutClass('sidebar')?>" id="myresearch-sidebar"> <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'storageRetrievalRequests'])?> </div> + +<?=$this->render('myresearch/notify-account-status.phtml', ['method' => 'storageRetrievalRequests', 'accountStatus' => $this->accountStatus]); ?> <!-- finc: myresearch - storageretrievalrequests - END --> diff --git a/themes/finc/templates/record/addtag.phtml b/themes/finc/templates/record/addtag.phtml index fa009026480..6c86e0a9ff8 100644 --- a/themes/finc/templates/record/addtag.phtml +++ b/themes/finc/templates/record/addtag.phtml @@ -4,7 +4,7 @@ $this->headTitle($this->translate('Add Tag')); // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') + $this->layout()->breadcrumbs = $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '<li>', '</li> ') . '<li>' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> ' . '<li class="active">' . $this->transEsc('Add Tag') . '</li>'; ?> @@ -20,7 +20,7 @@ <p class="help-block"><?=$this->transEsc("add_tag_note")?></p> </div> <div class="form-group"> - <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Save')?>"/> + <input class="btn btn-primary" type="submit" value="<?=$this->transEscAttr('Save')?>"/> </div> </form <!-- finc - templates - record - addtag - END --> diff --git a/themes/finc/templates/record/cart-buttons.phtml b/themes/finc/templates/record/cart-buttons.phtml index 51e5abe25d2..cbf100bd68b 100644 --- a/themes/finc/templates/record/cart-buttons.phtml +++ b/themes/finc/templates/record/cart-buttons.phtml @@ -17,9 +17,9 @@ <form method="post" name="addForm" action="<?=$this->url('cart-processor')?>" class="cartProcessorNoJs"> <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($cartId)?>" /> <?php if ($cart->contains($cartId)): ?> - <input class="btn btn-default" type="submit" name="delete" value="<?=$this->transEsc('Remove from Book Bag')?>"/> + <input class="btn btn-default" type="submit" name="delete" value="<?=$this->transEscAttr('Remove from Book Bag')?>"/> <?php else: ?> - <input class="btn btn-default" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/> + <input class="btn btn-default" type="submit" name="add" value="<?=$this->transEscAttr('Add to Book Bag')?>"/> <?php endif; ?> </form> <?php /* finc adds JS function for better W3C Validation */ ?> diff --git a/themes/finc/templates/record/checkbox.phtml b/themes/finc/templates/record/checkbox.phtml index 0c76b545487..a203b76a04a 100644 --- a/themes/finc/templates/record/checkbox.phtml +++ b/themes/finc/templates/record/checkbox.phtml @@ -3,7 +3,7 @@ <?php $label = isset($this->context) ? 'select_item_' . $this->context : 'select_item'; ?> <label class="record-checkbox hidden-print"> <?php /* finc adds aria-label and -describedby */ ?> - <input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->id?>"<?php if(isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-describedby="<?=$this->id?>" aria-label="<?=$this->transEsc($label)?>"/> + <input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->id?>"<?php if(isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-describedby="<?=$this->id?>" aria-label="<?=$this->transEscAttr($label)?>"/> <span class="checkbox-icon"></span> <?php if (strlen($this->number ?? '') > 0): ?><span class="sr-only"><?=$this->transEsc('result_checkbox_label', ['%%number%%' => $this->number]) ?></span><?php endif; ?> </label> diff --git a/themes/finc/templates/record/prev-next.phtml b/themes/finc/templates/record/prev-next.phtml index 97214d0beab..39aaa8924b5 100644 --- a/themes/finc/templates/record/prev-next.phtml +++ b/themes/finc/templates/record/prev-next.phtml @@ -1,20 +1,20 @@ <!-- finc: record - prev-next --> <?php /* finc uses 'pagination_label' here */ ?> -<nav aria-label="<?=$this->transEsc('pagination_label')?>"> +<nav aria-label="<?=$this->transEscAttr('pagination_label')?>"> <ul class="pager hidden-print"> <?php if ($this->scrollData['previousRecord']): ?> <?php if ($this->scrollData['firstRecord']): ?> <?php /* finc removes role from li-elements */ ?> <?php /* finc sets classname left or right for li-elements */ ?> <li class="left"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['firstRecord'])?>" aria-label="<?=$this->transEsc('First Search Result')?>" rel="nofollow"> + <a href="<?=$this->recordLink()->getUrl($this->scrollData['firstRecord'])?>" aria-label="<?=$this->transEscAttr('First Search Result')?>" rel="nofollow"> <i class="fa fa-angle-double-left" aria-hidden="true"></i> <?=$this->transEsc('First')?> </a> </li> <?php endif; ?> <li class="left"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['previousRecord'])?>" aria-label="<?=$this->transEsc('Previous Search Result')?>" rel="nofollow"> + <a href="<?=$this->recordLink()->getUrl($this->scrollData['previousRecord'])?>" aria-label="<?=$this->transEscAttr('Previous Search Result')?>" rel="nofollow"> <i class="fa fa-angle-left" aria-hidden="true"></i> <?=$this->transEsc('Prev')?> </a> @@ -35,14 +35,14 @@ <?php if ($this->scrollData['nextRecord']): ?> <li class="right"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>" aria-label="<?=$this->transEsc('Next Search Result')?>" rel="nofollow"> + <a href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>" aria-label="<?=$this->transEscAttr('Next Search Result')?>" rel="nofollow"> <?=$this->transEsc('Next')?> <i class="fa fa-angle-right" aria-hidden="true"></i> </a> </li> <?php if ($this->scrollData['lastRecord']): ?> <li class="right"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['lastRecord'])?>" aria-label="<?=$this->transEsc('Last Search Result')?>" rel="nofollow"> + <a href="<?=$this->recordLink()->getUrl($this->scrollData['lastRecord'])?>" aria-label="<?=$this->transEscAttr('Last Search Result')?>" rel="nofollow"> <?=$this->transEsc('Last')?> <i class="fa fa-angle-double-right" aria-hidden="true"></i> </a> diff --git a/themes/finc/templates/record/reporterrorsform.phtml b/themes/finc/templates/record/reporterrorsform.phtml index bc55785262f..839a618355e 100644 --- a/themes/finc/templates/record/reporterrorsform.phtml +++ b/themes/finc/templates/record/reporterrorsform.phtml @@ -42,5 +42,5 @@ $(document).ready(function () { }); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> <!-- finc: record - reporterrorsform - End --> diff --git a/themes/finc/templates/record/save.phtml b/themes/finc/templates/record/save.phtml index cab84abbf1a..3b8f0f5bcb3 100644 --- a/themes/finc/templates/record/save.phtml +++ b/themes/finc/templates/record/save.phtml @@ -4,7 +4,7 @@ $this->headTitle($this->translate('Save')); // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') + $this->layout()->breadcrumbs = $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '<li>', '</li> ') . '<li>' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> ' . '<li class="active">' . $this->transEsc('Save') . '</li>'; ?> @@ -28,7 +28,7 @@ <div class="form-group"> <?php if ($showLists): ?> - <label class="control-label" for="save_list"><?=$this->transEsc('Choose a List') ?></label> + <label class="control-label" for="save_list"><?=$this->transEscAttr('Choose a List') ?></label> <?php endif; ?> <?php if ($showLists): ?> <select class="form-control" id="save_list" name="list"> diff --git a/themes/finc/templates/record/view.phtml b/themes/finc/templates/record/view.phtml index 7758fa75dae..12b6688d819 100644 --- a/themes/finc/templates/record/view.phtml +++ b/themes/finc/templates/record/view.phtml @@ -7,6 +7,10 @@ if ($this->syndeticsPlus()->isActive()) { $this->headScript()->appendFile($this->syndeticsPlus()->getScript()); } + // Add any extra scripts the tabs require: + foreach ($this->tabsExtraScripts as $script) { + $this->headScript()->appendFile($script); + } // Add RDF header link if applicable: if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) { @@ -14,7 +18,7 @@ } // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') . + $this->layout()->breadcrumbs = $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '<li>', '</li> ') . '<li class="active" aria-current="page">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> '; $this->layout()->title = $this->driver->getShortTitle(); ?> @@ -34,7 +38,7 @@ <?php /* finc - don't use '<?=count($sidebarList) < 1 ? ' solo' : '' ?>' or toolbar won't fit; BS count sidebars but our toolbar isn't counted */ ?> <div class="<?=$this->layoutClass('mainbody')?>"> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId" /> - <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier()) ?>" class="hiddenSource" /> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource" /> <?=$this->flashmessages()?> <?=$this->record($this->driver)->getCoreMetadata()?> @@ -70,7 +74,7 @@ <?php /* finc: DO NOT add role='tab' BUT DO ADD aria-controls and ID for accessibility -- 'aria-selected' (true/false) needs to be set via record.js - CK */ ?> <li class="<?=implode(' ', $tabClasses) ?>" data-tab="<?=$tabName ?>"> - <a href="<?= $this->recordLink()->getTabUrl($this->driver, $tab) ?>#tabnav" + <a href="<?= $this->recordLink()->getTabUrl($this->driver, $tab) ?>#tabnav" data-lightbox-ignore <?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)):?> data-background<?php endif ?> aria-selected="<?= $isActiveTab ? "true" : "false" ?>" <?php if ($isActiveTab): ?>aria-controls="<?= $tabName ?>"<?php endif; ?> @@ -109,5 +113,5 @@ </div> </div> -<?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?> +<?= $this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET'); ?> <!-- finc: record - view - END --> diff --git a/themes/finc/templates/search/advanced/layout.phtml b/themes/finc/templates/search/advanced/layout.phtml index da3c44a8128..026b069389f 100644 --- a/themes/finc/templates/search/advanced/layout.phtml +++ b/themes/finc/templates/search/advanced/layout.phtml @@ -8,11 +8,9 @@ //$this->layout()->searchbox = false; // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li>'; - $lastSearchLink = $this->searchMemory()->getLastSearchLink($this->transEsc('Search')); - $this->layout()->breadcrumbs .= !empty($lastSearchLink) - ? $lastSearchLink : $this->transEsc('Search'); - $this->layout()->breadcrumbs .= '</li> <li class="active">' . $this->transEsc('Advanced') . '</li>'; + $searchCrumb = $this->searchMemory()->getLastSearchLink($this->transEsc('Search')) ?: $this->transEsc('Search'); + $this->layout()->breadcrumbs = "<li>$searchCrumb</li> "; + $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc('Advanced') . '</li>'; // Set up saved search details: if (isset($this->saved) && is_object($this->saved)) { @@ -33,12 +31,12 @@ // Step 1: Load the javascript $this->headScript()->appendFile( - isset($this->advancedSearchJsOverride) ? $this->advancedSearchJsOverride : 'advanced_search.js' + $this->advancedSearchJsOverride ?? 'advanced_search.js' ); // Step 2: Build the page $this->headScript()->appendScript( $this->partial( - isset($this->buildPageOverride) ? $this->buildPageOverride : 'search/advanced/build_page.phtml', + $this->buildPageOverride ?? 'search/advanced/build_page.phtml', ['options' => $this->options, 'searchDetails' => $searchDetails] ) ); @@ -79,7 +77,7 @@ <div class="clearfix"> <?php /* finc: offcanvas behaviour for xs #17601 */ ?> <span class="offcanvas-toggler"> - <a class="search-filter-toggle btn btn-primary visible-xs" href="#myresearch-sidebar" data-toggle="offcanvas" aria-label="<?=$this->transEsc('sidebar_expand')?>"> + <a class="search-filter-toggle btn btn-primary visible-xs" href="#myresearch-sidebar" data-toggle="offcanvas" aria-label="<?=$this->transEscAttr('sidebar_expand')?>"> <?=$this->transEsc('offcanvas-toggler-search-tips')?> </a> </span> @@ -95,7 +93,7 @@ </div> <?php /* finc: keep icon inside link for consistent functionality */ ?> <span id="groupPlaceHolder" class="hidden"> - <a href="javascript:void(0);" onClick="addGroup();return false" class="btn btn-default" role="button"> + <a href="javascript:void(0);" class="btn btn-default" role="button"> <i class="fa fa-plus" aria-hidden="true"></i><?= $this->transEsc('add_search_group') ?> </a> </span> @@ -109,7 +107,7 @@ <div id="new_group_template"> <?php endif; ?> <?php /* finc add roles, aria-label #19418 */ ?> - <div id="group<?=$group ?>" class="adv-group" role="group" aria-label="<?=$this->transEsc('adv_search_searchgroup')?> <?=$group?>"> + <div id="group<?=$group ?>" class="adv-group" role="group" aria-label="<?=$this->transEscAttr('adv_search_searchgroup')?> <?=$group?>"> <div class="adv-group-terms"> <?php /* remove label in favor of more detailed labelling */ /* <label class="adv-group-label" for="search_lookfor<?=$group ?>_0"><?=$this->transEsc("adv_search_label")?>:</label> */ ?> <?php for($search = 0; $search < 3 || (isset($setQueries[$group]) && $search < count($setQueries[$group])); $search++): ?> @@ -177,16 +175,16 @@ </div> <?php /* finc: introduce 'fnd-btn'-class to swap submit and clear buttons for consistency */ ?> <div class="adv-submit"> - <input class="clear-btn btn btn-transparent" type="button" value="<?=$this->transEsc('Clear')?>" aria-label="<?=$this->transEsc('Clear')?>"> - <input class="fnd-btn btn btn-primary" type="submit" value="<?= $this->transEsc('Find')?>" aria-label="<?= $this->transEsc('Find')?>"> + <input class="clear-btn btn btn-transparent" type="button" value="<?=$this->transEscAttr('Clear')?>" aria-label="<?=$this->transEscAttr('Clear')?>"> + <input class="fnd-btn btn btn-primary" type="submit" value="<?= $this->transEscAttr('Find')?>" aria-label="<?= $this->transEscAttr('Find')?>"> </div> <?php if (isset($this->extraAdvancedControls)): ?> <div class="clearfix"> <?=$this->extraAdvancedControls ?> </div> <div class="adv-submit margin-t margin-btm"> - <input class="clear-btn btn btn-transparent" type="button" value="<?=$this->transEsc('Clear')?>" aria-label="<?=$this->transEsc('Clear')?>"> - <input class="fnd-btn btn btn-primary" type="submit" value="<?= $this->transEsc('Find')?>" aria-label="<?= $this->transEsc('Find')?>"> + <input class="clear-btn btn btn-transparent" type="button" value="<?=$this->transEscAttr('Clear')?>" aria-label="<?=$this->transEscAttr('Clear')?>"> + <input class="fnd-btn btn btn-primary" type="submit" value="<?= $this->transEscAttr('Find')?>" aria-label="<?= $this->transEscAttr('Find')?>"> </div> <?php endif; ?> </div> @@ -223,4 +221,13 @@ </div> </form> </div> +<?php +$script = <<<JS +$('#groupPlaceHolder a').click(function(e) { + addGroup(); + return false; +}) +JS; +?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> <!-- finc: search - advanced - layout - END --> diff --git a/themes/finc/templates/search/advanced/ranges.phtml b/themes/finc/templates/search/advanced/ranges.phtml index c9f85c89877..80bf13a087b 100644 --- a/themes/finc/templates/search/advanced/ranges.phtml +++ b/themes/finc/templates/search/advanced/ranges.phtml @@ -79,7 +79,7 @@ $(document).ready(function() { }); JS; ?> - <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> <?php endif; ?> </fieldset> <?php endforeach; ?> diff --git a/themes/finc/templates/search/advanced/solr.phtml b/themes/finc/templates/search/advanced/solr.phtml index 46b72069fd4..346ec5b6f38 100644 --- a/themes/finc/templates/search/advanced/solr.phtml +++ b/themes/finc/templates/search/advanced/solr.phtml @@ -20,16 +20,34 @@ <?php endforeach; ?> <?php else: ?> <?php - // Sort the current facet list alphabetically; we'll use this data + // Sort the current facet list alphabetically and filter items to + // the top if they appear in the config; we'll use this data // along with the foreach below to display facet options in the // correct order. + $conf = $this->options->limitOrderOverride($field); $sorted = []; + $filtered = []; foreach ($list['list'] as $i => $value) { if (!empty($value['displayText'])) { - $sorted[$i] = $value['displayText']; + if (in_array($value['displayText'], $conf)) { + $filtered[$i] = $value['displayText']; + } else { + $sorted[$i] = $value['displayText']; + } } } natcasesort($sorted); + + // Order filtered items according to how they appear in the config. + $filterKeys = array_flip($conf); + uasort($filtered, function ($a, $b) use ($filterKeys) { + return $filterKeys[$a] <=> $filterKeys[$b]; + }); + + // Combine filtered and sorted arrays so that the items in the config + // appear in order at the top and all other items appear afterwards + // sorted by natcasesort. + $sorted = $filtered + $sorted; ?> <?php foreach ($sorted as $i => $display): ?> <?php $value = $list['list'][$i]; ?> diff --git a/themes/finc/templates/search/bulk-action-buttons.phtml b/themes/finc/templates/search/bulk-action-buttons.phtml index 7584246ad38..cd240140334 100644 --- a/themes/finc/templates/search/bulk-action-buttons.phtml +++ b/themes/finc/templates/search/bulk-action-buttons.phtml @@ -12,19 +12,19 @@ <?php if (isset($this->showBulkOptions) && $this->showBulkOptions): ?> <li> <?php /* keep id="<?=$this->idPrefix?>... on all buttons for proper id assignment for top and bottom toolbar */ ?> - <button id="<?=$this->idPrefix?>ribbon-email" class="toolbar-btn btn-type-email" type="submit" name="email" value="1" title="<?=$this->transEsc('bookbag_email_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Email')?></button> + <button id="<?=$this->idPrefix?>ribbon-email" class="toolbar-btn btn-type-email" type="submit" name="email" value="1" title="<?=$this->transEscAttr('bookbag_email_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Email')?></button> </li> <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?> <li> - <button id="<?=$this->idPrefix?>ribbon-export" class="toolbar-btn btn-type-export" type="submit" name="export" value="1" title="<?=$this->transEsc('bookbag_export_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Export')?></button> + <button id="<?=$this->idPrefix?>ribbon-export" class="toolbar-btn btn-type-export" type="submit" name="export" value="1" title="<?=$this->transEscAttr('bookbag_export_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Export')?></button> </li> <?php endif; ?> <li> - <button id="<?=$this->idPrefix?>ribbon-print" class="toolbar-btn btn-type-print" type="submit" name="print" value="1" title="<?=$this->transEsc('bookbag_print_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Print')?></button> + <button id="<?=$this->idPrefix?>ribbon-print" class="toolbar-btn btn-type-print" type="submit" name="print" value="1" title="<?=$this->transEscAttr('bookbag_print_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Print')?></button> </li> <?php if ($this->userlist()->getMode() !== 'disabled'): ?> <li> - <button id="<?=$this->idPrefix?>ribbon-save" class="toolbar-btn btn-type-save" type="submit" name="saveCart" value="1" title="<?=$this->transEsc('bookbag_save_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Save')?></button> + <button id="<?=$this->idPrefix?>ribbon-save" class="toolbar-btn btn-type-save" type="submit" name="saveCart" value="1" title="<?=$this->transEscAttr('bookbag_save_selected')?>"<?php if ($this->formAttr): ?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>><?=$this->transEsc('Save')?></button> </li> <?php endif; ?> <?php endif; ?> diff --git a/themes/finc/templates/search/controls/limit.phtml b/themes/finc/templates/search/controls/limit.phtml index 50ffafe7d11..42a691b5ec3 100644 --- a/themes/finc/templates/search/controls/limit.phtml +++ b/themes/finc/templates/search/controls/limit.phtml @@ -3,7 +3,8 @@ <?php if (count($limitList) > 1): ?> <?php /* finc: DO NOT use class 'form-inline' as it messes up the select box */ /* finc: remove classname search-result-limit */ ?> - <form class="limit-form" action="<?=$this->currentPath() . $this->results->getUrlQuery()->setLimit(null)?>" method="post"> + <form class="limit-form" action="<?=$this->currentPath() . $this->results->getUrlQuery()->setLimit(null)?>" method="get"> + <?=$this->results->getUrlQuery()->asHiddenFields(['sort' => '/.*/']);?> <label for="limit"><?=$this->transEsc('Results per page')?></label> <div class="limit-inner"> <?php /* finc: DO NOT use class 'form-control' as it messes up the select box */ ?> @@ -13,7 +14,7 @@ <?php endforeach; ?> </select> <?php /* finc: add button for accessibility #18016 */ ?> - <button type="submit" class="btn btn-primary" aria-label="<?=$this->transEsc("Set")?>"> + <button type="submit" class="btn btn-primary" aria-label="<?=$this->transEscAttr("Set")?>"> <i class="fa fa-refresh" aria-hidden="true"></i> </button> </div> diff --git a/themes/finc/templates/search/controls/results-tools.phtml b/themes/finc/templates/search/controls/results-tools.phtml new file mode 100644 index 00000000000..7cd5801c3f9 --- /dev/null +++ b/themes/finc/templates/search/controls/results-tools.phtml @@ -0,0 +1,20 @@ +<!-- finc: search - controls - results-tools --> +<?php /* finc: remove searchtools #18164 *//* ?> +<div class="searchtools hidden-print"> + <strong><?=$this->transEsc('Search Tools')?>:</strong> + <a href="<?=$this->results->getUrlQuery()->setViewParam('rss')?>"><i class="fa fa-bell" aria-hidden="true"></i> <?=$this->transEsc('Get RSS Feed')?></a> + <span class="hidden-xs hidden-sm">—</span> + <a href="<?=$this->url('search-email')?>" class="mailSearch" data-lightbox id="mailSearch<?=$this->escapeHtmlAttr($this->results->getSearchId())?>"> + <i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this Search')?> + </a> + <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled' && is_numeric($this->results->getSearchId())): ?> + <span class="hidden-xs hidden-sm">—</span> + <?php if ($this->results->isSavedSearch()): ?> + <a href="<?=$this->url('myresearch-savesearch')?>?delete=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-remove" aria-hidden="true"></i> <?=$this->transEsc('save_search_remove')?></a> + <?php else: ?> + <a href="<?=$this->url('myresearch-savesearch')?>?save=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-save" aria-hidden="true"></i> <?=$this->transEsc('save_search')?></a> + <?php endif; ?> + <?php endif; ?> +</div> +*/ ?> +<!-- finc: search - controls - results-tools - END --> diff --git a/themes/finc/templates/search/controls/sort.phtml b/themes/finc/templates/search/controls/sort.phtml index 086d23c9a73..0ab1c6f4322 100644 --- a/themes/finc/templates/search/controls/sort.phtml +++ b/themes/finc/templates/search/controls/sort.phtml @@ -12,7 +12,7 @@ <?php endforeach; ?> </select> <?php /* finc: add button for accessibility #18016 */ ?> - <button type="submit" class="btn btn-primary" aria-label="<?=$this->transEsc("Set")?>"> + <button type="submit" class="btn btn-primary" aria-label="<?=$this->transEscAttr("Set")?>"> <i class="fa fa-refresh" aria-hidden="true"></i> </button> </div> diff --git a/themes/finc/templates/search/filters.phtml b/themes/finc/templates/search/filters.phtml index e5c1bb0a17e..b5f61fc369e 100644 --- a/themes/finc/templates/search/filters.phtml +++ b/themes/finc/templates/search/filters.phtml @@ -11,7 +11,7 @@ $lastSort = $this->searchMemory()->getLastSort($this->searchClassId); $options = $this->searchOptions($this->searchClassId); $hasDefaultsApplied = $params->hasDefaultsApplied(); - $filterCount = $this->searchbox()->getFilterCount($checkboxFilters, $filterList); + $filterCount = $this->searchbox()->getFilterCount($this->checkboxFilters, $this->filterList); // Determine whether the only filters applied are the default ones; this controls // when we display or hide the reset button: @@ -27,7 +27,7 @@ $advancedSearch = $this->searchType === 'advanced'; ?> <?php ob_start(); ?> - <?php foreach ($checkboxFilters as $filter): ?> + <?php foreach ($this->checkboxFilters as $filter): ?> <?php if ($filter['selected']): ?> <span class="filter-value"> <?php diff --git a/themes/finc/templates/search/history-table.phtml b/themes/finc/templates/search/history-table.phtml index af9dbf8c327..94f972b870d 100644 --- a/themes/finc/templates/search/history-table.phtml +++ b/themes/finc/templates/search/history-table.phtml @@ -15,8 +15,8 @@ </tr> <?php foreach (($this->showSaved ? array_reverse($this->saved) : array_reverse($this->unsaved)) as $iteration => $info): ?> <tr class="<?=$iteration % 2 == 1 ? 'even' : 'odd'?>row"> - <td data-title="<?= $this->transEsc('history_time') ?>:"><?=$this->escapeHtml($this->dateTime()->convertToDisplayDateAndTime("U", $info->getStartTime()))?></td> - <td data-title="<?= $this->transEsc('history_search') ?>:"> + <td data-title="<?= $this->transEscAttr('history_time') ?>:"><?=$this->escapeHtml($this->dateTime()->convertToDisplayDateAndTime("U", $info->getStartTime()))?></td> + <td data-title="<?= $this->transEscAttr('history_search') ?>:"> <?=$this->historylabel($info->getParams()->getSearchClassId())?> <?php /* add lang undefines tag */ ?> <a href="<?=$this->url($info->getOptions()->getSearchAction()) . $info->getUrlQuery()->getParams()?>" lang=""><?php @@ -24,7 +24,7 @@ echo empty($desc) ? $this->transEsc("history_empty_search") : $this->escapeHtml($desc); ?></a> </td> - <td data-title="<?= $this->transEsc('history_limits') ?>:"> + <td data-title="<?= $this->transEscAttr('history_limits') ?>:"> <?php foreach ($info->getParams()->getFilterList(true) as $field => $filters): ?> <?php foreach ($filters as $i => $filter): ?> <?php if ($filter['operator'] == 'NOT') echo $this->transEsc('NOT') . ' '; if ($filter['operator'] == 'OR' && $i > 0) echo $this->transEsc('OR') . ' '; ?> @@ -37,13 +37,13 @@ <?php endif; ?> <?php endforeach; ?> </td> - <td data-title="<?= $this->transEsc('history_results') ?>:"><?=$this->escapeHtml($this->localizedNumber($info->getResultTotal()))?></td> + <td data-title="<?= $this->transEscAttr('history_results') ?>:"><?=$this->escapeHtml($this->localizedNumber($info->getResultTotal()))?></td> <?php if ($scheduleSupported): ?> <td> <?php if (isset($this->schedule[$info->getSearchId()])): ?> <?php $schedule = $this->schedule[$info->getSearchId()]; ?> <form class="form-inline jumpMenuForm" action="<?= $this->url('myresearch-savesearch')?>" method="get" name="schedule"> - <select name="schedule" class="jumpMenu form-control" aria-haspopup="true" title="<?=$this->transEsc("history_schedule")?>"> + <select name="schedule" class="jumpMenu form-control" aria-haspopup="true" title="<?=$this->transEscAttr("history_schedule")?>"> <?php foreach ($scheduleOptions as $scheduleValue => $scheduleLabel): ?> <option value="<?=$this->escapeHtmlAttr($scheduleValue)?>"<?=($schedule == $scheduleValue) ? (' selected') : ('')?>><?=$this->transEsc($scheduleLabel)?></option> <?php endforeach; ?> @@ -56,7 +56,7 @@ </td> <?php endif; ?> <?php if ($saveSupported): ?> - <td data-title="<?= $this->transEsc($this->showSaved ? "history_delete" : "history_save") ?>"> + <td data-title="<?= $this->transEscAttr($this->showSaved ? "history_delete" : "history_save") ?>"> <?php if ($this->showSaved): ?> <a href="<?=$this->url('myresearch-savesearch')?>?delete=<?=urlencode($info->getSearchId())?>&mode=history" class="text-danger"><i class="fa fa-remove" aria-hidden="true"></i> <?=$this->transEsc("history_delete_link")?></a> <?php else: ?> diff --git a/themes/finc/templates/search/history.phtml b/themes/finc/templates/search/history.phtml index 782571ae123..600c8001e88 100644 --- a/themes/finc/templates/search/history.phtml +++ b/themes/finc/templates/search/history.phtml @@ -85,5 +85,5 @@ $(".search-schedule-header").popover({ }) JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> +<?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> <!-- finc - templates - search - history - END --> diff --git a/themes/finc/templates/search/home.phtml b/themes/finc/templates/search/home.phtml index f77f0e14b89..50eda7b0bd9 100644 --- a/themes/finc/templates/search/home.phtml +++ b/themes/finc/templates/search/home.phtml @@ -18,8 +18,10 @@ <h1><?= $this->translate("LibraryName") ?></h1> <?php /* finc: Activate search box below if you want the old look -- otherwise we keep the consistent look with searchbox in header */ ?> <?php /* - <?=$this->context($this)->renderInContext("search/searchbox.phtml", ['ignoreHiddenFilterMemory' => true])?> - <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$("#searchForm_lookfor").focus();', 'SET'); ?> + <?php $this->slot('search-home-hero')->start() ?> + <?=$this->context($this)->renderInContext("search/searchbox.phtml", ['ignoreHiddenFilterMemory' => true])?> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, '$("#searchForm_lookfor").focus();', 'SET'); ?> + <?=$this->slot('search-home-hero')->end() ?> */ ?> </div> diff --git a/themes/finc/templates/search/newitem.phtml b/themes/finc/templates/search/newitem.phtml index 3ce7c3d7fcc..e1bdd28c0ee 100644 --- a/themes/finc/templates/search/newitem.phtml +++ b/themes/finc/templates/search/newitem.phtml @@ -39,7 +39,7 @@ </div> <?php endif; ?> <?php /* finc adds aria-label */ ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?= $this->transEsc('Find') ?>" aria-label="<?= $this->transEsc('Find')?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?= $this->transEscAttr('Find') ?>" aria-label="<?= $this->transEscAttr('Find')?>"/> </form> </div> <!-- finc - templates - search - newitem - END --> diff --git a/themes/finc/templates/search/pagination.phtml b/themes/finc/templates/search/pagination.phtml index b2e9b787d5e..1bf06b782ef 100644 --- a/themes/finc/templates/search/pagination.phtml +++ b/themes/finc/templates/search/pagination.phtml @@ -2,17 +2,17 @@ <?php if ($this->pageCount > 1): ?> <?php /* Adapted to the requirements of https://a11y-style-guide.com/style-guide/section-navigation.html#kssref-navigation-pagination - CK */ ?> <?php /* finc: aria-label in nav instead of ul */ ?> - <nav aria-label="<?=$this->transEsc('pagination_label')?>"> + <nav aria-label="<?=$this->transEscAttr('pagination_label')?>"> <?php /* finc: remove role="none" of li-elements */ ?> <ul class="pagination"> <?php if (isset($this->previous)): ?> <?php if (!isset($this->options['disableFirst']) || !$this->options['disableFirst']): ?> <li> - <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>" aria-label="<?=$this->transEsc('page_first')?>" aria-disabled="true">[1]</a> + <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>" aria-label="<?=$this->transEscAttr('page_first')?>" aria-disabled="true">[1]</a> </li> <?php endif; ?> <li> - <a class="page-prev" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>" aria-label="<?=$this->transEsc('page_prev')?>"> + <a class="page-prev" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>" aria-label="<?=$this->transEscAttr('page_prev')?>"> <i class="fa fa-angle-left" aria-hidden="true"></i> <?=$this->transEsc('Prev')?> </a> @@ -23,7 +23,7 @@ <?php foreach ($this->pagesInRange as $page): ?> <?php if ($page != $this->current): ?> <li> - <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($page)?>" aria-label="<?=$this->transEsc('page_no', ['%%page%%' => $page])?>"><?=$page?></a> + <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($page)?>" aria-label="<?=$this->transEscAttr('page_no', ['%%page%%' => $page])?>"><?=$page?></a> </li> <?php else: ?> <li class="active" aria-current="page"><span><?=$page?></span></li> @@ -33,14 +33,14 @@ <?php if (isset($this->next)): ?> <li> - <a class="page-next" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->next)?>" aria-label="<?=$this->transEsc('page_next')?>"> + <a class="page-next" href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->next)?>" aria-label="<?=$this->transEscAttr('page_next')?>"> <?=$this->transEsc('Next');?> <i class="fa fa-angle-right" aria-hidden="true"></i> </a> </li> <?php if (!isset($this->options['disableLast']) || !$this->options['disableLast']): ?> <li> - <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->pageCount)?>" aria-label="<?=$this->transEsc('page_last')?>">[<?=$this->pageCount?>]</a> + <a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->pageCount)?>" aria-label="<?=$this->transEscAttr('page_last')?>">[<?=$this->pageCount?>]</a> </li> <?php endif; ?> <?php endif; ?> diff --git a/themes/finc/templates/search/reserves.phtml b/themes/finc/templates/search/reserves.phtml index b4accad7c2e..681d0319160 100644 --- a/themes/finc/templates/search/reserves.phtml +++ b/themes/finc/templates/search/reserves.phtml @@ -27,7 +27,7 @@ <?php endforeach; ?> </select> <?php /* finc adds aria-label */ ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>" aria-label="<?= $this->transEsc('Find')?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Find')?>" aria-label="<?= $this->transEscAttr('Find')?>"/> </div> <?php endif; ?> @@ -41,7 +41,7 @@ <?php endforeach; ?> </select> <?php /* finc adds aria-label */ ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>" aria-label="<?= $this->transEsc('Find')?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Find')?>" aria-label="<?= $this->transEscAttr('Find')?>"/> </div> <?php endif; ?> @@ -55,7 +55,7 @@ <?php endforeach; ?> </select> <?php /* finc adds aria-label */ ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>" aria-label="<?= $this->transEsc('Find')?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr('Find')?>" aria-label="<?= $this->transEscAttr('Find')?>"/> </div> <?php endif; ?> </form> diff --git a/themes/finc/templates/search/reservessearch.phtml b/themes/finc/templates/search/reservessearch.phtml index 8bb5b976a78..e2e8e5fb84a 100644 --- a/themes/finc/templates/search/reservessearch.phtml +++ b/themes/finc/templates/search/reservessearch.phtml @@ -17,9 +17,9 @@ <form class="form-inline" method="get" name="reservesSearchForm"> <label for="reservesSearchForm_lookfor"><?=$this->transEsc("Your search terms")?></label> <input id="reservesSearchForm_lookfor" type="text" name="lookfor" size="40" value="<?=$this->escapeHtmlAttr($reservesLookfor)?>" <?=$this->searchOptions('SolrReserves')->autocompleteEnabled() ? ' class="autocomplete searcher:SolrReserves type:Reserves"' : ''?> /> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc("Find")?>"/> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEscAttr("Find")?>"/> </form> - <script>$("#reservesSearchForm_lookfor").focus()</script> + <?=$this->inlineScript(\Laminas\View\Helper\HeadScript::SCRIPT, "$('#reservesSearchForm_lookfor').focus()", 'SET')?> <div class="resulthead"> <div class="pull-left flip"> @@ -69,10 +69,10 @@ ); ?> <tr> - <td data-title="<?= $this->transEsc("Department") ?>:" class="department"><a href="<?=$url?>"><?=$this->escapeHtml($record->getDepartment())?></a></td> - <td data-title="<?= $this->transEsc("Course") ?>:" class="course"><a href="<?=$url?>"><?=$this->escapeHtml($record->getCourse())?></a></td> - <td data-title="<?= $this->transEsc("Instructor") ?>:" class="instructor"><a href="<?=$url?>"><?=$this->escapeHtml($record->getInstructor())?></a></td> - <td data-title="<?= $this->transEsc("Items") ?>:" class="items"><?=$this->escapeHtml($record->getItemCount())?></td> + <td data-title="<?= $this->transEscAttr("Department") ?>:" class="department"><a href="<?=$url?>"><?=$this->escapeHtml($record->getDepartment())?></a></td> + <td data-title="<?= $this->transEscAttr("Course") ?>:" class="course"><a href="<?=$url?>"><?=$this->escapeHtml($record->getCourse())?></a></td> + <td data-title="<?= $this->transEscAttr("Instructor") ?>:" class="instructor"><a href="<?=$url?>"><?=$this->escapeHtml($record->getInstructor())?></a></td> + <td data-title="<?= $this->transEscAttr("Items") ?>:" class="items"><?=$this->escapeHtml($record->getItemCount())?></td> </tr> <?php endforeach; ?> </table> diff --git a/themes/finc/templates/search/results.phtml b/themes/finc/templates/search/results.phtml index b2c41544991..de6de2dad09 100644 --- a/themes/finc/templates/search/results.phtml +++ b/themes/finc/templates/search/results.phtml @@ -4,9 +4,9 @@ $this->context = 'search_result'; // Set up page title: - $lookfor = $this->results->getUrlQuery()->isQuerySuppressed() ? '' : $this->params->getDisplayQuery(); + $lookfor = $this->results->getUrlQuery()->isQuerySuppressed() ? '' : $this->params->getDisplayQuery(); $headTitle = $this->slot('head-title') - ->get($this->translate('Search Results') . (empty($lookfor) ? '' : " - {$lookfor}")); + ->get($this->translate('Search Results') . (empty($lookfor) ? '' : " - {$lookfor}")); $this->headTitle($headTitle); // Set up search box: @@ -22,13 +22,13 @@ 'filterList' => $this->params->getFilterList(true), 'hasDefaultsApplied' => $this->params->hasDefaultsApplied(), 'selectedShards' => $this->params->getSelectedShards(), - 'ignoreHiddenFiltersInRequest' => isset($this->ignoreHiddenFiltersInRequest) ? $this->ignoreHiddenFiltersInRequest : false, - 'ignoreHiddenFilterMemory' => isset($this->ignoreHiddenFilterMemory) ? $this->ignoreHiddenFilterMemory : false, + 'ignoreHiddenFiltersInRequest' => $this->ignoreHiddenFiltersInRequest ?? false, + 'ignoreHiddenFilterMemory' => $this->ignoreHiddenFilterMemory ?? false, ] ); // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li class="active">' . $this->escapeHtml($headTitle) . '</li>'; + $this->layout()->breadcrumbs .= '<li class="active">' . $this->escapeHtml($headTitle) . '</li>'; // Enable cart if appropriate: $this->showBulkOptions = $this->params->getOptions()->supportsCart() && $this->showBulkOptions; @@ -38,17 +38,14 @@ // Enable bulk options if appropriate: $this->showCheckboxes = $this->showCartControls || $this->showBulkOptions; - // Load Javascript only if list view parameter is NOT full: - if ($this->params->getOptions()->getListViewOption() != "full") { - $this->headScript()->appendFile("record.js"); - $this->headScript()->appendFile("embedded_record.js"); + $this->render('search/results-scripts.phtml', ['displayVersions' => !empty($this->params->getOptions()->getVersionsAction())]); + + // Load only if list view parameter is NOT full: + if ($this->params->getOptions()->getListViewOption() !== 'full') { + $this->headScript()->appendFile("record.js"); + $this->headScript()->appendFile("embedded_record.js"); } - // Load Javascript dependencies into header: - $this->headScript()->appendFile("vendor/hunt.min.js"); - $this->headScript()->appendFile("check_item_statuses.js"); - $this->headScript()->appendFile("check_save_statuses.js"); - // finc: make active filters available here if (!isset($this->filterList) || !isset($this->checkboxFilters)) { $params = $this->searchMemory()->getLastSearchParams($this->searchClassId); @@ -109,7 +106,7 @@ <span class="offcanvas-toggler"> <?php /* finc: remove title, add aria-label */ ?> <?php /* finc: change href #search-sidebar to #myresearch-sidebar, #17908 */ ?> - <a class="search-filter-toggle btn btn-primary visible-xs" href="#myresearch-sidebar" data-toggle="offcanvas" aria-label="<?=$this->transEsc('sidebar_expand') ?>"> + <a class="search-filter-toggle btn btn-primary visible-xs" href="#myresearch-sidebar" data-toggle="offcanvas" aria-label="<?=$this->transEscAttr('sidebar_expand') ?>"> <?=$this->transEsc('Refine Results') ?> </a> </span> @@ -137,7 +134,13 @@ <?php if ($recordTotal < 1): ?> <p> - <?=$this->slot('empty-message')->get($this->translate('nohit_lookfor_html', ['%%lookfor%%' => $this->escapeHtml($lookfor)])); ?> + <?php + $emptyMessage = $this->slot('empty-message')->get( + $this->translate('nohit_lookfor_html', ['%%lookfor%%' => $this->escapeHtml($lookfor)]) + ); + $this->layout()->srmessage = $emptyMessage; + echo $emptyMessage; + ?> </p> <?php if (isset($this->parseError)): ?> <p class="alert alert-danger" aria-live="polite"><?=$this->transEsc('nohit_parse_error')?></p> @@ -156,28 +159,8 @@ </form> <?=$this->render('search/list-' . $this->params->getView() . '.phtml')?> <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => 'bottom_', 'formAttr' => 'search-cart-form'])?> - <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results, 'options' => isset($this->paginationOptions) ? $this->paginationOptions : []])?> - - <?php /* finc: remove searchtools #18164 *//* - <div class="searchtools hidden-print"> - <strong><?=$this->transEsc('Search Tools')?>:</strong> - <a href="<?=$this->results->getUrlQuery()->setViewParam('rss')?>"><i class="fa fa-bell" aria-hidden="true"></i> <?=$this->transEsc('Get RSS Feed')?></a> - <span class="hidden-xs hidden-sm">—</span> - <a href="<?=$this->url('search-email')?>" class="mailSearch" data-lightbox id="mailSearch<?=$this->escapeHtmlAttr($this->results->getSearchId())?>"> - <i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this Search')?> - </a> - <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> - <span class="hidden-xs hidden-sm">—</span> - <?php if (is_numeric($this->results->getSearchId())): ?> - <?php if ($this->results->isSavedSearch()): ?> - <a href="<?=$this->url('myresearch-savesearch')?>?delete=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-remove" aria-hidden="true"></i> <?=$this->transEsc('save_search_remove')?></a> - <?php else: ?> - <a href="<?=$this->url('myresearch-savesearch')?>?save=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-save" aria-hidden="true"></i> <?=$this->transEsc('save_search')?></a> - <?php endif; ?> - <?php endif; ?> - <?php endif; ?> - </div> - */ ?> + <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results, 'options' => $this->paginationOptions ?? []])?> + <?=$this->context($this)->renderInContext('search/controls/results-tools.phtml', ['results' => $this->results])?> <?php endif; ?> </div> <?php /* End Main Listing */ ?> diff --git a/themes/finc/templates/search/searchbox.phtml b/themes/finc/templates/search/searchbox.phtml index fa58a64187b..4f011e71801 100644 --- a/themes/finc/templates/search/searchbox.phtml +++ b/themes/finc/templates/search/searchbox.phtml @@ -53,7 +53,7 @@ <div class="navbar-form navbar-left flip no-margin-t"> <?php $tabs = $this->context($this)->renderInContext('search/searchTabs', ['searchTabs' => $tabConfig['tabs']]); ?> <?php if (!empty($tabs)): ?><?=$tabs ?><div class="tab-content clearfix no-gutter-all"><?php endif; ?> - <p class="adv_search_terms"><?=$this->transEsc("Your search terms")?> : "<strong><?=$this->escapeHtml($this->lookfor)?></strong>"</p> + <p class="adv_search_terms"><?=$this->transEsc("Your search terms")?>: "<strong><?=$this->escapeHtml($this->lookfor)?></strong>"</p> <p class="adv_search_links"> <a href="<?=$this->url($advSearch)?>?edit=<?=$this->escapeHtmlAttr($this->searchId)?>"><?=$this->transEsc("Edit this Advanced Search")?></a> <a href="<?=$this->url($advSearch) . $hiddenFilterParams?>"><?=$this->transEsc("Start a new Advanced Search")?></a> @@ -88,13 +88,13 @@ name="lookfor" value="<?=$this->searchType !== 'advanced' ? $this->escapeHtmlAttr($this->lookfor) : ''?>" <?php if ($placeholder): ?> - placeholder="<?=$this->transEsc($placeholder) ?>" + placeholder="<?=$this->transEscAttr($placeholder) ?>" <?php endif ?> - aria-label="<?=$this->transEsc("search_terms")?>" + aria-label="<?=$this->transEscAttr("search_terms")?>" required="required" role="searchbox" /> <?php if ($handlerCount > 1): ?> - <select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false" aria-label="<?=$this->transEsc("Search type")?>"> + <select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false" aria-label="<?=$this->transEscAttr("Search type")?>"> <?php $currentGroup = $insideGroup = false; ?> <?php foreach ($handlers as $handler): ?> <?php @@ -121,10 +121,10 @@ <input type="hidden" name="type" value="<?=$this->escapeHtmlAttr($handlers[0]['value'])?>" /> <?php endif; ?> <?php /* finc adds aria-label */ ?> - <button type="submit" class="btn btn-primary" aria-label="<?=$this->transEsc("Find")?>"><i class="fa fa-search" aria-hidden="true"></i></button> + <button type="submit" class="btn btn-primary" aria-label="<?=$this->transEscAttr("Find")?>"><i class="fa fa-search" aria-hidden="true"></i></button> <?php if ($advSearch): ?> <?php /* finc: change btn-link to btn-transparent, add role, add aria-label, add i-element, add span-element */ ?> - <a href="<?=$this->url($advSearch) . (($this->searchId ?? false) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams)?>" class="btn btn-transparent" role="button" rel="nofollow" aria-label="<?=$this->transEsc("Advanced")?>"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a> + <a href="<?=$this->url($advSearch) . (($this->searchId ?? false) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams)?>" class="btn btn-transparent" role="button" rel="nofollow" aria-label="<?=$this->transEscAttr("Advanced")?>"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a> <?php endif; ?> <?php if ($geoUrl = $this->geocoords()->getSearchUrl($options)) : ?> <a href="<?=$geoUrl ?>" class="btn btn-link"><?=$this->transEsc('Geographic Search')?></a> @@ -134,8 +134,7 @@ <div class="checkbox hidden-xs"> <?php $shards = $options->getShards(); if ($options->showShardCheckboxes() && !empty($shards)): ?> <?php - $selectedShards = isset($this->selectedShards) - ? $this->selectedShards : $options->getDefaultSelectedShards(); + $selectedShards = $this->selectedShards ?? $options->getDefaultSelectedShards(); ?> <?php foreach ($shards as $shard => $val): ?> <?php $isSelected = empty($selectedShards) || in_array($shard, $selectedShards); ?> diff --git a/themes/finc/theme.config.php b/themes/finc/theme.config.php index 38d9e0eaea8..e0485ebccd6 100644 --- a/themes/finc/theme.config.php +++ b/themes/finc/theme.config.php @@ -25,7 +25,7 @@ return [ 'finc\View\Helper\Root\BranchInfo' => 'finc\View\Helper\Root\BranchInfoViewHelperFactory', 'finc\View\Helper\Root\EnhancedRenderArray' => - 'Zend\ServiceManager\Factory\InvokableFactory', + 'Laminas\ServiceManager\Factory\InvokableFactory', 'finc\View\Helper\Root\ExternalCatalogueLink' => 'finc\View\Helper\Root\ExternalCatalogueLinkHelperFactory', 'finc\View\Helper\Root\InterlibraryLoanLink' => -- GitLab