diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Factory.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Factory.php index aeb79474be070b047b9c2b4525e9eafe34b43fb7..0e25396a1ba8dc2681e64510a6221e5a65a3dac3 100644 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/Factory.php +++ b/module/VuFind/src/VuFind/View/Helper/Foundation/Factory.php @@ -19,11 +19,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @category VuFind2 + * @category VuFind * @package View_Helpers * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:developer_manual Wiki + * @link https://vufind.org/wiki/development Wiki */ namespace VuFind\View\Helper\Foundation; use Zend\ServiceManager\ServiceManager; @@ -80,4 +80,19 @@ class Factory } return new LayoutClass($left, $offcanvas); } + + /** + * Construct the Recaptcha helper. + * + * @param ServiceManager $sm Service manager. + * + * @return Recaptcha + */ + public static function getRecaptcha(ServiceManager $sm) + { + return new Recaptcha( + $sm->getServiceLocator()->get('VuFind\Recaptcha'), + $sm->getServiceLocator()->get('VuFind\Config')->get('config') + ); + } } diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Flashmessages.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Flashmessages.php index 0d3198bddc907fc54b2a9662a98ffd5deb1e72f6..3babd91f4740f54264fe8f05ed7d240a9ac3216f 100644 --- a/module/VuFind/src/VuFind/View/Helper/Foundation/Flashmessages.php +++ b/module/VuFind/src/VuFind/View/Helper/Foundation/Flashmessages.php @@ -23,7 +23,7 @@ * @package View_Helpers * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:developer_manual Wiki + * @link https://vufind.org/wiki/development Wiki */ namespace VuFind\View\Helper\Foundation; diff --git a/module/VuFind/src/VuFind/View/Helper/Foundation/Recaptcha.php b/module/VuFind/src/VuFind/View/Helper/Foundation/Recaptcha.php new file mode 100644 index 0000000000000000000000000000000000000000..66af1aab393e113be771cbdebb76f1c390c58969 --- /dev/null +++ b/module/VuFind/src/VuFind/View/Helper/Foundation/Recaptcha.php @@ -0,0 +1,54 @@ +<?php +/** + * Recaptcha view helper + * + * PHP version 5 + * + * Copyright (C) Villanova University 2016. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind + * @package View_Helpers + * @author Chris Hallberg <crhallberg@gmail.com> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +namespace VuFind\View\Helper\Foundation; + +/** + * Recaptcha view helper + * + * @category VuFind + * @package View_Helpers + * @author Chris Hallberg <crhallberg@gmail.com> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +class Recaptcha extends \VuFind\View\Helper\Root\Recaptcha +{ + /** + * Constructor + * + * @param \ZendService\Recaptcha\Recaptcha $rc Custom formatted Recaptcha + * @param \VuFind\Config $config Config object + */ + public function __construct($rc, $config) + { + $this->prefixHtml = '<div class="form-group">' . + '<div class="medium-9 columns medium-offset-3">'; + $this->suffixHtml = '</div></div>'; + parent::__construct($rc, $config); + } +} diff --git a/themes/foundation5/js/cart.js b/themes/foundation5/js/cart.js index 0c7caf18a5918a3c5e48092ee078813d217a3c6e..e1ebfc9826f27d299c43320f1d691ee4603ee65a 100644 --- a/themes/foundation5/js/cart.js +++ b/themes/foundation5/js/cart.js @@ -7,10 +7,6 @@ var _CART_COOKIE_DELIM = "\t"; var currentId,currentSource; var lastCartSubmit = false; -function updateCartCount() { - var items = getCartItems(); - $('#cartItems strong').html(items.length); -} function getCartItems() { var items = Cookies.getItem(_CART_COOKIE); if(items) { @@ -38,6 +34,11 @@ function getFullCartItems() { return full; } +function updateCartCount() { + var items = getCartItems(); + $('#cartItems strong').html(items.length); +} + function addItemToCart(id,source) { if(!source) { source = VuFind.defaultSearchBackend; diff --git a/themes/foundation5/js/check_save_statuses.js b/themes/foundation5/js/check_save_statuses.js index 8d969eaa395007754567f68d047a3337bc43175e..5c114849ed17a9fafc544c97e2727f1bdc31d557 100644 --- a/themes/foundation5/js/check_save_statuses.js +++ b/themes/foundation5/js/check_save_statuses.js @@ -1,6 +1,9 @@ -/*global htmlEncode, VuFind */ +/*global htmlEncode, VuFind, userIsLoggedIn */ function checkSaveStatuses(container) { + if (!userIsLoggedIn) { + return; + } if (typeof(container) == 'undefined') { container = $('body'); } diff --git a/themes/foundation5/js/common.js b/themes/foundation5/js/common.js index a1b6ac4929768464804fb5c3ff04bc06001cfe1d..562207c574d8e8039c7001227901f039a29af86b 100644 --- a/themes/foundation5/js/common.js +++ b/themes/foundation5/js/common.js @@ -138,39 +138,6 @@ function setupOffcanvas() { } } -function setupBacklinks() { - // Highlight previous links, grey out following - $('.backlink') - .mouseover(function() { - // Underline back - var t = $(this); - do { - t.css({'text-decoration':'underline'}); - t = t.prev(); - } while(t.length > 0); - // Mute ahead - t = $(this).next(); - do { - t.css({'color':'#999'}); - t = t.next(); - } while(t.length > 0); - }) - .mouseout(function() { - // Underline back - var t = $(this); - do { - t.css({'text-decoration':'none'}); - t = t.prev(); - } while(t.length > 0); - // Mute ahead - t = $(this).next(); - do { - t.css({'color':''}); - t = t.next(); - } while(t.length > 0); - }); -} - function setupAutocomplete() { // Search autocomplete $('.autocomplete').each(function(i, op) { @@ -261,8 +228,6 @@ function keyboardShortcuts() { $(document).ready(function() { // Setup search autocomplete setupAutocomplete(); - // Setup highlighting of backlinks - setupBacklinks(); // Off canvas setupOffcanvas(); // Keyboard shortcuts in detail view diff --git a/themes/foundation5/js/lightbox.js b/themes/foundation5/js/lightbox.js index b5822f449b398c3f869fb9544769a1e78eeddbd5..c3fb7a3adb1c44570fa8c3889c2da2638bc5f103 100644 --- a/themes/foundation5/js/lightbox.js +++ b/themes/foundation5/js/lightbox.js @@ -1,23 +1,54 @@ -/*global $, document, Event, VuFind, window */ +/*global $, document, CustomEvent, VuFind, window */ VuFind.lightbox = (function() { // State var _originalUrl = false; var _currentUrl = false; var refreshOnClose = false; // Elements - var _modal, _modalBody; + var _modal, _modalBody, _clickedButton = null; // Utilities + var _storeClickedStatus = function() { + _clickedButton = this; + }; var _html = function(html) { _modalBody.html(html); + // use _modal.foundation('reveal','reflow') for _modal.modal('handleUpdate'); _modal.foundation('reveal','reflow'); - } + }; + var _emit = function(msg, details) { + if ('undefined' == typeof details) { + details = {}; + } + document.dispatchEvent( + new CustomEvent(msg, { + detail: details, + bubbles: true, + cancelable: true + }) + ); + }; + + /** + * Reload the page without causing trouble with POST parameters while keeping hash + */ + var _refreshPage = function() { + var parts = window.location.href.split('#'); + if (typeof parts[1] === 'undefined') { + window.location.href = window.location.href; + } else { + var href = parts[0]; + // Force reload with a timestamp + href += href.indexOf('?') == -1 ? '?_=' : '&_='; + href += new Date().getTime() + '#' + parts[1]; + window.location.href = href; + } + }; // Public: Present an alert var showAlert = function(message, type) { if ('undefined' == typeof type) { type = 'info'; } - _html('<div class="alert '+type+'">'+message+'</div>\ - <button class="button small" data-dismiss="modal">close</button>'); + _html('<div class="alert '+type+'">'+message+'</div><button class="button small" data-dismiss="modal">' + VuFind.translate('close') + '</button>'); _modal.foundation('reveal','open'); }; var flashMessage = function(message, type) { @@ -26,26 +57,39 @@ VuFind.lightbox = (function() { .after('<div class="alert '+type+'">'+message+'</div>'); }; - // Update content + /** + * Update content + * + * Form data options: + * + * data-lightbox-ignore = do not submit this form in lightbox + */ var _update = function(html) { - if (!html.match) return; - // Deframe HTML - if(html.match('<!DOCTYPE html>')) { - html = $('<div>'+html+'</div>').find('.main > .container').html(); + if (!html.match) { + return; } // Isolate successes - var testDiv = $('<div>'+html+'</div>'); - var alerts = testDiv.find('.alert.success'); + var htmlDiv = $('<div>'+html+'</div>'); + var alerts = htmlDiv.find('.alert.success'); if (alerts.length > 0) { showAlert(alerts[0].innerHTML, 'success'); return; } + // Deframe HTML + if (html.match('<!DOCTYPE html>')) { + html = htmlDiv.find('.main > .container').html(); + } // Fill HTML _html(html); _modal.foundation('reveal','open'); // Attach capturing events - _modalBody.find('a').on('click', _constrainLink); - var forms = _modalBody.find('form'); + _modalBody.find('a').click(_constrainLink); + // Handle submit buttons attached to a form as well as those in a form. Store + // information about which button was clicked here as checking focused button + // doesn't work on all browsers and platforms. + _modalBody.find('[type=submit]').click(_storeClickedStatus); + + var forms = _modalBody.find('form:not([data-lightbox-ignore])'); for(var i=0;i<forms.length;i++) { $(forms[i]).on('submit', _formSubmit); } @@ -56,12 +100,14 @@ VuFind.lightbox = (function() { $('#modal').find('.checkbox-select-item').change(function() { $(this).closest('.modal-body').find('.checkbox-select-all').prop('checked', false); }); - } + }; var _xhr = false; // Public: Handle AJAX in the Lightbox var ajax = function(obj) { - if (_xhr !== false) return; + if (_xhr !== false) { + return; + } if (_originalUrl === false) { _originalUrl = obj.url; } @@ -78,24 +124,30 @@ VuFind.lightbox = (function() { _xhr.always(function() { _xhr = false; }) .done(function(html, status, jq_xhr) { if (jq_xhr.status == 205) { - // No reload since any post params would cause a prompt - window.location.href = window.location.href; + _refreshPage(); return; } if ( // Close the lightbox after deliberate login obj.method // is a form - && !html.match(/alert danger/) // skip failed logins - && (obj.url.match(/MyResearch/) // that matches login/create account - || obj.url.match(/catalogLogin/)) // catalog login for holds + && !html.match(/alert alert-danger/) // skip failed logins + && ((obj.url.match(/MyResearch/) && !obj.url.match(/Bulk/)) // that matches login/create account + || obj.url.match(/catalogLogin/)) // or catalog login for holds ) { if (_originalUrl.match(/UserLogin/) || obj.url.match(/catalogLogin/)) { - window.location.reload(); + _refreshPage(); return false; } else { VuFind.lightbox.refreshOnClose = true; + _emit('VuFind.lightbox.login', { + originalUrl: _originalUrl, + formUrl: obj.url + }); } } _update(html); + }) + .fail(function() { + showAlert(VuFind.translate('error_occurred'), 'danger'); }); return _xhr; }; @@ -103,6 +155,17 @@ VuFind.lightbox = (function() { ajax({url:_currentUrl || _originalUrl}); }; + /** + * Evaluate a callback + */ + var _evalCallback = function(callback, event, data) { + if ('function' === typeof window[callback]) { + return window[callback](event, data); + } else { + return eval('(function(event, data) {' + callback + '}())'); // inline code + } + }; + /** * Modal link data options * @@ -126,13 +189,19 @@ VuFind.lightbox = (function() { VuFind.modal('open'); return false; } - } + }; /** - * Form data options + * Handle form submission. + * + * Form data options: * * data-lightbox-onsubmit = on submit, run named function * data-lightbox-onclose = on close, run named function + * + * Submit button data options: + * + * data-lightbox-ignore = do not handle clicking this button in lightbox */ var _formSubmit = function(event) { // Gather data @@ -141,21 +210,22 @@ VuFind.lightbox = (function() { var data = $(form).serializeArray(); data.push({'name':'layout', 'value':'lightbox'}); // Return in lightbox, please // Add submit button information - var clicked = $(form).find('[type=submit]:focus'); - if(clicked.length > 0) { - var name = clicked.attr('name') ? clicked.attr('name') : 'submit'; - data.push({'name':name, 'value':clicked.attr('value') || 1}); + var submit = $(_clickedButton); + _clickedButton = null; + var buttonData = {'name':name, 'value':1}; + if (submit.length > 0) { + if (typeof submit.data('lightbox-ignore') !== 'undefined') { + return true; } + buttonData.name = submit.attr('name') || 'submit'; + buttonData.value = submit.attr('value') || 1; + } + data.push(buttonData); // Special handlers if ('undefined' !== typeof dataset) { // On submit behavior - if("string" === typeof dataset.lightboxOnsubmit) { - var ret = null; - if ("function" === typeof window[dataset.lightboxOnsubmit]) { - ret = window[dataset.lightboxOnsubmit](event, data); - } else { - ret = eval('(function(event, data) {' + dataset.lightboxOnsubmit + '}())'); // inline code - } + if ('string' === typeof dataset.lightboxOnsubmit) { + var ret = _evalCallback(dataset.lightboxOnsubmit, event, data); // return true or false to send that to the form // return null or anything else to continue to the ajax if (ret === false || ret === true) { @@ -163,14 +233,18 @@ VuFind.lightbox = (function() { } } // onclose behavior - if("string" === typeof dataset.lightboxOnclose && "function" === typeof window[dataset.lightboxOnclose]) { - document.addEventListener('VuFind.lightbox.closed', function() { - window[dataset.lightboxOnclose](); + if ('string' === typeof dataset.lightboxOnclose) { + document.addEventListener('VuFind.lightbox.closed', function(event) { + _evalCallback(dataset.lightboxOnclose, event); }, false); } } // Loading _modalBody.prepend('<i class="fa fa-spinner fa-spin right"></i>'); + // Prevent multiple submission of submit button in lightbox + if (submit.closest(_modal).length > 0) { + submit.attr('disabled', 'disabled'); + } // Get Lightbox content ajax({ url: form.action || _currentUrl, @@ -180,7 +254,7 @@ VuFind.lightbox = (function() { VuFind.modal('open'); return false; - } + }; // Public: Attach listeners to the page var bind = function(target) { @@ -193,6 +267,11 @@ VuFind.lightbox = (function() { $(target).find('form[data-lightbox]') .unbind('submit', _formSubmit) .on('submit', _formSubmit); + + // Handle submit buttons attached to a form as well as those in a form. Store + // information about which button was clicked here as checking focused button + // doesn't work on all browsers and platforms. + $('form[data-lightbox] [type=submit]').click(_storeClickedStatus); }; // Reveal @@ -219,17 +298,17 @@ VuFind.lightbox = (function() { // FNDTN "close.fndtn.reveal" equals "hide.bs.modal" _modal.on('close.fndtn.reveal', function() { if (VuFind.lightbox.refreshOnClose) { - window.location.reload(); + _refreshPage(); } - document.dispatchEvent(new Event('VuFind.lightbox.closing')); + _emit('VuFind.lightbox.closing'); }); // FNDTN "closed.fndtn.reveal" equals "hidden.bs.modal" _modal.on('closed.fndtn.reveal', function() { - document.dispatchEvent(new Event('VuFind.lightbox.closed')); VuFind.lightbox.reset(); + _emit('VuFind.lightbox.closed'); }); - VuFind.modal = function(cmd) { _modal.foundation('reveal',cmd); } + VuFind.modal = function(cmd) { _modal.foundation('reveal',cmd); }; bind(); } }; diff --git a/themes/foundation5/templates/Auth/Database/recovery.phtml b/themes/foundation5/templates/Auth/Database/recovery.phtml index 7a2503d2014faa33836dafd1fd6f54d3596706cf..547884162d3299da607c5de13ece112740ab3801 100644 --- a/themes/foundation5/templates/Auth/Database/recovery.phtml +++ b/themes/foundation5/templates/Auth/Database/recovery.phtml @@ -11,13 +11,10 @@ <input type="email" name="email" class="auto-width"/> </div> </div> -<div class="row"> - <div class="medium-9 columns medium-offset-3"> <?=$this->recaptcha()->html($this->useRecaptcha) ?> - </div> - </div> <div class="row"> <div class="medium-9 medium-offset-3 columns"> - <input class="button secondary small" name="submit" type="submit" role="button" aria-label="submit form" value="<?=$this->transEsc('Recover Account') ?>"/> + <input class="button secondary small" name="submit" type="submit" role="button" aria-label="submit form" value="<?=$this->transEsc('Recover Account') ?>"/> + </div> </div> <!-- auth - database - RECOVERY.phtml end --> \ No newline at end of file diff --git a/themes/foundation5/templates/Helpers/email-form-fields.phtml b/themes/foundation5/templates/Helpers/email-form-fields.phtml index fc64b358bef2211c07e570c3efe626853289bd85..ddb8716146c43432778f1684762bfed861cb00bf 100644 --- a/themes/foundation5/templates/Helpers/email-form-fields.phtml +++ b/themes/foundation5/templates/Helpers/email-form-fields.phtml @@ -45,11 +45,7 @@ </div> </div> <? endif ?> -<div class="row"> - <div class="medium-9 columns medium-offset-3"> - <?=$this->recaptcha()->html($this->useRecaptcha) ?> - </div> -</div> +<?=$this->recaptcha()->html($this->useRecaptcha) ?> <div class="row"> <div class="medium-9 columns medium-offset-3"> <input type="submit" class="button small" role="button" name="submit" value="<?=$this->transEsc('Send')?>"/> diff --git a/themes/foundation5/templates/Recommend/AuthorInfo.phtml b/themes/foundation5/templates/Recommend/AuthorInfo.phtml index 811b2aa2e6e275e9a1d27a7ea1181b6c71a7ed00..ae3c8c96723047caaa835edd442c2ccbf304a5e0 100644 --- a/themes/foundation5/templates/Recommend/AuthorInfo.phtml +++ b/themes/foundation5/templates/Recommend/AuthorInfo.phtml @@ -1,7 +1,7 @@ <!-- recommend - authorinfo.phtml --> <? $this->info = $this->recommend->getAuthorInfo() ?> <? if (!(empty($this->info['description']) || empty($this->info))): ?> -<div class="panel clearfix"> +<div class="wikipedia panel clearfix"> <h2><?=$this->info['name'] ?></h2> <? if (isset($this->info['image'])): ?> @@ -10,7 +10,7 @@ <?=preg_replace('/___baseurl___/', $this->url('search-results'), $this->info['description']) ?> - <a class="wikipedia" href="http://<?=$this->info['wiki_lang'] ?>.wikipedia.org/wiki/<?=$this->escapeHtmlAttr($this->info['name']/*url*/) ?>" target="new"><?=$this->transEsc('wiki_link') ?></a> + <a href="http://<?=$this->info['wiki_lang'] ?>.wikipedia.org/wiki/<?=$this->escapeHtmlAttr($this->info['name']/*url*/) ?>" target="new"><?=$this->transEsc('wiki_link') ?></a> </div> <? endif; ?> <!-- recommend - authorinfo.phtml --> \ No newline at end of file diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml index 6896968726a0f8c6f0698813672074a6b97c66df..a499ee1cb5d887820fb05cfc7832bdfeef180c09 100644 --- a/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml +++ b/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml @@ -193,13 +193,13 @@ if($loggedin = $this->auth()->isLoggedIn()) { <th><?=$this->transEsc('Subjects')?>: </th> <td> <? foreach ($subjects as $field): ?> - <div class="subjectLine" property="keywords"> + <div class="subject-line" property="keywords"> <? $subject = ''; ?> <? if(count($field) == 1) $field = explode('--', $field[0]); ?> <? $i = 0; foreach ($field as $subfield): ?> <?=($i++ == 0) ? '' : ' > '?> <? $subject = trim($subject . ' ' . $subfield); ?> - <a class="backlink" title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a> + <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a> <? endforeach; ?> </div> <? endforeach; ?> diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml index dad6bd2b5bcc73f9db7234e40f70b435ab55cbb4..90defde2d57832b6af210949b6e3ddd8167768bd 100644 --- a/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml +++ b/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml @@ -54,7 +54,7 @@ $cartId = $this->driver->getSourceIdentifier() . '|' . $id; <a class="cart-add hide <? if (!$cart->contains($cartId)): ?>correct <? endif ?>" href="#"><i class="fa fa-plus"></i> <?= $this->transEsc('Add to Book Bag') ?></a> <a class="cart-remove hide <? if ($cart->contains($cartId)): ?>correct <? endif ?>" href="#"><i class="fa fa-minus-circle"></i> <?= $this->transEsc('Remove from Book Bag') ?></a> <noscript> - <form method="post" name="addForm" action="<?= $this->url('cart-home') ?>"> + <form method="post" name="addForm" action="<?= $this->url('cart-processor') ?>"> <input type="hidden" name="ids[]" value="<?= $this->escapeHtmlAttr($cartId) ?>"/> <? if ($cart->contains($cartId)): ?> <input class="button secondary small" type="submit" name="delete" role="button" value="<?= $this->transEsc('Remove from Book Bag') ?>"/> diff --git a/themes/foundation5/templates/RecordTab/collectionlist.phtml b/themes/foundation5/templates/RecordTab/collectionlist.phtml index c305dd64f501122f430748b47e6182fc650f9bf9..3172e2e3326ee29aed350ebfa45eedfa73f76637 100644 --- a/themes/foundation5/templates/RecordTab/collectionlist.phtml +++ b/themes/foundation5/templates/RecordTab/collectionlist.phtml @@ -25,7 +25,7 @@ <?=$this->render('search/controls/sort.phtml', $searchDetails)?> </div> </div> - <form method="post" name="bulkActionForm" action="<?=$this->url('cart-home')?>"> + <form method="post" name="bulkActionForm" action="<?=$this->url('cart-searchresultsbulk')?>"> <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', $searchDetails + array('idPrefix' => ''))?> <?=$this->render('search/list-' . $results->getParams()->getView() . '.phtml', $searchDetails)?> <?=$this->paginationControl($results->getPaginator(), 'Sliding', 'search/pagination.phtml', array('results' => $results))?> diff --git a/themes/foundation5/templates/cart/cart.phtml b/themes/foundation5/templates/cart/cart.phtml index 33c03d41501c3a8679c3b526c61607b0e1762b61..5ad0c58d945b6957b1c91542c6956c3617e084bd 100644 --- a/themes/foundation5/templates/cart/cart.phtml +++ b/themes/foundation5/templates/cart/cart.phtml @@ -8,7 +8,7 @@ $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink ?> <h2><?=$this->transEsc('Book Bag') ?></h2> <?=$this->flashmessages()?> -<form action="<?=$this->url('cart-home')?>" method="post" name="cartForm" data-lightbox-onsubmit="cartFormHandler"> +<form action="<?=$this->url('cart-processor')?>" method="post" name="cartForm" data-lightbox-onsubmit="cartFormHandler"> <input type="hidden" id="dropdown_value"/> <? if (!$this->cart()->isEmpty()): ?> <div class="cart-controls clearfix hide-for-print"> diff --git a/themes/foundation5/templates/combined/results.phtml b/themes/foundation5/templates/combined/results.phtml index a90f8489a28ad39fa651f519ad7390ca1e501ca4..0b39eae30adb800c4fdc9f515421374b97e5ec54 100644 --- a/themes/foundation5/templates/combined/results.phtml +++ b/themes/foundation5/templates/combined/results.phtml @@ -48,7 +48,7 @@ $this->headLink()->appendStylesheet('combined-search.css'); ?> <?=$this->flashmessages()?> -<form method="post" name="bulkActionForm" action="<?=$this->url('cart-home')?>"> +<form method="post" name="bulkActionForm" action="<?=$this->url('cart-searchresultsbulk')?>"> <? $recs = $combinedResults->getRecommendations('top'); if (!empty($recs)): ?> <div> <? foreach ($recs as $current): ?> diff --git a/themes/foundation5/templates/layout/layout.phtml b/themes/foundation5/templates/layout/layout.phtml index 98eba830fdd1d5b72b69e6525468355424c2535b..3a064e435a13f975f834268c60e3516d0e5be9fc 100644 --- a/themes/foundation5/templates/layout/layout.phtml +++ b/themes/foundation5/templates/layout/layout.phtml @@ -35,6 +35,7 @@ 'bulk_noitems_advice' => 'bulk_noitems_advice', 'bulk_save_success' => 'bulk_save_success', 'close' => 'close', + 'error_occurred' => 'An error has occurred', 'go_to_list' => 'go_to_list', 'libphonenumber_invalid' => 'libphonenumber_invalid', 'libphonenumber_invalidcountry' => 'libphonenumber_invalidcountry', @@ -174,7 +175,7 @@ JS; <div class="modal-body"><?=$this->transEsc('Loading') ?> ...</div> <a class="close-reveal-modal" aria-label="Close"><span class="sr-only"><?=$this->transEsc('close') ?></span> ×</a> </div> -<!-- MODAL IN CASE WE NEED ONE - END --> +<!-- MODAL - END --> <div class="offcanvas-toggle" data-toggle="offcanvas"><i class="fa"></i></div> <div class="offcanvas-overlay" data-toggle="offcanvas"></div> diff --git a/themes/foundation5/templates/myresearch/account.phtml b/themes/foundation5/templates/myresearch/account.phtml index 83df41ab0fef83c97e0d3835fbc3a780e877bfde..c6c338a4498360611f4f66c241c90aa1c90f51e1 100644 --- a/themes/foundation5/templates/myresearch/account.phtml +++ b/themes/foundation5/templates/myresearch/account.phtml @@ -11,13 +11,7 @@ $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . <form method="post" name="accountForm" id="accountForm" data-abide role="form"> <?=$this->auth()->getCreateFields()?> - <? if ($this->useRecaptcha): ?> - <div class="row"> - <div class="medium-9 medium-offset-3"> - <?=$this->recaptcha()->html($this->useRecaptcha)?> - </div> - </div> - <? endif; ?> + <?=$this->recaptcha()->html($this->useRecaptcha)?> <div class="row"> <div class="medium-3 columns"> <a class="back-to-login button small" role="button" href="<?=$this->url('myresearch-userlogin')?>"><i class="fa fa-chevron-left"></i> <?=$this->transEsc('Back')?></a> diff --git a/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml b/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml index da4e8e4935cb9d0dba0dbd12924b561dbe58991b..330c7c0b38f08cb507cc0d7de4efa8ea32663cda 100644 --- a/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml +++ b/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml @@ -25,7 +25,7 @@ </li> <? endif; ?> <li> - <input class="button secondary tiny" type="submit" name="print" role="button" value="<?=$this->transEsc('Print')?>" title="<?=$this->transEsc('print_selected')?>"/> + <input class="button secondary tiny" type="submit" name="print" role="button" value="<?=$this->transEsc('Print')?>" title="<?=$this->transEsc('print_selected')?>" data-lightbox-ignore /> </li> <? if ($this->cart()->isActive()): ?> <li> diff --git a/themes/foundation5/templates/myresearch/mylist.phtml b/themes/foundation5/templates/myresearch/mylist.phtml index e3939e9e77a9f1a5e0b7d71220bfa02739067ad8..d14f4efe01e8d72a33e1d7254bc30d890254a897 100644 --- a/themes/foundation5/templates/myresearch/mylist.phtml +++ b/themes/foundation5/templates/myresearch/mylist.phtml @@ -33,7 +33,6 @@ $user = $this->auth()->isLoggedIn(); <li> <a href="<?= $this->url('editList', array('id' => $list->id))?>" class="button link" role="button" title="<?= $this->transEsc("edit_list") ?>"><i class="fa fa-edit"></i> <?= $this->transEsc("edit_list") ?> </a> </li> - <li> <a class="button link" role="button" data-dropdown="myresearch-deletelist-dd" aria-controls="myresearch-deletelist-dd" aria-expanded="false" data-options="is_hover:true;" href="<?= $this->url ('myresearch-deletelist') ?>?listID=<?= urlencode($list->id) ?>"><i class="fa fa-trash-o"></i><?=$this->transEsc("delete_list")?></a> <ul id="myresearch-deletelist-dd" class="f-dropdown" data-dropdown-content aria-hidden="true" tabindex="-1"> @@ -64,7 +63,7 @@ $user = $this->auth()->isLoggedIn(); <?= $this->render('search/controls/sort.phtml') ?> </div> </div> - <form method="post" name="bulkActionForm" action="<?= $this->url('cart-myresearchbulk') ?>"> + <form method="post" name="bulkActionForm" action="<?= $this->url('cart-myresearchbulk') ?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> <?= $this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', array('idPrefix' => '', 'list' => isset($list) ? $list : null, 'account' => $this->account)) ?> <? foreach ($this->results->getResults() as $i => $current): ?> <?= $this->record($current)->getListEntry($list, $user) ?> diff --git a/themes/foundation5/templates/myresearch/newpassword.phtml b/themes/foundation5/templates/myresearch/newpassword.phtml index ffc5790396972bbfd4841e48e9dea02ece14c693..b8747588a983883a810785e60f61c822b64c785d 100644 --- a/themes/foundation5/templates/myresearch/newpassword.phtml +++ b/themes/foundation5/templates/myresearch/newpassword.phtml @@ -25,10 +25,8 @@ <input type="hidden" value="<?=$this->escapeHtmlAttr($this->username) ?>" name="username"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->auth_method) ?>" name="auth_method"/> <?=$this->auth()->getNewPasswordForm() ?> + <?=$this->recaptcha()->html($this->useRecaptcha) ?> <div class="row"> - <div class="medium-9 columns medium-offset-3"> - <?=$this->recaptcha()->html($this->useRecaptcha) ?> - </div> <div class="medium-9 columns medium-offset-3"> <input class="button small" name="submit" type="submit" role="button" value="<?=$this->transEsc('Submit')?>" /> </div> diff --git a/themes/foundation5/templates/record/addtag.phtml b/themes/foundation5/templates/record/addtag.phtml index 0aad718c8fba40860bfb493e2e055cbe6aa55b38..0889b1e4976ba8173e4ea9d4a56161c2529f1f23 100644 --- a/themes/foundation5/templates/record/addtag.phtml +++ b/themes/foundation5/templates/record/addtag.phtml @@ -10,7 +10,7 @@ ?> <div class="record"> <h2><?=$this->transEsc('Add Tags') ?></h2> - <form method="post" name="tagRecord" data-lightbox-onclose="refreshTagList"> + <form method="post" name="tagRecord" data-lightbox-onclose="refreshTagList();"> <input type="hidden" name="submit" value="1" /> <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" /> <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" /> diff --git a/themes/foundation5/templates/record/save.phtml b/themes/foundation5/templates/record/save.phtml index c467ebbf4895ff2589e1bc6d103efd81217e50a8..d86c2815666b7195c000041d70e998e0dd82c0e1 100644 --- a/themes/foundation5/templates/record/save.phtml +++ b/themes/foundation5/templates/record/save.phtml @@ -9,7 +9,7 @@ . '<li class="active">' . $this->transEsc('Save') . '</li>'; ?> <h2><?=$this->transEsc("add_favorite_prefix") ?> <span class="title-in-heading"><?=$this->escapeHtml($this->driver->getBreadcrumb())?></span> <?=$this->transEsc("add_favorite_suffix") ?></h2> -<form id="edit-save-form" method="post" action="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" name="saveRecord" data-lightbox-onsubmit="VuFind.lightbox.refreshOnClose=true"> +<form id="edit-save-form" method="post" action="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" name="saveRecord" data-lightbox-onclose="checkSaveStatuses();"> <input type="hidden" name="submit" value="1" /> <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId()) ?>" /> <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" /> diff --git a/themes/foundation5/templates/search/history.phtml b/themes/foundation5/templates/search/history.phtml index 050c536b96263c580f255fbfab40cdeef693feee..4f25867f2ee9e44f23a81813be47a557e8757fea 100644 --- a/themes/foundation5/templates/search/history.phtml +++ b/themes/foundation5/templates/search/history.phtml @@ -12,6 +12,7 @@ <div class="row"> <div class="<?=$this->layoutClass('mainbody')?>"> + <?=$this->flashmessages()?> <? if ($saveSupported && !empty($this->saved)): ?> <h2><?=$this->transEsc("history_saved_searches")?></h2> <?=$this->context()->renderInContext('search/history-table.phtml', array('showSaved' => true));?> diff --git a/themes/foundation5/templates/search/results.phtml b/themes/foundation5/templates/search/results.phtml index 2aa8c979b0b2484b0b1eafea9431fb2c7b7a7cc7..4c79427388c2c3ca29af6f641b6605cec0d12127 100644 --- a/themes/foundation5/templates/search/results.phtml +++ b/themes/foundation5/templates/search/results.phtml @@ -100,7 +100,7 @@ $this->headScript()->appendFile("check_save_statuses.js"); <? endif; ?> <? endforeach; ?> <? else: ?> - <form method="post" name="bulkActionForm" action="<?= $this->url('cart-home') ?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> + <form method="post" name="bulkActionForm" action="<?= $this->url('cart-searchresultsbulk') ?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> <?= $this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => '')) ?> <?= $this->render('search/list-' . $this->params->getView() . '.phtml') ?> <?= $this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => 'bottom_')) ?> diff --git a/themes/foundation5/theme.config.php b/themes/foundation5/theme.config.php index 70846753a0d3eb7a800fe160fc85e906583b8f2f..49a20768044321eab18054344ad6ec90509d5084 100644 --- a/themes/foundation5/theme.config.php +++ b/themes/foundation5/theme.config.php @@ -28,6 +28,7 @@ return array( 'factories' => array( 'flashmessages' => 'VuFind\View\Helper\Foundation\Factory::getFlashmessages', 'layoutclass' => 'VuFind\View\Helper\Foundation\Factory::getLayoutClass', + 'recaptcha' => 'VuFind\View\Helper\Foundation\Factory::getRecaptcha', ), 'invokables' => array( 'highlight' => 'VuFind\View\Helper\Foundation\Highlight',