From d382d9b295ae791da83c82106dcc3e1ef2351a08 Mon Sep 17 00:00:00 2001
From: Claas Kazzer <kazzer@uni-leipzig.de>
Date: Tue, 10 Nov 2015 13:47:17 +0100
Subject: [PATCH] refs #6335: * integration of new vufind version into themes
 foundation5 and finc

---
 .../templates/RecordDriver/SolrAI/core.phtml  |   3 +-
 .../RecordDriver/SolrAI/result-list.phtml     | 195 +++++++-------
 themes/finc/templates/collection/view.phtml   |   2 +-
 themes/finc/templates/record/view.phtml       |   3 +-
 themes/foundation5/css/vudl.css               |   8 +-
 themes/foundation5/js/cart.js                 |   9 +-
 themes/foundation5/js/collection_record.js    |   6 +-
 themes/foundation5/js/common.js               | 126 ++++-----
 themes/foundation5/js/openurl.js              |  29 +-
 themes/foundation5/js/record.js               |  72 +++--
 .../Auth/AbstractBase/loginfields.phtml       |   8 +-
 .../templates/Auth/MultiILS/loginfields.phtml |   8 +-
 .../templates/Helpers/openurl.phtml           |  29 +-
 .../templates/Recommend/AuthorFacets.phtml    |   2 +-
 .../Recommend/EuropeanaResults.phtml          |   2 +-
 .../templates/Recommend/Libraryh3lp.phtml     |   1 +
 .../Recommend/OpenLibrarySubjects.phtml       |   2 +-
 .../Recommend/ResultGoogleMapAjax.phtml       |   2 +-
 .../templates/Recommend/SideFacets.phtml      | 250 +++++++++---------
 .../templates/RecordDriver/EDS/core.phtml     |   2 +-
 .../RecordDriver/Pazpar2/result-list.phtml    |   2 +-
 .../SolrDefault/collection-info.phtml         |   6 +-
 .../SolrDefault/collection-record.phtml       |   2 +-
 .../RecordDriver/SolrDefault/core.phtml       |   4 +-
 .../RecordDriver/SolrDefault/list-entry.phtml |   4 +-
 .../SolrDefault/result-grid.phtml             |   2 +-
 .../SolrDefault/result-list.phtml             | 200 +++++++-------
 .../RecordDriver/SolrDefault/toolbar.phtml    |   3 +-
 .../templates/RecordTab/holdingsils.phtml     |  13 +-
 .../templates/RecordTab/usercomments.phtml    |   2 +-
 .../templates/admin/maintenance/home.phtml    |  16 +-
 themes/foundation5/templates/admin/menu.phtml |  18 +-
 .../templates/ajax/status-full.phtml          |   9 +-
 themes/foundation5/templates/cart/cart.phtml  |   2 +-
 .../templates/collection/view.phtml           | 144 +++++-----
 .../templates/combined/results-ajax.phtml     |  26 +-
 .../templates/combined/results.phtml          |   4 +-
 .../combined/stack-distributed.phtml          |   2 +-
 .../templates/combined/stack-left.phtml       |   2 +-
 .../templates/combined/stack-right.phtml      |   2 +-
 .../templates/devtools/language.phtml         |  96 ++++---
 themes/foundation5/templates/eds/search.phtml |   1 +
 themes/foundation5/templates/header.phtml     |   4 +-
 .../templates/install/fixsslcerts.phtml       |  17 ++
 .../foundation5/templates/layout/layout.phtml |  19 +-
 .../templates/myresearch/account.phtml        |   2 +-
 .../myresearch/bulk-action-buttons.phtml      |   2 +-
 .../templates/myresearch/menu.phtml           |   3 +-
 .../templates/record/checkbox.phtml           |   4 +-
 .../templates/record/illrequest.phtml         |   7 +-
 .../foundation5/templates/record/view.phtml   | 149 ++++++-----
 .../templates/search/advanced/layout.phtml    |   3 +-
 .../templates/search/advanced/ranges.phtml    |   9 +-
 .../search/bulk-action-buttons.phtml          |   5 +-
 .../foundation5/templates/search/home.phtml   |  11 +-
 .../templates/search/pagination.phtml         |   2 +
 .../templates/search/results.phtml            |   2 +-
 .../foundation5/templates/vudl/details.phtml  | 159 +++++------
 .../foundation5/templates/vudl/record.phtml   |   1 -
 .../templates/vudl/views/audio.phtml          |   2 +-
 .../templates/vudl/views/video.phtml          |   2 +-
 themes/foundation5/theme.config.php           |  69 +++--
 62 files changed, 979 insertions(+), 812 deletions(-)
 create mode 100644 themes/foundation5/templates/Recommend/Libraryh3lp.phtml
 create mode 100644 themes/foundation5/templates/install/fixsslcerts.phtml

diff --git a/themes/finc/templates/RecordDriver/SolrAI/core.phtml b/themes/finc/templates/RecordDriver/SolrAI/core.phtml
index 9fafbf15113..19bc87d650e 100644
--- a/themes/finc/templates/RecordDriver/SolrAI/core.phtml
+++ b/themes/finc/templates/RecordDriver/SolrAI/core.phtml
@@ -230,7 +230,8 @@ if($loggedin = $this->auth()->isLoggedIn()) {
         $openUrl = $this->openUrl($this->driver, 'record');
         $openUrlActive = $openUrl->isActive();
         // Account for replace_other_urls setting
-        $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+     //   $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+      $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
       ?>
       <? if (!empty($urls) || $openUrlActive): ?>
       <tr>
diff --git a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml
index e921b76614d..bc75eb1afa4 100644
--- a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml
+++ b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml
@@ -1,101 +1,98 @@
 <!-- recordDriver - solrAI - RESULT-LIST.phtml -->
 <div class="<?=$this->driver->supportsAjaxStatus()?'ajaxItem ':''?>small-11 columns">
-    <div class="row">
-        <div>
-        <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" />
-        <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" class="hiddenSource" />
+  <div class="row">
+    <div>
+      <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" />
+      <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" class="hiddenSource" />
     </div>
-    <? $cover = $this->record($this->driver)->getCover('result-list', 'medium', $this->recordLink()->getUrl($this->driver)); ?>
-    <? if ($cover): ?>
-    <div class="small-3 medium-2 columns left">
-      <?=$cover ?>
-    </div>
-    <div class="small-6 medium-7 columns middle">
-    <? else : ?>
-    <div class="small-9 columns middle">
+    <? if ($cover = $this->record($this->driver)->getCover('result-list', 'medium', $this->recordLink()->getUrl($this->driver))): ?>
+      <div class="small-3 medium-2 columns left"><?= $cover ?></div>
     <? endif ?>
-        <div>
-            <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title">
-              <?=$this->record($this->driver)->getTitleHtml()?>
-            </a>
-        </div>
-        <div>
-            <? if($this->driver->isCollection()): ?>
+    <div class="<?=$cover ? 'small-6 medium-7' : 'small-9'?> columns middle">
+      <div>
+        <a href="<?=$this->recordLink()->getUrl($this->driver) ?>" class="title">
+          <?= $this->record($this->driver)->getTitleHtml() ?>
+        </a>
+      </div>
+
+      <div>
+        <? if ($this->driver->isCollection()): ?>
           <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary())); ?>
-            <? else: ?>
+        <? else: ?>
           <? $summAuthors = $this->driver->getCombinedAuthors(); if (!empty($summAuthors)): ?>
           <? foreach($summAuthors as $summAuthor) : ?>
-              <a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>" class="author"><?
-                $summHighlightedAuthor = $this->driver->getHighlightedAuthor();
-                echo !empty($summHighlightedAuthor)
-                    ? $this->highlight($summHighlightedAuthor)
-                    : $this->escapeHtml($summAuthor);
-              ?></a>
+            <a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>" class="author"><?
+              $summHighlightedAuthor = $this->driver->getHighlightedAuthor();
+              echo !empty($summHighlightedAuthor)
+                  ? $this->highlight($summHighlightedAuthor)
+                  : $this->escapeHtml($summAuthor);
+              ?>
+            </a>
           <? endforeach; ?>
-              <? endif; ?>
+          <? endif; ?>
 
-          <? $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublicationDates(); $placesOfPublication = $this->driver->getPlacesOfPublication(); ?>
-              <? if (!empty($journalTitle)): ?>
-                <?=!empty($summAuthor) ? '<br />' : ''?>
+          <? $journalTitle = $this->driver->getContainerTitle();
+          $summDate = $this->driver->getPublicationDates(); $placesOfPublication = $this->driver->getPlacesOfPublication(); ?>
+          <? if (!empty($journalTitle)): ?>
+            <?=!empty($summAuthor) ? '<br />' : ''?>
             <?=$this->transEsc('Published in')?>
             <? $containerID = $this->driver->getContainerRecordID(); ?>
             <? /* TODO: handle highlighting more elegantly here: */?>
-            <a href="<?=($containerID ? $this->recordLink()->getUrl("VuFind|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle) ?></a>
-                <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?>
-              <? elseif (!empty($summDate)): ?>
-                <?=!empty($summAuthor) ? '<br />' : ''?>
-                <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?>
-              <? endif; ?>
-              <? $summInCollection = $this->driver->getContainingCollections(); if (!empty($summInCollection)): ?>
-                <? foreach ($summInCollection as $collId => $collText): ?>
-                  <div>
-                    <b><?=$this->transEsc("in_collection_label")?></b>
-                    <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>">
-                      <?=$this->escapeHtml($collText)?>
-                    </a>
-                  </div>
-                <? endforeach; ?>
-              <? endif; ?>
-            <? endif; ?>
-        </div>
+            <a href="<?=($containerID ? $this->recordLink()->getUrl("VuFind|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle)?></a>
+            <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?>
+          <? elseif (!empty($summDate)): ?>
+            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?>
+          <? endif; ?>
+          <? $summInCollection = $this->driver->getContainingCollections(); if (!empty($summInCollection)): ?>
+            <? foreach ($summInCollection as $collId => $collText): ?>
+              <div>
+                <b><?=$this->transEsc("in_collection_label")?></b>
+                <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>">
+                  <?=$this->escapeHtml($collText)?>
+                </a>
+              </div>
+            <? endforeach; ?>
+          <? endif; ?>
+        <? endif; ?>
+      </div>
 
-        <? if(!$this->driver->isCollection()): ?>
-            <? if ($snippet = $this->driver->getHighlightedSnippet()): ?>
-              <? if (!empty($snippet['caption'])): ?>
-                <strong><?=$this->transEsc($snippet['caption']) ?>:</strong> ';
-              <? endif; ?>
-              <? if (!empty($snippet['snippet'])): ?>
-                <span class="quotestart">&#8220;</span>...<?=$this->highlight($snippet['snippet']) ?>...<span class="quoteend">&#8221;</span><br/>
-              <? endif; ?>
-            <? endif; ?>
+      <? if (!$this->driver->isCollection()): ?>
+        <? if ($snippet = $this->driver->getHighlightedSnippet()): ?>
+          <? if (!empty($snippet['caption'])): ?>
+            <strong><?=$this->transEsc($snippet['caption']) ?>:</strong> ';
+          <? endif; ?>
+          <? if (!empty($snippet['snippet'])): ?>
+            <span class="quotestart">&#8220;</span>...<?=$this->highlight($snippet['snippet']) ?>...<span class="quoteend">&#8221;</span><br/>
+          <? endif; ?>
         <? endif; ?>
+      <? endif; ?>
 
-    <?
+      <?
       /* Display information on duplicate records if available */
-      $dedupData = $this->driver->getDedupData();
-      if ($dedupData): ?>
+      if ($dedupData = $this->driver->getDedupData()): ?>
         <div class="dedupInformation">
           <?
-            $i = 0;
-            foreach ($dedupData as $source => $current) {
-              if (++$i == 1) {
-                ?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", array(), $source)?></a></span><?
-              } else {
-                if ($i == 2) {
-                  ?> <span class="otherSources">(<?=$this->transEsc('Other Sources')?>: <?
-                } else {
-                  ?>, <?
-                }
-                ?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", array(), $source)?></a><?
-              }
+          $i = 0;
+          foreach ($dedupData as $source => $current) {
+          if (++$i == 1) {
+            ?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", array(), $source)?></a></span><?
+          } else {
+          if ($i == 2) {
+          ?> <span class="otherSources">(<?=$this->transEsc('Other Sources')?>: <?
+            } else {
+              ?>, <?
+            }
+            ?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", array(), $source)?></a><?
+            }
             }
             if ($i > 1) {
-              ?>)</span><?
-            }?>
-         </div>
+            ?>)</span><?
+        } ?>
+        </div>
       <? endif; ?>
 
-    <div class="callnumAndLocation ajax-availability hide">
+      <div class="callnumAndLocation ajax-availability hide">
         <? if ($this->driver->supportsAjaxStatus()): ?>
           <strong class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</strong>
           <span class="callnumber ajax-availability hide">
@@ -111,26 +108,30 @@
             <strong><?=$this->transEsc('Call Number')?>:</strong> <?=$this->escapeHtml($summCallNo)?>
           <? endif; ?>
         <? endif; ?>
-    </div>
+      </div>
 
-    <? /* We need to find out if we're supposed to display an OpenURL link ($openUrlActive),
+      <? /* 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.
           */
-        $openUrl = $this->openUrl($this->driver, 'results');
-        $openUrlActive = $openUrl->isActive();
-        // Account for replace_other_urls setting
-        $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+      $openUrl = $this->openUrl($this->driver, 'results');
+      $openUrlActive = $openUrl->isActive();
+      // Account for replace_other_urls setting
+      $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
 
-        if ($openUrlActive || !empty($urls)): ?>
+      if ($openUrlActive || !empty($urls)): ?>
         <? if ($openUrlActive): ?>
           <br/>
           <?=$openUrl->renderTemplate()?>
         <? endif; ?>
         <? if (!is_array($urls)) $urls = array();
-          if(!$this->driver->isCollection()):
-            foreach ($urls as $current): ?>
-              <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"><i class="fa fa-external-link"></i> <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?></a><br/>
+        if (!$this->driver->isCollection()):
+          foreach ($urls as $current): ?>
+            <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new">
+              <i class="fa fa-external-link"></i>
+              <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?>
+            </a>
+            <br/>
           <? endforeach; ?>
         <? endif; ?>
       <? endif; ?>
@@ -149,22 +150,27 @@
       <? /* Display qrcode if appropriate: */ ?>
       <? if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?>
         <?
-          // Add JS Variables for QrCode
-          $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show'));
+        // Add JS Variables for QrCode
+        $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show'));
         ?>
         <div class="hide-for-small">
-          <i class="fa fa-fw fa-qrcode"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
-            <div class="qrcode hide">
+          <i class="fa fa-fw fa-qrcode"></i>
+          <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
+
+          <div class="qrcode hide">
             <script type="text/template" class="qrCodeImgTag">
-                <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+              <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
             </script>
-            </div><br/>
+          </div>
+          <br/>
         </div>
       <? endif; ?>
 
       <? if ($this->userlist()->getMode() !== 'disabled'): ?>
         <? /* Add to favorites */ ?>
-        <i class="fa fa-fw fa-star"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record modal-link" id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/>
+        <i class="fa fa-fw fa-star"></i>
+        <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record modal-link" id="<?=$this->driver->getUniqueId()?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a>
+        <br/>
 
         <? /* Saved lists */ ?>
         <div class="savedLists hide alert-box info" data-alert tabindex="0" aria-live="assertive" role="dialogalert">
@@ -173,7 +179,8 @@
       <? endif; ?>
 
       <? /* Hierarchy tree link */ ?>
-      <? $trees = $this->driver->tryMethod('getHierarchyTrees'); if (!empty($trees)): ?>
+      <? $trees = $this->driver->tryMethod('getHierarchyTrees');
+      if (!empty($trees)): ?>
         <? foreach ($trees as $hierarchyID => $hierarchyTitle): ?>
           <div class="hierarchyTreeLink">
             <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" />
diff --git a/themes/finc/templates/collection/view.phtml b/themes/finc/templates/collection/view.phtml
index deabcc3823a..d3c8ca59a3b 100644
--- a/themes/finc/templates/collection/view.phtml
+++ b/themes/finc/templates/collection/view.phtml
@@ -57,7 +57,7 @@
 	</div>
 
 	<? if (count($this->tabs) > 0): ?>
-	  <a name="tabnavi"></a>
+	  <a name="tabnav"></a>
 	  <ul class="recordTabs tabs"><? /*<!-- DO NOT use standard data-tab option (<ul class="recordTabs tabs" data-tab>) here as it triggers Foundation's normal tab behaviour while Vufind only uses tab appearance! FIXME CK */ ?>
 		<? foreach ($this->tabs as $tab => $obj): ?>
 		<? // add current tab to breadcrumbs if applicable:
diff --git a/themes/finc/templates/record/view.phtml b/themes/finc/templates/record/view.phtml
index 3656e1cbd95..947fcd2838e 100644
--- a/themes/finc/templates/record/view.phtml
+++ b/themes/finc/templates/record/view.phtml
@@ -51,7 +51,7 @@
 	</div>
 
 	<? if (count($this->tabs) > 0): ?>
-	  <a name="tabnavi"></a>
+	  <a name="tabnav"></a>
 	  <ul class="recordTabs tabs"><? /* DO NOT use standard data-tab option here as it triggers Foundation's normal tab behaviour while Vufind only uses tab appearance! FIXME CK */ ?>
 		<? foreach ($this->tabs as $tab => $obj): ?>
 		<? // add current tab to breadcrumbs if applicable:
@@ -59,6 +59,7 @@
 		  $tab_classes = array();
 		  if (0 === strcasecmp($this->activeTab, $tab)) {
 			$tab_classes[] = 'active';
+     $tab_classes[] = 'initiallyActive';
 			$this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>';
 			$activeTabObj = $obj;
 		  }
diff --git a/themes/foundation5/css/vudl.css b/themes/foundation5/css/vudl.css
index 0cdfd127004..afbe2b0d614 100644
--- a/themes/foundation5/css/vudl.css
+++ b/themes/foundation5/css/vudl.css
@@ -17,8 +17,8 @@
 }
 
 .panel {border:1px solid #DDD}
-.panel .panel-heading {background:#EEE} /* as far as I can see, panel-heading is no longer in use, CK */
-.panel-collapse {max-height:500px;overflow-y:auto} /* as far as I can see, panel-collapse is no longer in use, CK */
+.panel .panel-heading {background:#EEE} /* as far as I can see, panel-heading is no longer in use, fixme CK */
+.panel-collapse {max-height:500px;overflow-y:auto} /* as far as I can see, panel-collapse is no longer in use, fixme CK */
 
 .details {text-align:center}
 .details .copyright {margin-bottom:1em}
@@ -51,8 +51,8 @@
 
 #allFiles .btn {display:block;margin:auto;max-width:400px}
 #download-button .details {font-size:1rem}
-div.xml { display:block;font:10pt Courier;text-align:left;padding-left:1em } /* CHECK if still required - refers to techinfo.phtml */
-div.xml.collapsed > div { display:none;margin-left:2px } /* CHECK if still required - refers to techinfo.phtml */
+div.xml { display:block;font:10pt Courier;text-align:left;padding-left:1em } /* CHECK if still required - refers to techinfo.phtml, fixme CK */
+div.xml.collapsed > div { display:none;margin-left:2px } /* CHECK if still required - refers to techinfo.phtml, fixme CK */
 
 .fa.fa-file:before {content: "\f0f6";}
 .fa.file-audio:before {content: "\f1c7";}
diff --git a/themes/foundation5/js/cart.js b/themes/foundation5/js/cart.js
index 97b21c51faa..45d08ea0bd7 100644
--- a/themes/foundation5/js/cart.js
+++ b/themes/foundation5/js/cart.js
@@ -4,7 +4,7 @@ var _CART_COOKIE = 'vufind_cart';
 var _CART_COOKIE_SOURCES = 'vufind_cart_src';
 var _CART_COOKIE_DELIM = "\t";
 
-var currentId, currentSource;
+var currentId,currentSource;
 var lastCartSubmit = false;
 
 function getCartItems() {
@@ -203,13 +203,6 @@ $(document).ready(function () {
     Lightbox.addFormCallback('bulkEmail', function (html) {
         Lightbox.confirm(vufindString['bulk_email_success']);
     });
-    Lightbox.addFormCallback('bulkSave', function (html) {
-        // After we close the lightbox, redirect to list view
-        Lightbox.addCloseAction(function () {
-            document.location.href = path + '/MyResearch/MyList/' + Lightbox.lastPOST['list'];
-        });
-        Lightbox.confirm(vufindString['bulk_save_success']);
-    });
     $('#modal').on('closed.fndtn.reveal', function () {
         // Update cart items (add to cart, remove from cart, cart lightbox interface)
         var cartCount = $('#cartItems strong');
diff --git a/themes/foundation5/js/collection_record.js b/themes/foundation5/js/collection_record.js
index 9588c0b0022..4d4dad522ce 100644
--- a/themes/foundation5/js/collection_record.js
+++ b/themes/foundation5/js/collection_record.js
@@ -3,8 +3,12 @@ function toggleCollectionInfo() {
 }
 
 function showMoreInfoToggle() {
+  // no rows in table? don't bother!
+  if ($("#collectionInfo").find('tr').length < 1) {
+      return;
+  }
   toggleCollectionInfo();
-  $("#moreInfoToggle").removeClass('hidden');
+  $("#moreInfoToggle").removeClass('hide');
   $("#moreInfoToggle").click(function(e) {
     e.preventDefault();
     toggleCollectionInfo();
diff --git a/themes/foundation5/js/common.js b/themes/foundation5/js/common.js
index a08b9f4a733..f38687071fc 100644
--- a/themes/foundation5/js/common.js
+++ b/themes/foundation5/js/common.js
@@ -50,6 +50,9 @@ function html_entity_decode(string, quote_style)
 
 // Turn GET string into array
 function deparam(url) {
+  if(!url.match(/\?|&/)) {
+    return [];
+  }
   var request = {};
   var pairs = url.substring(url.indexOf('?') + 1).split('&');
   for (var i = 0; i < pairs.length; i++) {
@@ -115,10 +118,12 @@ function phoneNumberFormHandler(numID, regionCode) {
  * is called and the 'shown' lightbox event is triggered
  */
 function bulkActionSubmit($form) {
-  var submit = $form.find('[type="submit"][clicked=true]').attr('name');
+  var button = $form.find('[type="submit"][clicked=true]');
+  var submit = button.attr('name');
   var checks = $form.find('input.checkbox-select-item:checked');
   if(checks.length == 0 && submit != 'empty') {
-    return Lightbox.displayError(vufindString['bulk_noitems_advice']);
+    Lightbox.displayError(vufindString['bulk_noitems_advice']);
+    return false;
   }
   if (submit == 'print') {
     //redirect page
@@ -136,15 +141,13 @@ function registerLightboxEvents() {
   var modal = $("#modal");
   // New list
   $('#make-list').click(function() {
-    var parts = this.href.split('?');
-    var get = deparam(parts[1]);
+    var get = deparam(this.href);
     get['id'] = 'NEW';
     return Lightbox.get('MyResearch', 'EditList', get);
   });
   // New account link handler
   $('.createAccountLink').click(function() {
-    var parts = this.href.split('?');
-    var get = deparam(parts[1]);
+    var get = deparam(this.href);
     return Lightbox.get('MyResearch', 'Account', get);
   });
   $('.back-to-login').click(function() {
@@ -168,7 +171,7 @@ function registerLightboxEvents() {
     $(this).attr("clicked", "true");
     // Add prettiness
     if($(modal).find('.has-error,.sms-error').length == 0 && !$(this).hasClass('dropdown-toggle')) {
-    $(this).after(' <i class="fa fa-spinner fa-spin"></i> ');
+      $(this).after(' <i class="fa fa-spinner fa-spin"></i> ');
     }
   });
   /**
@@ -242,24 +245,21 @@ function ajaxLogin(form) {
       if (response.status == 'OK') {
         var salt = response.data;
 
-        // get the user entered password
-        var password = form.password.value;
-
-        // base-64 encode the password (to allow support for Unicode)
-        // and then encrypt the password with the salt
-        password = rc4Encrypt(salt, btoa(unescape(encodeURIComponent(password))));
-
-        // hex encode the encrypted password
-        password = hexEncode(password);
-
-        var params = {password:password};
-
-        // get any other form values
+        // extract form values
+        var params = {};
         for (var i = 0; i < form.length; i++) {
+          // special handling for password
           if (form.elements[i].name == 'password') {
-            continue;
+            // base-64 encode the password (to allow support for Unicode)
+            // and then encrypt the password with the salt
+            var password = rc4Encrypt(
+                salt, btoa(unescape(encodeURIComponent(form.elements[i].value)))
+            );
+            // hex encode the encrypted password
+            params[form.elements[i].name] = hexEncode(password);
+          } else {
+            params[form.elements[i].name] = form.elements[i].value;
           }
-          params[form.elements[i].name] = form.elements[i].value;
         }
 
         // login via ajax
@@ -295,8 +295,7 @@ function ajaxLogin(form) {
 }
 
 $(document).ready(function() {
-  // Off canvas
-  // fixme offcanvas - adapt if necessary - CK
+  // Off canvas - adapt if necessary - CK
   if($('.sidebar').length > 0) {
     $('[data-toggle="offcanvas"]').click(function () {
       $('body.offcanvas').toggleClass('active');
@@ -348,41 +347,44 @@ $(document).ready(function() {
     });
 
   // Search autocomplete
-  $('.autocomplete').typeahead(
-    {
-      highlight: true,
-      minLength: 3
-    }, {
-      displayKey:'val',
-      source: function(query, cb) {
-        var searcher = extractClassParams('.autocomplete');
-        $.ajax({
-          url: path + '/AJAX/JSON',
-          data: {
-            q:query,
-            method:'getACSuggestions',
-            searcher:searcher['searcher'],
-            type:$('#searchForm_type').val()
-          },
-          dataType:'json',
-          success: function(json) {
-            if (json.status == 'OK' && json.data.length > 0) {
-              var datums = [];
-              for (var i=0;i<json.data.length;i++) {
-                datums.push({val:json.data[i]});
+  $('.autocomplete').each(function (i, element) {
+    $(element).typeahead(
+      {
+        highlight: true,
+        minLength: 3
+      }, {
+        displayKey:'val',
+        source: function(query, cb) {
+          var searcher = extractClassParams(element);
+          $.ajax({
+            url: path + '/AJAX/JSON',
+            data: {
+              q:query,
+              method:'getACSuggestions',
+              searcher:searcher['searcher'],
+              type:searcher['type'] ? searcher['type'] : $(element).closest('.searchForm').find('.searchForm_type').val()
+            },
+            dataType:'json',
+            success: function(json) {
+              if (json.status == 'OK' && json.data.length > 0) {
+                var datums = [];
+                for (var i=0;i<json.data.length;i++) {
+                  datums.push({val:json.data[i]});
+                }
+                cb(datums);
+              } else {
+                cb([]);
               }
-              cb(datums);
-            } else {
-              cb([]);
             }
-          }
-        });
+          });
+        }
       }
-    }
-  );
-  $('#searchForm_type').change(function() {
-    var query = $('#searchForm_lookfor').val();
-    $('#searchForm_lookfor').focus().typeahead('val', '').typeahead('val', query);
+    );
+  });
+  $('.searchForm_type').change(function() {
+    var $lookfor = $(this).closest('.searchForm').find('.searchForm_lookfor[name]');
+    var query = $lookfor.val();
+    $lookfor.focus().typeahead('val', '').typeahead('val', query);
   });
 
   // Checkbox select all
@@ -453,6 +455,10 @@ $(document).ready(function() {
   Lightbox.addFormCallback('bulkDelete', function(html) {
     location.reload();
   });
+  Lightbox.addFormCallback('bulkSave', function(html) {
+    Lightbox.addCloseAction(updatePageForLogin);
+    Lightbox.confirm(vufindString['bulk_save_success']);
+  });
   Lightbox.addFormCallback('bulkRecord', function(html) {
     Lightbox.close();
     checkSaveStatuses();
@@ -472,8 +478,10 @@ $(document).ready(function() {
       dataType:'json',
       data:Lightbox.getFormData($(evt.target)),
       success:function(data) {
-        if(data.data.needs_redirect) {
+        if(data.data.export_type == 'download' || data.data.needs_redirect) {
           document.location.href = data.data.result_url;
+          Lightbox.close();
+          return false;
         } else {
           Lightbox.changeContent(data.data.result_additional);
         }
@@ -481,7 +489,7 @@ $(document).ready(function() {
       error:function(d,e) {
         //console.log(d,e); // Error reporting
       }
-  });
+    });
     return false;
   });
   Lightbox.addFormHandler('feedback', function(evt) {
@@ -536,4 +544,4 @@ $(document).ready(function() {
     var parts = this.href.split('/');
     return Lightbox.get(parts[parts.length-3],'Save',{id:$(this).attr('id')});
   });
-});
\ No newline at end of file
+});
diff --git a/themes/foundation5/js/openurl.js b/themes/foundation5/js/openurl.js
index 039d94ac79c..b9aa4d5cd17 100644
--- a/themes/foundation5/js/openurl.js
+++ b/themes/foundation5/js/openurl.js
@@ -18,6 +18,24 @@ function loadResolverLinks($target, openUrl) {
     });
 }
 
+function embedOpenUrlLinks(element) {
+    // Extract the OpenURL associated with the clicked element:
+    var openUrl = element.children('span.openUrl:first').attr('title');
+
+    // Hide the controls now that something has been clicked:
+    var controls = element.parents('.openUrlControls');
+    controls.removeClass('openUrlEmbed').addClass('hide');
+
+    // Locate the target area for displaying the results:
+    var target = controls.next('div.resolver');
+
+    // If the target is already visible, a previous click has populated it;
+    // don't waste time doing redundant work.
+    if (target.hasClass('hide')) {
+        loadResolverLinks(target.removeClass('hide'), openUrl);
+    }
+}
+
 $(document).ready(function() {
     // assign action to the openUrlWindow link class
     $('a.openUrlWindow').click(function(){
@@ -28,13 +46,10 @@ $(document).ready(function() {
     });
 
     // assign action to the openUrlEmbed link class
-    $('a.openUrlEmbed').click(function(){
-        var params = extractClassParams(this);
-        var openUrl = $(this).children('span.openUrl:first').attr('title');
-        $(this).hide();
-        loadResolverLinks($('#openUrlEmbed'+params.openurl_id).removeClass('hide'), openUrl);
+    $('.openUrlEmbed a').click(function() {
+        embedOpenUrlLinks($(this));
         return false;
     });
 
-    $('a.openUrlEmbed.openUrlEmbedAutoLoad').trigger("click");
-});
\ No newline at end of file
+    $('.openUrlEmbed.openUrlEmbedAutoLoad a').trigger("click");
+});
diff --git a/themes/foundation5/js/record.js b/themes/foundation5/js/record.js
index cbb913dc070..1ade72951e9 100644
--- a/themes/foundation5/js/record.js
+++ b/themes/foundation5/js/record.js
@@ -94,7 +94,7 @@ function refreshCommentList(recordId, recordSource) {
 
 function registerAjaxCommentRecord() {
   // Form submission
-  $('form[name="commentRecord"]').unbind('submit').submit(function(){
+  $('form.comment').unbind('submit').submit(function(){
     var form = this;
     var id = form.id.value;
     var recordSource = form.source.value;
@@ -110,7 +110,6 @@ function registerAjaxCommentRecord() {
       data: data,
       dataType: 'json',
       success: function(response) {
-        var form = 'form[name="commentRecord"]';
         if (response.status == 'OK') {
           refreshCommentList(id, recordSource);
           $(form).find('textarea[name="comment"]').val('');
@@ -147,15 +146,28 @@ function registerTabEvents() {
   });
 }
 
-function ajaxLoadTab(tabid) {
-  var id = $('.hiddenId')[0].value;
-  // Try to parse out the controller portion of the URL. If this fails, or if
-  // we're flagged to skip AJAX for this tab, just return true and let the
+function ajaxLoadTab(tabid, setHash) {
+  // if we're flagged to skip AJAX for this tab, just return true and let the
   // browser handle it.
-  var urlroot = document.URL.match(new RegExp('/[^/]+/'+id));
-  if(!urlroot || document.getElementById(tabid).parentNode.className.indexOf('noajax') > -1) {
+  if(document.getElementById(tabid).parentNode.className.indexOf('noajax') > -1) {
     return true;
   }
+
+  // Parse out the base URL for the current record:
+  var urlParts = document.URL.split(/[?#]/);
+  var urlWithoutFragment = urlParts[0];
+  if (path == '') {
+    // special case -- VuFind installed at site root:
+    var chunks = urlWithoutFragment.split('/');
+    var urlroot = '/' + chunks[3] + '/' + chunks[4];
+  } else {
+    // standard case -- VuFind has its own path under site:
+    var pathInUrl = urlWithoutFragment.indexOf(path);
+    var chunks = urlWithoutFragment.substring(pathInUrl + path.length + 1).split('/');
+    var urlroot = '/' + chunks[0] + '/' + chunks[1];
+  }
+
+  // Request the tab via AJAX:
   $.ajax({
     url: path + urlroot + '/AjaxTab',
     type: 'POST',
@@ -163,11 +175,15 @@ function ajaxLoadTab(tabid) {
     success: function(data) {
       $('#record-tabs .content.active').removeClass('active');
       $('#'+tabid+'-tab').html(data).addClass('active');
-      $('#'+tabid).tab('show');
+      $('.tab-title').removeClass('active');
+      $('#'+tabid).parent().addClass('active');
       registerTabEvents();
       if(typeof syn_get_widget === "function") {
         syn_get_widget();
       }
+      if (typeof setHash == 'undefined' || setHash) {
+        window.location.hash = tabid;
+      }
     }
   });
   return false;
@@ -186,7 +202,7 @@ function refreshTagList(loggedin) {
       url: url,
       complete: function(response) {
         if(response.status == 200) {
-          tagList.html(response.responseText);
+          tagList.replaceWith(response.responseText);
           if(loggedin) {
             $('#tagList').addClass('loggedin');
           } else {
@@ -217,6 +233,23 @@ function ajaxTagUpdate(tag, remove) {
   });
 }
 
+function applyRecordTabHash()
+{
+  var activeTab = $('ul.recordTabs li.active a').attr('id');
+  var initiallyActiveTab = $('ul.recordTabs li.initiallyActive a').attr('id');
+  var newTab = typeof window.location.hash !== 'undefined'
+    ? window.location.hash.toLowerCase() : '';
+
+  // Open tag in url hash
+  if (newTab.length == 0 || newTab == '#tabnav') {
+    $('#' + initiallyActiveTab).click();
+  } else if (newTab.length > 0 && '#' + activeTab != newTab) {
+    $(newTab).click();
+  }
+}
+
+$(window).on('hashchange', applyRecordTabHash);
+
 $(document).ready(function(){
   var id = $('.hiddenId')[0].value;
   registerTabEvents();
@@ -226,12 +259,21 @@ $(document).ready(function(){
       return true;
     }
     var tabid = $(this).attr('id').toLowerCase();
-    $('#record-tabs').append('<div class="content" id="'+tabid+'-tab"><i class="fa fa-spinner fa-spin"></i> '+vufindString['loading']+'&nbsp;...</div>');
-    $('#record-tabs .content.active').removeClass('active');
-    $('#'+tabid+'-tab').addClass('active');
-    $('#'+tabid).tab('show');
-    return ajaxLoadTab(tabid);
+    if($('#'+tabid+'-tab').length > 0) {
+      $('#record-tabs .content.active').removeClass('active');
+      $('#'+tabid+'-tab').addClass('active');
+      $('.tab-title').removeClass('active');
+      $('#'+tabid).parent().addClass('active');
+      window.location.hash = tabid;
+      return false;
+    } else {
+      $('#record-tabs').append('<div class="content" id="'+tabid+'-tab"><i class="fa fa-spinner fa-spin"></i> '+vufindString['loading']+'&nbsp;...</div>');
+      $('#record-tabs .content.active').removeClass('active');
+      $('#'+tabid+'-tab').addClass('active');
+      return ajaxLoadTab(tabid);
+    }
   });
+  applyRecordTabHash();
 
   /* --- LIGHTBOX --- */
   // Cite lightbox
diff --git a/themes/foundation5/templates/Auth/AbstractBase/loginfields.phtml b/themes/foundation5/templates/Auth/AbstractBase/loginfields.phtml
index cacdce95016..da213d62557 100644
--- a/themes/foundation5/templates/Auth/AbstractBase/loginfields.phtml
+++ b/themes/foundation5/templates/Auth/AbstractBase/loginfields.phtml
@@ -1,18 +1,18 @@
 <!-- auth - abstractbase - loginfields.phtml -->
 <div class="row">
   <div class="small-3 columns">
-    <label for="right-label" class="right inline" for="login_username"><?=$this->transEsc('Username')?>:</label>
+    <label for="right-label" class="right inline" for="login_<?=$this->escapeHtmlAttr($topClass)?>_username"><?=$this->transEsc('Username')?>:</label>
   </div>
   <div class="small-9 columns">
-    <input type="text" name="username" id="login_username" value="<?=$this->escapeHtmlAttr($this->request->get('username'))?>" class="auto"/>
+    <input type="text" name="username" id="login_<?=$this->escapeHtmlAttr($topClass)?>_username" value="<?=$this->escapeHtmlAttr($this->request->get('username'))?>" class="auto"/>
   </div>
 </div>
 <div class="row">
   <div class="small-3 columns">
-    <label for="right-label" class="right inline" for="login_password"><?=$this->transEsc('Password')?>:</label>
+    <label for="right-label" class="right inline"  for="login_<?=$this->escapeHtmlAttr($topClass)?>_password"><?=$this->transEsc('Password')?>:</label>
   </div>
   <div class="small-9 columns">
-    <input type="password" name="password" id="login_password" class="auto"/>
+    <input type="password" name="password" id="login_<?=$this->escapeHtmlAttr($topClass)?>_password" class="auto"/>
   </div>
 </div>
 <!-- auth - abstractbase - loginfields.phtml - END -->
\ No newline at end of file
diff --git a/themes/foundation5/templates/Auth/MultiILS/loginfields.phtml b/themes/foundation5/templates/Auth/MultiILS/loginfields.phtml
index 354dfba2b84..d961f0ed71d 100644
--- a/themes/foundation5/templates/Auth/MultiILS/loginfields.phtml
+++ b/themes/foundation5/templates/Auth/MultiILS/loginfields.phtml
@@ -11,15 +11,15 @@
   </div>
 </div>
 <div class="row">
-  <label class="medium-3 columns" for="login_username"><?=$this->transEsc('Username')?>:</label>
+  <label class="medium-3 columns" for="login_<?=$this->escapeHtmlAttr($topClass)?>_username"><?=$this->transEsc('Username')?>:</label>
   <div class="medium-9 columns">
-    <input id="login_username" type="text" name="username" value="<?=$this->escapeHtmlAttr($this->request->get('username'))?>" class="auto"/>
+    <input id="login_<?=$this->escapeHtmlAttr($topClass)?>_username" type="text" name="username" value="<?=$this->escapeHtmlAttr($this->request->get('username'))?>" class="auto"/>
   </div>
 </div>
 <div class="row">
-  <label class="medium-3 columns" for="login_password"><?=$this->transEsc('Password')?>:</label>
+  <label class="medium-3 columns" for="login_<?=$this->escapeHtmlAttr($topClass)?>_password"><?=$this->transEsc('Password')?>:</label>
   <div class="medium-9 columns">
-    <input id="login_password" type="password" name="password" class="auto"/>
+    <input id="login_<?=$this->escapeHtmlAttr($topClass)?>_password" type="password" name="password" class="auto"/>
   </div>
 </div>
 <!-- auth - multiils - loginfields.phtml - END -->
\ No newline at end of file
diff --git a/themes/foundation5/templates/Helpers/openurl.phtml b/themes/foundation5/templates/Helpers/openurl.phtml
index 1dd694fb6d9..d7950f59916 100644
--- a/themes/foundation5/templates/Helpers/openurl.phtml
+++ b/themes/foundation5/templates/Helpers/openurl.phtml
@@ -1,15 +1,21 @@
 <?
   $this->headScript()->appendFile("openurl.js");
+  $classes = '';
   if ($this->openUrlEmbed) {
-    $classes = "fulltext openUrlEmbed openurl_id:{$this->openUrlId}"
-      . ($this->openUrlEmbedAutoLoad ? ' openUrlEmbedAutoLoad' : '');
-    $class = ' class="' . $classes . '"';
+    $classes = "fulltext";
   } elseif ($this->openUrlWindow) {
-    $class = ' class="fulltext openUrlWindow window_settings:' . $this->escapeHtmlAttr($this->openUrlWindow) . '"';
+    $classes = 'fulltext openUrlWindow window_settings:' . $this->escapeHtmlAttr($this->openUrlWindow);
+  }
+  if (!empty($classes)) {
+    $class = ' class="' . $classes . '"';
+    $class_ib = ' class="imagebased ' . $classes . '"';
   } else {
-    $class = '';
+    $class = $class_ib = '';
   }
 ?>
+
+<span class="openUrlControls<? if ($this->openUrlEmbed): ?> openUrlEmbed<? if ($this->openUrlEmbedAutoLoad): ?> openUrlEmbedAutoLoad<? endif; ?><? endif; ?>">
+  <? if (!$this->openUrlImageBasedSrc || $this->openUrlImageBasedMode == 'both'): ?>
 <a href="<?=$this->escapeHtmlAttr($this->openUrlBase . '?' . $this->openUrl)?>"<?=$class?>>
   <? /* put the openUrl here in a span (COinS almost) so we can retrieve it later */ ?>
   <span title="<?=$this->escapeHtmlAttr($this->openUrl)?>" class="openUrl"></span>
@@ -28,6 +34,17 @@
     <?=$this->transEsc('Get full text')?>
   <? endif; ?>
 </a>
+  <? endif; ?>
+
+  <? if ($this->openUrlImageBasedSrc): ?>
+    <? $ibOpenUrl = $this->openUrlImageBasedOverride ? $this->openUrlImageBasedOverride : $this->openUrl; ?>
+    <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')?>" />
+    </a>
+  <? endif; ?>
+</span>
+
 <? if ($this->openUrlEmbed): ?>
-  <div id="openUrlEmbed<?=$this->openUrlId?>" class="resolver hide"><?=$this->transEsc('Loading')?>&nbsp;...</div>
+  <div class="resolver hide"><?=$this->transEsc('Loading')?>&nbsp;...</div>
 <? endif; ?>
diff --git a/themes/foundation5/templates/Recommend/AuthorFacets.phtml b/themes/foundation5/templates/Recommend/AuthorFacets.phtml
index ae5012ad879..d0499450778 100644
--- a/themes/foundation5/templates/Recommend/AuthorFacets.phtml
+++ b/themes/foundation5/templates/Recommend/AuthorFacets.phtml
@@ -3,7 +3,7 @@
   <? $similarAuthors = $this->recommend->getSimilarAuthors(); ?>
   <? if (!empty($similarAuthors['list'])): ?>
     <div class="row">
-      <p>Author Results for <strong><?=$this->escapeHtml($this->recommend->getSearchTerm()) ?></strong></p>
+      <p><?=$this->transEsc('Author Results for')?> <strong><?=$this->escapeHtml($this->recommend->getSearchTerm()) ?></strong></p>
       <div class="medium-4 columns">
       <? foreach($similarAuthors['list'] as $i => $author): ?>
         <? if ($i == 5): ?>
diff --git a/themes/foundation5/templates/Recommend/EuropeanaResults.phtml b/themes/foundation5/templates/Recommend/EuropeanaResults.phtml
index 1bb5cbe0eea..f6cb4b13584 100644
--- a/themes/foundation5/templates/Recommend/EuropeanaResults.phtml
+++ b/themes/foundation5/templates/Recommend/EuropeanaResults.phtml
@@ -22,7 +22,7 @@
       </ul>
       <p class="olSubjectMore">
         <a href="<?=$this->escapeHtmlAttr($data['sourceLink'])?>" title="<?=$this->escapeHtmlAttr($data['feedTitle'])?>" target="_blank">
-          <?=$this->transEsc('more')?>...
+          <?=$this->transEsc('more')?>&nbsp;...
         </a>
       </p>
     </div>
diff --git a/themes/foundation5/templates/Recommend/Libraryh3lp.phtml b/themes/foundation5/templates/Recommend/Libraryh3lp.phtml
new file mode 100644
index 00000000000..623feb15aaf
--- /dev/null
+++ b/themes/foundation5/templates/Recommend/Libraryh3lp.phtml
@@ -0,0 +1 @@
+<iframe src="https://us.libraryh3lp.com/chat/<?=$this->escapeHtmlAttr($this->recommend->getChatId())?>?skin=<?=urlencode($this->recommend->getSkin())?>" frameborder="1" style="border: 2px inset black; width: 350px; height: 300px;"></iframe>
\ No newline at end of file
diff --git a/themes/foundation5/templates/Recommend/OpenLibrarySubjects.phtml b/themes/foundation5/templates/Recommend/OpenLibrarySubjects.phtml
index 10bcadb1b6e..ce78085c209 100644
--- a/themes/foundation5/templates/Recommend/OpenLibrarySubjects.phtml
+++ b/themes/foundation5/templates/Recommend/OpenLibrarySubjects.phtml
@@ -25,7 +25,7 @@
   </ul>
   <p class="olSubjectMore">
     <a href="http://openlibrary.org/subjects" title="Open Library" target="_blank">
-      <?=$this->transEsc('more')?> ...
+      <?=$this->transEsc('more')?>&nbsp;...
     </a>
   </p>
 </div>
diff --git a/themes/foundation5/templates/Recommend/ResultGoogleMapAjax.phtml b/themes/foundation5/templates/Recommend/ResultGoogleMapAjax.phtml
index 4963e5c2845..1932ec1b721 100644
--- a/themes/foundation5/templates/Recommend/ResultGoogleMapAjax.phtml
+++ b/themes/foundation5/templates/Recommend/ResultGoogleMapAjax.phtml
@@ -198,7 +198,7 @@ var infowindow = new google.maps.InfoWindow({maxWidth: 480, minWidth: 480});
   <div class="mapClusterToggle" id="useCluster">
     <div class="checkbox">
       <label for="usegmm">
-        <input type="checkbox" id="usegmm" checked="true" onclick="refreshMap();"></input>
+        <input type="checkbox" id="usegmm" checked="true" onclick="refreshMap();" />
         <?=$this->transEsc('google_map_cluster_points') ?>
       </label>
     </div>
diff --git a/themes/foundation5/templates/Recommend/SideFacets.phtml b/themes/foundation5/templates/Recommend/SideFacets.phtml
index 2118244443e..4308817ce41 100644
--- a/themes/foundation5/templates/Recommend/SideFacets.phtml
+++ b/themes/foundation5/templates/Recommend/SideFacets.phtml
@@ -65,51 +65,52 @@ $rangeFacets = $this->recommend->getAllRangeFacets(); ?>
 <? if (!empty($sideFacetSet) && $results->getResultTotal() > 0): ?>
   <? foreach ($sideFacetSet as $title => $cluster): ?>
     <? $allowExclude = $this->recommend->excludeAllowed($title); ?>
+    <? $facets_before_more = $this->recommend->getShowMoreSetting($title); ?>
     <ul class="accordion" id="side-panel-<?= $this->escapeHtmlAttr($title) ?>" data-accordion>
       <li class="accordion-navigation <? if (!in_array($title, $collapsedFacets)): ?> active<? endif ?>">
         <a href="#side-collapse-<?= $this->escapeHtmlAttr($title) ?>" class="title"><?= $this->transEsc($cluster['label']) ?></a>
-
         <div id="side-collapse-<?= $this->escapeHtmlAttr($title) ?>" class="content <? if (!in_array($title, $collapsedFacets)): ?>active<? endif ?>">
           <? if (isset($rangeFacets[$title])): ?>
-            <ul class="date-range-slider">
-              <li>
-                <form name="<?= $this->escapeHtmlAttr($title) ?>Filter" id="<?= $this->escapeHtmlAttr($title) ?>Filter">
-                  <?= $results->getUrlQuery()->asHiddenFields(array('page' => "/./", 'filter' => "/^{$title}:.*/")) ?>
-                  <input type="hidden" name="<?= $this->escapeHtmlAttr($rangeFacets[$title]['type']) ?>range[]" value="<?= $this->escapeHtmlAttr($title) ?>"/>
-                  <div class="row">
-                    <? $extraInputAttribs = ($rangeFacets[$title]['type'] == 'date') ? 'maxlength="4" ' : ''; ?>
-                    <div class="medium-6 columns">
-                      <label for="<?= $this->escapeHtmlAttr($title) ?>from">
-                        <?= $this->transEsc('date_from') ?>:
-                      </label>
-                      <input type="text" name="<?= $this->escapeHtmlAttr($title) ?>from" id="<?= $this->escapeHtmlAttr($title) ?>from"
-                             value="<?= isset($rangeFacets[$title]['values'][0]) ? $this->escapeHtmlAttr($rangeFacets[$title]['values'][0]) : '' ?>" <?= $extraInputAttribs ?>/>
-                    </div>
-                    <div class="medium-6 columns">
-                      <label for="<?= $this->escapeHtmlAttr($title) ?>to">
-                        <?= $this->transEsc('date_to') ?>:
-                      </label>
-                      <input type="text" name="<?= $this->escapeHtmlAttr($title) ?>to" id="<?= $this->escapeHtmlAttr($title) ?>to"
-                             value="<?= isset($rangeFacets[$title]['values'][1]) ? $this->escapeHtmlAttr($rangeFacets[$title]['values'][1]) : '' ?>" <?= $extraInputAttribs ?>/>
-                    </div>
+          <ul class="date-range-slider">
+            <li>
+              <form name="<?= $this->escapeHtmlAttr($title) ?>Filter" id="<?= $this->escapeHtmlAttr($title) ?>Filter">
+                <?= $results->getUrlQuery()->asHiddenFields(array('page' => "/./", 'filter' => "/^{$title}:.*/")) ?>
+                <input type="hidden" name="<?= $this->escapeHtmlAttr($rangeFacets[$title]['type']) ?>range[]" value="<?= $this->escapeHtmlAttr($title) ?>"/>
+                <div class="row">
+                  <? $extraInputAttribs = ($rangeFacets[$title]['type'] == 'date') ? 'maxlength="4" ' : ''; ?>
+                  <div class="medium-6 columns">
+                    <label for="<?= $this->escapeHtmlAttr($title) ?>from">
+                      <?= $this->transEsc('date_from') ?>:
+                    </label>
+                    <input type="text" name="<?= $this->escapeHtmlAttr($title) ?>from" id="<?= $this->escapeHtmlAttr($title) ?>from"
+                           value="<?= isset($rangeFacets[$title]['values'][0]) ? $this->escapeHtmlAttr($rangeFacets[$title]['values'][0]) : '' ?>" <?= $extraInputAttribs ?>/>
                   </div>
-                  <? if ($rangeFacets[$title]['type'] == 'date'): ?>
-                    <div class="slider-container"><input type="text" class="hide" id="<?= $this->escapeHtmlAttr($title) ?><?= $this->escapeHtml($rangeFacets[$title]['type']) ?>Slider"/></div>
-                  <? endif; ?>
-                  <input class="button tiny" type="submit" role="button" value="<?= $this->transEsc('Set') ?>"/>
-                </form>
+                  <div class="medium-6 columns">
+                    <label for="<?= $this->escapeHtmlAttr($title) ?>to">
+                      <?= $this->transEsc('date_to') ?>:
+                    </label>
+                    <input type="text" name="<?= $this->escapeHtmlAttr($title) ?>to" id="<?= $this->escapeHtmlAttr($title) ?>to"
+                           value="<?= isset($rangeFacets[$title]['values'][1]) ? $this->escapeHtmlAttr($rangeFacets[$title]['values'][1]) : '' ?>" <?= $extraInputAttribs ?>/>
+                  </div>
+                </div>
+                <? if ($rangeFacets[$title]['type'] == 'date'): ?>
+                  <div class="slider-container"><input type="text" class="hide" id="<?= $this->escapeHtmlAttr($title) ?><?= $this->escapeHtml($rangeFacets[$title]['type']) ?>Slider"/></div>
+                <? endif; ?>
+                <input class="button tiny" type="submit" role="button" value="<?= $this->transEsc('Set') ?>"/>
+              </form>
               <? /* NO closing UL and LI here! - is closed below */ ?>
-            <? /* ADAPT RANGE SLIDER JS HERE AND REMOVE BootstrapSlider JS and CSS when FNDTN6 is out - FIXME CK */ ?>
-            <? if ($rangeFacets[$title]['type'] == 'date'): ?>
-              <? $this->headScript()->appendFile('vendor/bootstrap-slider.js'); ?>
-              <? $this->headLink()->appendStylesheet('vendor/bootstrap-slider.css'); ?>
-              <?
-              $min = !empty($rangeFacets[$title]['values'][0]) ? min($rangeFacets[$title]['values'][0], 1400) : 1400;
-              $future = date('Y', time() + 31536000);
-              $max = !empty($rangeFacets[$title]['values'][1]) ? max($future, $rangeFacets[$title]['values'][1]) : $future;
-              $low = !empty($rangeFacets[$title]['values'][0]) ? $rangeFacets[$title]['values'][0] : $min;
-              $high = !empty($rangeFacets[$title]['values'][1]) ? $rangeFacets[$title]['values'][1] : $max;
-              $script = <<<JS
+              <? /* ADAPT RANGE SLIDER JS HERE AND REMOVE BootstrapSlider JS and CSS when FNDTN6 is out - FIXME CK */ ?>
+              <? if ($rangeFacets[$title]['type'] == 'date'): ?>
+                <? $this->headScript()->appendFile('vendor/bootstrap-slider.js'); ?>
+                <? $this->headLink()->appendStylesheet('vendor/bootstrap-slider.css'); ?>
+                <?
+                $min = !empty($rangeFacets[$title]['values'][0]) ? min($rangeFacets[$title]['values'][0], 1400) : 1400;
+                $future = date('Y', time() + 31536000);
+                $max = !empty($rangeFacets[$title]['values'][1]) ? max($future, $rangeFacets[$title]['values'][1]) : $future;
+                $low = !empty($rangeFacets[$title]['values'][0]) ? $rangeFacets[$title]['values'][0] : $min;
+                $high = !empty($rangeFacets[$title]['values'][1]) ? $rangeFacets[$title]['values'][1] : $max;
+                $reversed = $this->layout()->rtl ? 'true' : 'false';
+                $script = <<<JS
 $(document).ready(function() {
   var fillTexts = function() {
   var v = {$this->escapeHtmlAttr($title)}dateSlider.getValue();
@@ -122,110 +123,111 @@ $(document).ready(function() {
      'max':{$max},
      'handle':"square",
      'tooltip':"hide",
-     'value':[{$low},{$high}]
+    'value':[{$low},{$high}],
+    'reversed': {$reversed}
   })
   .on('slide', fillTexts)
   .data('slider');
 });
 JS;
-              ?>
-              <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
-            <? endif; ?>
-          <? else: ?>
-        <? if (in_array($title, $hierarchicalFacets)): ?>
-        <? $this->headScript()->appendFile('vendor/jsTree/jstree.min.js'); ?>
-        <? $this->headScript()->appendFile('facets.js'); ?>
-        <? $sort = isset($hierarchicalFacetSortOptions[$title]) ? $hierarchicalFacetSortOptions[$title] : ''; ?>
-        <? if (!in_array($title, $collapsedFacets)): ?>
-          <?
-          $script = <<<JS
+                ?>
+                <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
+              <? endif; ?>
+              <? else: ?>
+              <? if (in_array($title, $hierarchicalFacets)): ?>
+              <? $this->headScript()->appendFile('vendor/jsTree/jstree.min.js'); ?>
+              <? $this->headScript()->appendFile('facets.js'); ?>
+              <? $sort = isset($hierarchicalFacetSortOptions[$title]) ? $hierarchicalFacetSortOptions[$title] : ''; ?>
+              <? if (!in_array($title, $collapsedFacets)): ?>
+                <?
+                $script = <<<JS
 $(document).ready(function() {
   initFacetTree($('#facet_{$this->escapeHtml($title)}'), true);
 });
 <? /* Verify necessity of the following JS - fixme CK */ ?>
 JS;
-          ?>
-          <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
-        <? else: ?>
-          <?
-          $script = <<<JS
+                ?>
+                <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
+              <? else: ?>
+                <?
+                $script = <<<JS
 $('#side-collapse-{$this->escapeHtmlAttr($title)}').on('show.fndtn.accordion', function() {
   initFacetTree($('#facet_{$this->escapeHtml($title)}'), true);
 });
 JS;
-          ?>
-          <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
-        <? endif; ?>
-          <li id="facet_<?= $this->escapeHtml($title) ?>" class="jstree-facet"
-              data-facet="<?= $this->escapeHtmlAttr($title) ?>"
-              data-path="<?= $this->currentPath() ?>"
-              data-exclude="<?= $allowExclude ?>"
-              data-operator="<?= $this->recommend->getFacetOperator($title) ?>"
-              data-exclude-title="<?= $this->transEsc('exclude_facet') ?>"
-              data-sort="<?= isset($hierarchicalFacetSortOptions[$title]) ? $hierarchicalFacetSortOptions[$title] : '' ?>">
-          </li>
-
-          <noscript>
-            <? endif; ?>
-            <ul class="side-nav" role="navigation">
-           <? foreach ($cluster['list'] as $i=>$thisFacet): ?>
-           <?
-             if(strlen($thisFacet['displayText']) == 0) {
-             $thisFacet['displayText'] = "-";
-              }
-           ?>
-                <? $moreClass = 'narrowGroupHidden-' . $this->escapeHtmlAttr($title) . ' hide'; ?>
-                <? if ($i == 6): ?>
-                  <li id="more-narrowGroupHidden-<?= $this->escapeHtmlAttr($title) ?>"><a href="javascript:moreFacets('narrowGroupHidden-<?= $title ?>')"><?= $this->transEsc('more') ?>&nbsp;...</a>
-                  </li>
-                <? endif; ?>
-                <? if ($thisFacet['isApplied']): ?>
-                  <li<? if ($i > 5): ?> class="<?= $moreClass ?>"<? endif ?>>
-                    <a class="active<? if ($thisFacet['operator'] == 'OR'): ?> facetOR applied<? endif ?>"
-                       href="<?= $this->currentPath() . $results->getUrlQuery()->removeFacet($title, $thisFacet['value'], true, $thisFacet['operator']) ?>">
-                      <? if ($thisFacet['operator'] == 'OR'): ?>
-                        <i class="fa fa-check-square-o"></i>
-                      <? else: ?>
-                        <span class="pull-right"><i class="fa fa-check"></i></span>
-                      <? endif; ?>
-                      <?= $this->escapeHtml($thisFacet['displayText']) ?>
-                    </a>
-                  </li>
-                <? else: ?>
-                  <? $addURL = $this->currentPath() . $results->getUrlQuery()->addFacet($title, $thisFacet['value'], $thisFacet['operator']); ?>
-                  <? if ($allowExclude): ?>
-                    <li class="facet<?= $thisFacet['operator'] ?><? if ($i > 5): ?> <?= $moreClass ?><? endif ?>">
-                  <? else: ?>
-                    <li <? if ($i > 5): ?> class="<?= $moreClass ?>"<? endif ?>><a href="<?= $addURL ?>" class="facet<?= $thisFacet['operator'] ?>">
+                ?>
+                <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
+              <? endif; ?>
+            <li id="facet_<?= $this->escapeHtml($title) ?>" class="jstree-facet"
+                data-facet="<?= $this->escapeHtmlAttr($title) ?>"
+                data-path="<?= $this->currentPath() ?>"
+                data-exclude="<?= $allowExclude ?>"
+                data-operator="<?= $this->recommend->getFacetOperator($title) ?>"
+                data-exclude-title="<?= $this->transEsc('exclude_facet') ?>"
+                data-sort="<?= isset($hierarchicalFacetSortOptions[$title]) ? $hierarchicalFacetSortOptions[$title] : '' ?>">
+            </li>
+            <noscript>
+              <? endif; ?>
+              <ul class="side-nav" role="navigation">
+                <? foreach ($cluster['list'] as $i => $thisFacet): ?>
+                  <?
+                  if (strlen($thisFacet['displayText']) == 0) {
+                    $thisFacet['displayText'] = "-";
+                  }
+                  ?>
+                  <? $moreClass = 'narrowGroupHidden-' . $this->escapeHtmlAttr($title) . ' hide'; ?>
+                  <? if ($i == $facets_before_more): ?>
+                    <li id="more-narrowGroupHidden-<?= $this->escapeHtmlAttr($title) ?>">
+                      <a href="javascript:moreFacets('narrowGroupHidden-<?= $title ?>')"><?= $this->transEsc('more') ?>&nbsp;...</a>
+                    </li>
                   <? endif; ?>
-                  <span class="label pull-right">
-                    <?= $this->localizedNumber($thisFacet['count']) ?>
+                  <? if ($thisFacet['isApplied']): ?>
+                    <li class="list-group-item active<? if ($i >= $facets_before_more): ?><?= $moreClass ?>"<? endif ?>>
+                      <a class="active <? if ($thisFacet['operator'] == 'OR'): ?> facetOR applied<? endif ?>" href="<?= $this->currentPath() . $results->getUrlQuery()->removeFacet($title, $thisFacet['value'], true, $thisFacet['operator']) ?>">
+                        <? if ($thisFacet['operator'] == 'OR'): ?>
+                          <i class="fa fa-check-square-o"></i>
+                        <? else: ?>
+                          <span class="pull-right"><i class="fa fa-check"></i></span>
+                        <? endif; ?>
+                        <?= $this->escapeHtml($thisFacet['displayText']) ?>
+                      </a>
+                    </li>
+                  <? else: ?>
+                    <? $addURL = $this->currentPath() . $results->getUrlQuery()->addFacet($title, $thisFacet['value'], $thisFacet['operator']); ?>
                     <? if ($allowExclude): ?>
-                      <a href="<?= $this->currentPath() . $results->getUrlQuery()->addFacet($title, $thisFacet['value'], 'NOT') ?>" title="<?= $this->transEsc('exclude_facet') ?>"><i class="fa fa-minus-circle"></i></a>
+                      <li class="facet<?= $thisFacet['operator'] ?><? if ($i >= $facets_before_more): ?> <?= $moreClass ?><? endif ?>">
+                    <? else: ?>
+                      <li class="<? if ($i >= $facets_before_more): ?> <?= $moreClass ?><? endif ?>">
+                        <a href="<?= $addURL ?>" class="facet<?= $thisFacet['operator'] ?>">
+                        <? endif; ?>
+                          <span class="label pull-right">
+                            <?= $this->localizedNumber($thisFacet['count']) ?>
+                            <? if ($allowExclude): ?>
+                              <a href="<?= $this->currentPath() . $results->getUrlQuery()->addFacet($title, $thisFacet['value'], 'NOT') ?>" title="<?= $this->transEsc('exclude_facet') ?>"><i class="fa fa-minus-circle"></i></a>
+                            <? endif; ?>
+                          </span>
+                    <? if ($allowExclude): ?>
+                    <a href="<?= $addURL ?>">
+                  <? endif; ?>
+                    <? if ($thisFacet['operator'] == 'OR'): ?>
+                      <i class="fa fa-square-o"></i>
                     <? endif; ?>
-                  </span>
-               <? if ($allowExclude): ?>
-               <a href="<?= $addURL ?>">
-             <? endif; ?>
-               <? if ($thisFacet['operator'] == 'OR'): ?>
-                 <i class="fa fa-square-o"></i>
-               <? endif; ?>
-               <?= $this->escapeHtml($thisFacet['displayText']) ?>
-               <? /* No <? if ($allowExclude): ?> here! - CK */ ?>
-               </a>
-               </li>
-                <? endif; ?>
-              <? endforeach; ?>
-              <? if ($i > 5): ?>
+                    <?= $this->escapeHtml($thisFacet['displayText']) ?>
+                    <? /* No <? if ($allowExclude): ?> here! - CK */ ?>
+                    </a>
+                    </li>
+                  <? endif; ?>
+                <? endforeach; ?>
+                <? if ($i > 5): ?>
                 <li class="<?= $moreClass ?>"><a href="javascript:lessFacets('narrowGroupHidden-<?= $title ?>')"><?= $this->transEsc('less') ?>&nbsp;...</a></li><? endif; ?>
-              <? endif; ?>
-            </ul><? /* /side-nav */  ?>
-            <? if (in_array($title, $hierarchicalFacets)): ?>
-          </noscript>
-        <? endif; ?>
-        </div><? /* / #side-collapse-... */ ?>
-      </li><? /* / .accordion navigation */ ?>
-    </ul><? /* / accordion */ ?>
+                <? endif; ?>
+              </ul>
+              <? if (in_array($title, $hierarchicalFacets)): ?>
+            </noscript>
+            <? endif; ?>
+        </div>
+      </li>
+    </ul>
   <? endforeach; ?>
 <? endif; ?>
 <!-- recommend - SIDEFACETS.phtml - END -->
\ No newline at end of file
diff --git a/themes/foundation5/templates/RecordDriver/EDS/core.phtml b/themes/foundation5/templates/RecordDriver/EDS/core.phtml
index 6381ae62db4..485821e00c4 100644
--- a/themes/foundation5/templates/RecordDriver/EDS/core.phtml
+++ b/themes/foundation5/templates/RecordDriver/EDS/core.phtml
@@ -19,7 +19,7 @@
       </div>
     <? endif; ?>
     <? if ($pubType): ?>
-      <p><?=$this->escapeHtml($pubType)?></p>
+      <p><?=$this->transEsc($pubType)?></p>
     <? endif; ?>
 
     <div class="external-links">
diff --git a/themes/foundation5/templates/RecordDriver/Pazpar2/result-list.phtml b/themes/foundation5/templates/RecordDriver/Pazpar2/result-list.phtml
index f5c45dfb17b..1f94d34fdc0 100644
--- a/themes/foundation5/templates/RecordDriver/Pazpar2/result-list.phtml
+++ b/themes/foundation5/templates/RecordDriver/Pazpar2/result-list.phtml
@@ -79,7 +79,7 @@
           $openUrl = $this->openUrl($this->driver, 'results');
           $openUrlActive = $openUrl->isActive();
           // Account for replace_other_urls setting
-          $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+          $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
           if ($openUrlActive || !empty($urls)): ?>
           <? if ($openUrlActive): ?>
             <br/>
diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/collection-info.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/collection-info.phtml
index 8a4de86e942..804b975d8b4 100644
--- a/themes/foundation5/templates/RecordDriver/SolrDefault/collection-info.phtml
+++ b/themes/foundation5/templates/RecordDriver/SolrDefault/collection-info.phtml
@@ -88,7 +88,7 @@
       <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?>
         <tr>
           <th><?=$this->transEsc('Language')?>: </th>
-          <td><? foreach ($langs as $lang): ?><?= $this->transEsc($lang)?><br/><? endforeach; ?></td>
+          <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang)?><br/><? endforeach; ?></td>
         </tr>
       <? endif; ?>
 
@@ -145,7 +145,7 @@
             <? $i = 0; foreach ($field as $subfield): ?>
               <?=($i++ == 0) ? '' : ' &gt; '?>
               <? $subject = trim($subject . ' ' . $subfield); ?>
-              <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" class="subjectHeading"><?=$this->escapeHtml($subfield)?></a>
+              <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" class="subjectHeading" rel="nofollow"><?=$this->escapeHtml($subfield)?></a>
             <? endforeach; ?>
           </div>
           <? endforeach; ?>
@@ -157,7 +157,7 @@
         $openUrl = $this->openUrl($this->driver, 'record');
         $openUrlActive = $openUrl->isActive();
           // Account for replace_other_urls setting
-        $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+        $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
       ?>
       <? if (!empty($urls) || $openUrlActive): ?>
       <tr>
diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/collection-record.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/collection-record.phtml
index 23605ee4e6b..b81f27a3a07 100644
--- a/themes/foundation5/templates/RecordDriver/SolrDefault/collection-record.phtml
+++ b/themes/foundation5/templates/RecordDriver/SolrDefault/collection-record.phtml
@@ -28,7 +28,7 @@
   <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?>
     <tr valign="top">
       <th><?=$this->transEsc('Language')?>: </th>
-      <td><? foreach ($langs as $lang): ?><?= $this->transEsc($lang)?><br/><? endforeach; ?></td>
+      <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang)?><br/><? endforeach; ?></td>
     </tr>
   <? endif; ?>
 
diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml
index 5a9e1189748..830f7741ae5 100644
--- a/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml
+++ b/themes/foundation5/templates/RecordDriver/SolrDefault/core.phtml
@@ -127,7 +127,7 @@ if($loggedin = $this->auth()->isLoggedIn()) {
       <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?>
         <tr>
           <th><?=$this->transEsc('Language')?>: </th>
-          <td><? foreach ($langs as $lang): ?><?= $this->transEsc($lang)?><br/><? endforeach; ?></td>
+          <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang)?><br/><? endforeach; ?></td>
         </tr>
       <? endif; ?>
 
@@ -217,7 +217,7 @@ if($loggedin = $this->auth()->isLoggedIn()) {
         $openUrl = $this->openUrl($this->driver, 'record');
         $openUrlActive = $openUrl->isActive();
         // Account for replace_other_urls setting
-        $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+        $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
       ?>
       <? if (!empty($urls) || $openUrlActive): ?>
       <tr>
diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/list-entry.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/list-entry.phtml
index 5bde1a6bcda..4c812d1e55b 100644
--- a/themes/foundation5/templates/RecordDriver/SolrDefault/list-entry.phtml
+++ b/themes/foundation5/templates/RecordDriver/SolrDefault/list-entry.phtml
@@ -131,7 +131,7 @@
         $openUrl = $this->openUrl($this->driver, 'results');
         $openUrlActive = $openUrl->isActive();
         // Account for replace_other_urls setting
-        $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+        $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
 
         if ($openUrlActive || !empty($urls)):
       ?>
@@ -175,7 +175,7 @@
         <?=$this->transEsc('Delete') ?>
       </a>
       <ul id="dLabel-dd" class="f-dropdown" role="menu" data-dropdown-content aria-hidden="true" aria-labelledby="<?=$dLabel ?>" tabindex="-1">
-        <li><a onClick="$.post('<?=$deleteUrl?>', {'delete':'<?=$this->escapeHtmlAttr($id) ?>','source':'<?=$this->escapeHtmlAttr($source) ?>','confirm':true},function(){location.reload(true)})" title="<?=$this->transEsc('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
+        <li><a onClick="$.post('<?=$deleteUrl?>', {'delete':'<?=$this->escapeJs($id) ?>','source':'<?=$this->escapeJs($source) ?>','confirm':true},function(){location.reload(true)})" title="<?=$this->transEsc('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li>
         <li><a><?=$this->transEsc('confirm_dialog_no')?></a></li>
       </ul>
     </div>
diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/result-grid.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/result-grid.phtml
index e2a13d2d56a..59b9282c154 100644
--- a/themes/foundation5/templates/RecordDriver/SolrDefault/result-grid.phtml
+++ b/themes/foundation5/templates/RecordDriver/SolrDefault/result-grid.phtml
@@ -7,7 +7,7 @@
 $openUrl = $this->openUrl($this->driver, 'results');
 $openUrlActive = $openUrl->isActive();
 // Account for replace_other_urls setting
-$urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+$urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
 ?>
 
 <div class="result <?=$this->driver->supportsAjaxStatus()?' ajaxItem':''?>">
diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/result-list.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/result-list.phtml
index abf662c62d6..1db0c0038e7 100644
--- a/themes/foundation5/templates/RecordDriver/SolrDefault/result-list.phtml
+++ b/themes/foundation5/templates/RecordDriver/SolrDefault/result-list.phtml
@@ -1,100 +1,98 @@
 <!-- recordDriver - solrDefault - RESULT-LIST.phtml -->
 <div class="<?=$this->driver->supportsAjaxStatus()?'ajaxItem ':''?>small-11 columns">
-    <div class="row">
-        <div>
-        <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" />
-        <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" class="hiddenSource" />
+  <div class="row">
+    <div>
+      <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" />
+      <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" class="hiddenSource" />
     </div>
-    <? $cover = $this->record($this->driver)->getCover('result-list', 'medium', $this->recordLink()->getUrl($this->driver)); ?>
-    <? if ($cover): ?>
-    <div class="small-3 medium-2 columns left">
-      <?=$cover ?>
-    </div>
-    <div class="small-6 medium-7 columns middle">
-    <? else : ?>
-    <div class="small-9 columns middle">
+    <? if ($cover = $this->record($this->driver)->getCover('result-list', 'medium', $this->recordLink()->getUrl($this->driver))): ?>
+      <div class="small-3 medium-2 columns left"><?= $cover ?></div>
     <? endif ?>
-        <div>
-            <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title">
-              <?=$this->record($this->driver)->getTitleHtml()?>
-            </a>
-        </div>
-        <div>
-            <? if($this->driver->isCollection()): ?>
+    <div class="<?=$cover ? 'small-6 medium-7' : 'small-9'?> columns middle">
+      <div>
+        <a href="<?=$this->recordLink()->getUrl($this->driver) ?>" class="title">
+          <?= $this->record($this->driver)->getTitleHtml() ?>
+        </a>
+      </div>
+
+      <div>
+        <? if ($this->driver->isCollection()): ?>
           <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary())); ?>
-            <? else: ?>
-              <? $summAuthor = $this->driver->getPrimaryAuthor(); if (!empty($summAuthor)): ?>
-              <?=$this->transEsc('by')?>
-              <a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>" class="author"><?
-                $summHighlightedAuthor = $this->driver->getHighlightedAuthor();
-                echo !empty($summHighlightedAuthor)
-                    ? $this->highlight($summHighlightedAuthor)
-                    : $this->escapeHtml($summAuthor);
-              ?></a>
-              <? endif; ?>
+        <? else: ?>
+          <? $summAuthor = $this->driver->getPrimaryAuthor();
+          if (!empty($summAuthor)): ?>
+            <?=$this->transEsc('by')?>
+            <a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>" class="author"><?
+              $summHighlightedAuthor = $this->driver->getHighlightedAuthor();
+              echo !empty($summHighlightedAuthor)
+                  ? $this->highlight($summHighlightedAuthor)
+                  : $this->escapeHtml($summAuthor);
+              ?>
+            </a>
+          <? endif; ?>
 
-              <? $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublicationDates(); ?>
-              <? if (!empty($journalTitle)): ?>
-                <?=!empty($summAuthor) ? '<br />' : ''?>
+          <? $journalTitle = $this->driver->getContainerTitle();
+          $summDate = $this->driver->getPublicationDates(); ?>
+          <? if (!empty($journalTitle)): ?>
+            <?=!empty($summAuthor) ? '<br />' : ''?>
             <?=$this->transEsc('Published in')?>
             <? $containerID = $this->driver->getContainerRecordID(); ?>
             <? /* TODO: handle highlighting more elegantly here: */?>
-            <a href="<?=($containerID ? $this->recordLink()->getUrl("VuFind|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle) ?></a>
-                <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?>
-              <? elseif (!empty($summDate)): ?>
-                <?=!empty($summAuthor) ? '<br />' : ''?>
-                <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate[0])?>
-              <? endif; ?>
-              <? $summInCollection = $this->driver->getContainingCollections(); if (!empty($summInCollection)): ?>
-                <? foreach ($summInCollection as $collId => $collText): ?>
-                  <div>
-                    <b><?=$this->transEsc("in_collection_label")?></b>
-                    <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>">
-                      <?=$this->escapeHtml($collText)?>
-                    </a>
-                  </div>
-                <? endforeach; ?>
-              <? endif; ?>
-            <? endif; ?>
-        </div>
+            <a href="<?=($containerID ? $this->recordLink()->getUrl("VuFind|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle)?></a>
+            <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?>
+          <? elseif (!empty($summDate)): ?>
+            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate[0])?>
+          <? endif; ?>
+          <? $summInCollection = $this->driver->getContainingCollections(); if (!empty($summInCollection)): ?>
+            <? foreach ($summInCollection as $collId => $collText): ?>
+              <div>
+                <b><?=$this->transEsc("in_collection_label")?></b>
+                <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>">
+                  <?=$this->escapeHtml($collText)?>
+                </a>
+              </div>
+            <? endforeach; ?>
+          <? endif; ?>
+        <? endif; ?>
+      </div>
 
-        <? if(!$this->driver->isCollection()): ?>
-            <? if ($snippet = $this->driver->getHighlightedSnippet()): ?>
-              <? if (!empty($snippet['caption'])): ?>
-                <strong><?=$this->transEsc($snippet['caption']) ?>:</strong> ';
-              <? endif; ?>
-              <? if (!empty($snippet['snippet'])): ?>
-                <span class="quotestart">&#8220;</span>...<?=$this->highlight($snippet['snippet']) ?>...<span class="quoteend">&#8221;</span><br/>
-              <? endif; ?>
-            <? endif; ?>
+      <? if (!$this->driver->isCollection()): ?>
+        <? if ($snippet = $this->driver->getHighlightedSnippet()): ?>
+          <? if (!empty($snippet['caption'])): ?>
+            <strong><?=$this->transEsc($snippet['caption']) ?>:</strong> ';
+          <? endif; ?>
+          <? if (!empty($snippet['snippet'])): ?>
+            <span class="quotestart">&#8220;</span>...<?=$this->highlight($snippet['snippet']) ?>...<span class="quoteend">&#8221;</span><br/>
+          <? endif; ?>
         <? endif; ?>
+      <? endif; ?>
 
-    <?
+      <?
       /* Display information on duplicate records if available */
-      $dedupData = $this->driver->getDedupData();
-      if ($dedupData): ?>
+      if ($dedupData = $this->driver->getDedupData()): ?>
         <div class="dedupInformation">
           <?
-            $i = 0;
-            foreach ($dedupData as $source => $current) {
-              if (++$i == 1) {
-                ?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", array(), $source)?></a></span><?
-              } else {
-                if ($i == 2) {
-                  ?> <span class="otherSources">(<?=$this->transEsc('Other Sources')?>: <?
-                } else {
-                  ?>, <?
-                }
-                ?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", array(), $source)?></a><?
-              }
+          $i = 0;
+          foreach ($dedupData as $source => $current) {
+          if (++$i == 1) {
+            ?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", array(), $source)?></a></span><?
+          } else {
+          if ($i == 2) {
+          ?> <span class="otherSources">(<?=$this->transEsc('Other Sources')?>: <?
+            } else {
+              ?>, <?
+            }
+            ?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", array(), $source)?></a><?
+            }
             }
             if ($i > 1) {
-              ?>)</span><?
-            }?>
-         </div>
+            ?>)</span><?
+        } ?>
+        </div>
       <? endif; ?>
 
-    <div class="callnumAndLocation ajax-availability hide">
+      <div class="callnumAndLocation ajax-availability hide">
         <? if ($this->driver->supportsAjaxStatus()): ?>
           <strong class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</strong>
           <span class="callnumber ajax-availability hide">
@@ -110,26 +108,30 @@
             <strong><?=$this->transEsc('Call Number')?>:</strong> <?=$this->escapeHtml($summCallNo)?>
           <? endif; ?>
         <? endif; ?>
-    </div>
+      </div>
 
-    <? /* We need to find out if we're supposed to display an OpenURL link ($openUrlActive),
+      <? /* 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.
           */
-        $openUrl = $this->openUrl($this->driver, 'results');
-        $openUrlActive = $openUrl->isActive();
-        // Account for replace_other_urls setting
-        $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+      $openUrl = $this->openUrl($this->driver, 'results');
+      $openUrlActive = $openUrl->isActive();
+      // Account for replace_other_urls setting
+      $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
 
-        if ($openUrlActive || !empty($urls)): ?>
+      if ($openUrlActive || !empty($urls)): ?>
         <? if ($openUrlActive): ?>
           <br/>
           <?=$openUrl->renderTemplate()?>
         <? endif; ?>
         <? if (!is_array($urls)) $urls = array();
-          if(!$this->driver->isCollection()):
-            foreach ($urls as $current): ?>
-              <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"><i class="fa fa-external-link"></i> <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?></a><br/>
+        if (!$this->driver->isCollection()):
+          foreach ($urls as $current): ?>
+            <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new">
+              <i class="fa fa-external-link"></i>
+              <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?>
+            </a>
+            <br/>
           <? endforeach; ?>
         <? endif; ?>
       <? endif; ?>
@@ -148,22 +150,27 @@
       <? /* Display qrcode if appropriate: */ ?>
       <? if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?>
         <?
-          // Add JS Variables for QrCode
-          $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show'));
+        // Add JS Variables for QrCode
+        $this->jsTranslations()->addStrings(array('qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show'));
         ?>
         <div class="hide-for-small">
-          <i class="fa fa-fw fa-qrcode"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
-            <div class="qrcode hide">
+          <i class="fa fa-fw fa-qrcode"></i>
+          <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
+
+          <div class="qrcode hide">
             <script type="text/template" class="qrCodeImgTag">
-                <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+              <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
             </script>
-            </div><br/>
+          </div>
+          <br/>
         </div>
       <? endif; ?>
 
       <? if ($this->userlist()->getMode() !== 'disabled'): ?>
         <? /* Add to favorites */ ?>
-        <i class="fa fa-fw fa-star"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record modal-link" id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/>
+        <i class="fa fa-fw fa-star"></i>
+        <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record modal-link" id="<?=$this->driver->getUniqueId()?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a>
+        <br/>
 
         <? /* Saved lists */ ?>
         <div class="savedLists hide alert-box info" data-alert tabindex="0" aria-live="assertive" role="dialogalert">
@@ -172,7 +179,8 @@
       <? endif; ?>
 
       <? /* Hierarchy tree link */ ?>
-      <? $trees = $this->driver->tryMethod('getHierarchyTrees'); if (!empty($trees)): ?>
+      <? $trees = $this->driver->tryMethod('getHierarchyTrees');
+      if (!empty($trees)): ?>
         <? foreach ($trees as $hierarchyID => $hierarchyTitle): ?>
           <div class="hierarchyTreeLink">
             <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId" />
diff --git a/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml b/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml
index e0177b723a5..c01ab00a484 100644
--- a/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml
+++ b/themes/foundation5/templates/RecordDriver/SolrDefault/toolbar.phtml
@@ -26,8 +26,7 @@ $cartId = $this->driver->getResourceSource() . '|' . $id;
     <? $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?>
     <? if (count($exportFormats) > 0): ?>
       <dd class="dropdown">
-        <a class="export-toggle" data-dropdown="exportDD" data-options="is_hover:true" href="<?= $this->recordLink()->getActionUrl($this->driver, 'Export') ?>" rel="nofollow"><i
-              class="fa fa-list-alt"></i> <?= $this->transEsc('Export Record') ?></a>
+        <a class="export-toggle" data-dropdown="exportDD" data-options="is_hover:true" href="<?= $this->recordLink()->getActionUrl($this->driver, 'Export') ?>" rel="nofollow"><i class="fa fa-list-alt"></i> <?= $this->transEsc('Export Record') ?></a>
         <ul id="exportDD" class="f-dropdown" role="menu" data-dropdown-content>
           <? foreach ($exportFormats as $exportFormat): ?>
             <li><a <? if ($this->export()->needsRedirect($exportFormat)): ?>target="<?= $this->escapeHtmlAttr($exportFormat) ?>Main"
diff --git a/themes/foundation5/templates/RecordTab/holdingsils.phtml b/themes/foundation5/templates/RecordTab/holdingsils.phtml
index b90f84e288d..6e21f004291 100644
--- a/themes/foundation5/templates/RecordTab/holdingsils.phtml
+++ b/themes/foundation5/templates/RecordTab/holdingsils.phtml
@@ -7,7 +7,7 @@
     $openUrl = $this->openUrl($this->driver, 'holdings');
     $openUrlActive = $openUrl->isActive();
     // Account for replace_other_urls setting
-    $urls = $openUrlActive ? $this->record($this->driver)->getLinkDetailsForOpenUrl() : $this->record($this->driver)->getLinkDetails() ;
+    $urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
     $offlineMode = $this->ils()->getOfflineMode();
     // Set page title.
     $this->headTitle($this->translate('Holdings') . ': ' . $this->driver->getBreadcrumb());
@@ -50,7 +50,14 @@
   <? if ($openUrlActive): ?><?=$openUrl->renderTemplate()?><? endif; ?>
 <? endif; ?>
 <? foreach ($holdings as $holding): ?>
-<h3><?=$this->transEsc('location_' . $holding['location'], array(), $holding['location'])?></h3>
+  <h3>
+    <? $locationText = $this->transEsc('location_' . $holding['location'], array(), $holding['location']); ?>
+    <? if (isset($holding['locationhref']) && $holding['locationhref']): ?>
+      <a href="<?=$holding['locationhref']?>" target="_blank"><?=$locationText?></a>
+    <? else: ?>
+      <?=$locationText?>
+    <? endif; ?>
+  </h3>
 <table class="table" summary="<?=$this->transEsc('Holdings details from')?> <?=$this->transEsc($holding['location'])?>">
   <? $callNos = $this->tab->getUniqueCallNumbers($holding['items']); if (!empty($callNos)): ?>
   <tr>
@@ -94,7 +101,7 @@
               <? /* Begin Available Items (Holds) */ ?>
                <span class="label success"><?=$this->transEsc("Available")?><link property="availability" href="http://schema.org/InStock" /></span>
               <? if (isset($row['link']) && $row['link']): ?>
-                <a style="display:inline-block" class="<?=$check ? 'checkRequest ' : ''?>inlineblock modal-link placehold hide-for-print" href="<?=$this->recordLink()->getRequestUrl($row['link'])?>" title="<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?>"><i class="fa fa-flag"></i>&nbsp;<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?></a>
+                <a class="<?=$check ? 'checkRequest ' : ''?>inlineblock modal-link placehold hide-for-print" href="<?=$this->recordLink()->getRequestUrl($row['link'])?>" title="<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?>"><i class="fa fa-flag"></i>&nbsp;<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?></a>
               <? endif; ?>
               <? if (isset($row['storageRetrievalRequestLink']) && $row['storageRetrievalRequestLink']): ?>
                 <a class="<?=$checkStorageRetrievalRequest ? 'checkStorageRetrievalRequest ' : ''?>modal-link placeStorageRetrievalRequest" href="<?=$this->recordLink()->getRequestUrl($row['storageRetrievalRequestLink'])?>" title="<?=$this->transEsc($checkStorageRetrievalRequest ? "storage_retrieval_request_check_text" : "storage_retrieval_request_place_text")?>"><i class="fa fa-flag"></i>&nbsp;<?=$this->transEsc($checkStorageRetrievalRequest ? "storage_retrieval_request_check_text" : "storage_retrieval_request_place_text")?></a>
diff --git a/themes/foundation5/templates/RecordTab/usercomments.phtml b/themes/foundation5/templates/RecordTab/usercomments.phtml
index 02a1b80ddc4..5576f18dd1c 100644
--- a/themes/foundation5/templates/RecordTab/usercomments.phtml
+++ b/themes/foundation5/templates/RecordTab/usercomments.phtml
@@ -7,7 +7,7 @@
 <div id="commentList">
   <?=$this->render('record/comments-list.phtml')?>
 </div>
-<form class="comment row" name="commentRecord" id="commentRecord" action="<?=$this->recordLink()->getActionUrl($this->driver, 'AddComment')?>" method="post">
+<form class="comment row" action="<?=$this->recordLink()->getActionUrl($this->driver, 'AddComment')?>" method="post">
   <div class="medium-3 columns name">
     <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>"/>
     <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>"/>
diff --git a/themes/foundation5/templates/admin/maintenance/home.phtml b/themes/foundation5/templates/admin/maintenance/home.phtml
index e085f42ff79..0bd9092fc0c 100644
--- a/themes/foundation5/templates/admin/maintenance/home.phtml
+++ b/themes/foundation5/templates/admin/maintenance/home.phtml
@@ -11,19 +11,14 @@
     <?=$this->flashmessages()?>
     <form method="get" action="<?=$this->url('admin/maintenance', array('action' => 'DeleteExpiredSearches'))?>">
       <label for="del_daysOld">Delete unsaved user search histories older than</label>
-      <input id="del_daysOld" type="text" name="daysOld" size="5" value="2"
-             class="auto left" />
-      days.
-      <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>"
-             class="button small"/>
+      <input id="del_daysOld" type="text" name="daysOld" size="5" value="2" class="auto left" /> days.
+      <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="button small"/>
     </form>
     <hr />
     <form method="get" action="<?=$this->url('admin/maintenance', array('action' => 'DeleteExpiredSessions'))?>">
       <label for="delsess_daysOld">Delete user sessions older than</label>
-      <input id="delsess_daysOld" type="text" name="daysOld" size="5" value="2"
-      class="auto left" /> days.
-      <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>"
-             class="button small"/>
+      <input id="delsess_daysOld" type="text" name="daysOld" size="5" value="2" class="auto left" /> days.
+      <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="button small"/>
     </form>
     <hr />
     <form method="get" action="<?=$this->url('admin/maintenance', array('action' => 'ClearCache'))?>">
@@ -35,8 +30,7 @@
         </li>
       <? endforeach; ?>
       </ul>
-      <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>"
-             class="button small"/>
+      <input type="submit" name="submit" value="<?=$this->transEsc('Submit')?>" class="button small"/>
     </form>
   </div>
 
diff --git a/themes/foundation5/templates/admin/menu.phtml b/themes/foundation5/templates/admin/menu.phtml
index de58639d6b0..668a72a98b0 100644
--- a/themes/foundation5/templates/admin/menu.phtml
+++ b/themes/foundation5/templates/admin/menu.phtml
@@ -1,28 +1,22 @@
 <!-- admin - menu.phtml -->
 <ul class="side-nav" role="navigation">
     <li>
-        <a href="<?= $this->url('admin') ?>"
-           class="<?= strtolower($this->layout()->templateName) == "home" ? ' active' : '' ?>"><?= $this->transEsc('Home') ?></a>
+        <a href="<?= $this->url('admin') ?>" class="<?= strtolower($this->layout()->templateName) == "home" ? ' active' : '' ?>"><?= $this->transEsc('Home') ?></a>
     </li>
     <li>
-        <a href="<?= $this->url('admin/social') ?>"
-           class="<?= strtolower($this->layout()->templateName) == "socialstats" ? ' active' : '' ?>"><?= $this->transEsc('Social Statistics') ?></a>
+        <a href="<?= $this->url('admin/social') ?>" class="<?= strtolower($this->layout()->templateName) == "socialstats" ? ' active' : '' ?>"><?= $this->transEsc('Social Statistics') ?></a>
     </li>
     <li>
-        <a href="<?= $this->url('admin/statistics') ?>"
-           class="<?= strtolower($this->layout()->templateName) == "statistics" ? ' active' : '' ?>"><?= $this->transEsc('Statistics') ?></a>
+        <a href="<?= $this->url('admin/statistics') ?>" class="<?= strtolower($this->layout()->templateName) == "statistics" ? ' active' : '' ?>"><?= $this->transEsc('Statistics') ?></a>
     </li>
     <li>
-        <a href="<?= $this->url('admin/config') ?>"
-           class="<?= strtolower($this->layout()->templateName) == "config" ? ' active' : '' ?>"><?= $this->transEsc('Configuration') ?></a>
+        <a href="<?= $this->url('admin/config') ?>" class="<?= strtolower($this->layout()->templateName) == "config" ? ' active' : '' ?>"><?= $this->transEsc('Configuration') ?></a>
     </li>
     <li>
-        <a href="<?= $this->url('admin/maintenance') ?>"
-           class="<?= strtolower($this->layout()->templateName) == "maintenance" ? ' active' : '' ?>"><?= $this->transEsc('System Maintenance') ?></a>
+        <a href="<?= $this->url('admin/maintenance') ?>" class="<?= strtolower($this->layout()->templateName) == "maintenance" ? ' active' : '' ?>"><?= $this->transEsc('System Maintenance') ?></a>
     </li>
     <li>
-        <a href="<?= $this->url('admin/tags') ?>"
-           class="<?= strtolower($this->layout()->templateName) == "tags" ? ' active' : '' ?>"><?= $this->transEsc('Tag Maintenance') ?></a>
+        <a href="<?= $this->url('admin/tags') ?>" class="<?= strtolower($this->layout()->templateName) == "tags" ? ' active' : '' ?>"><?= $this->transEsc('Tag Maintenance') ?></a>
     </li>
 </ul>
 <!-- admin - menu.phtml - END -->
\ No newline at end of file
diff --git a/themes/foundation5/templates/ajax/status-full.phtml b/themes/foundation5/templates/ajax/status-full.phtml
index f8ff81a5865..984fc7062ee 100644
--- a/themes/foundation5/templates/ajax/status-full.phtml
+++ b/themes/foundation5/templates/ajax/status-full.phtml
@@ -8,7 +8,14 @@
   <? $i = 0; foreach ($this->statusItems as $item): ?>
     <? if (++$i == 5) break; // Show no more than 5 items ?>
     <tr>
-      <td><?=$this->transEsc('location_' . $item['location'], array(), $item['location'])?></td>
+      <td>
+        <? $locationText = $this->transEsc('location_' . $item['location'], array(), $item['location']); ?>
+        <? if (isset($item['locationhref']) && $item['locationhref']): ?>
+          <a href="<?=$item['locationhref']?>" target="_blank"><?=$locationText?></a>
+        <? else: ?>
+          <?=$locationText?>
+        <? endif; ?>
+      </td>
       <td><?=$this->escapeHtml($item['callnumber'])?></td>
       <td>
         <? if (isset($item['use_unknown_message']) && $item['use_unknown_message']): ?>
diff --git a/themes/foundation5/templates/cart/cart.phtml b/themes/foundation5/templates/cart/cart.phtml
index ed1a319bb85..d5bc06b16c9 100644
--- a/themes/foundation5/templates/cart/cart.phtml
+++ b/themes/foundation5/templates/cart/cart.phtml
@@ -27,7 +27,7 @@
       <i class="fa fa-envelope-o"></i>
       <?=$this->transEsc('Email')?>
     </button>
-    <? $exportOptions = $this->export()->getBulkOptions(); if (count($exportOptions) > 0): ?>
+    <? $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?>
       <button type="submit" class="button secondary small" role="button" aria-label="submit form" name="export" title="<?=$this->transEsc('bookbag_export')?>" value="1">
         <i class="fa fa-list-alt"></i>
           <?=$this->transEsc('Export')?>
diff --git a/themes/foundation5/templates/collection/view.phtml b/themes/foundation5/templates/collection/view.phtml
index d3c8ca59a3b..80257b4026c 100644
--- a/themes/foundation5/templates/collection/view.phtml
+++ b/themes/foundation5/templates/collection/view.phtml
@@ -1,99 +1,103 @@
 <!-- collection - VIEW.phtml -->
 <?
   // Set up standard record scripts:
-  $this->headScript()->appendFile("record.js");
-  $this->headScript()->appendFile("check_save_statuses.js");
-  // Activate Syndetics Plus if necessary:
-  if ($this->syndeticsPlus()->isActive()) {
-	echo $this->headScript()->appendFile($this->syndeticsPlus()->getScript());
-  }
+$this->headScript()->appendFile("record.js");
+$this->headScript()->appendFile("check_save_statuses.js");
+// Activate Syndetics Plus if necessary:
+if ($this->syndeticsPlus()->isActive()) {
+  echo $this->headScript()->appendFile($this->syndeticsPlus()->getScript());
+}
 
-  // 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');
-  }
+// 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');
+}
 
-  // Set flag for special cases relating to full-width hierarchy tree tab:
-  $tree = (strtolower($this->activeTab) == 'hierarchytree');
+// Set flag for special cases relating to full-width hierarchy tree tab:
+$tree = (strtolower($this->activeTab) == 'hierarchytree');
 
-  // Set up breadcrumbs:
-  $lastSearch = $this->getLastSearchLink($this->transEsc('Search'));
-  if (!empty($lastSearch)) {
-	$this->layout()->breadcrumbs = '<li>' . $lastSearch . '</li> ';
-  }
-  $this->layout()->breadcrumbs .= '<li><a href="' . $this->url('collections-home') . '">' . $this->transEsc('Collections') . '</a></li> '
-	 . '<li class="active">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li>';
+// Set up breadcrumbs:
+$lastSearch = $this->getLastSearchLink($this->transEsc('Search'));
+if (!empty($lastSearch)) {
+  $this->layout()->breadcrumbs = '<li>' . $lastSearch . '</li> ';
+}
+$this->layout()->breadcrumbs .= '<li><a href="' . $this->url('collections-home') . '">' . $this->transEsc('Collections') . '</a></li> '
+    . '<li class="active">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li>';
 ?>
 
 <? if (isset($this->scrollData) && ($this->scrollData['previousRecord'] || $this->scrollData['nextRecord'])): ?>
   <ul class="pager">
-	<? if ($this->scrollData['previousRecord']): ?>
-	  <li>
-		<a href="<?=$this->recordLink()->getUrl($this->scrollData['previousRecord'])?>" title="<?=$this->transEsc('Previous Search Result')?>">&laquo; <?=$this->transEsc('Prev')?></a>
-	  </li>
-	<? else: ?>
-	  <li class="disabled"><a href="#">&laquo; <?=$this->transEsc('Prev')?></a></li>
-	<? endif; ?>
-    #<?=$this->localizedNumber($this->scrollData['currentPosition']) . ' ' . $this->transEsc('of') . ' ' . $this->localizedNumber($this->scrollData['resultTotal']) . ' ' . $this->transEsc('results') ?>
-	<? if ($this->scrollData['nextRecord']): ?>
-	  <li>
-		<a href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>" title="<?=$this->transEsc('Next Search Result')?>"><?=$this->transEsc('Next')?> &raquo;</a>
-	  </li>
-	<? else: ?>
-	  <li class="disabled"><a href="#"><?=$this->transEsc('Next')?> &raquo;</a></li>
-	<? endif; ?>
+    <? if ($this->scrollData['previousRecord']): ?>
+      <li>
+        <a href="<?= $this->recordLink()->getUrl($this->scrollData['previousRecord']) ?>" title="<?= $this->transEsc('Previous Search Result') ?>">&laquo; <?= $this->transEsc('Prev') ?></a>
+      </li>
+    <? else: ?>
+      <li class="disabled"><a href="#">&laquo; <?= $this->transEsc('Prev') ?></a></li>
+    <? endif; ?>
+    #<?= $this->localizedNumber($this->scrollData['currentPosition']) . ' ' . $this->transEsc('of') . ' ' . $this->localizedNumber($this->scrollData['resultTotal']) . ' ' . $this->transEsc('results') ?>
+    <? if ($this->scrollData['nextRecord']): ?>
+      <li>
+        <a href="<?= $this->recordLink()->getUrl($this->scrollData['nextRecord']) ?>" title="<?= $this->transEsc('Next Search Result') ?>"><?= $this->transEsc('Next') ?> &raquo;</a>
+      </li>
+    <? else: ?>
+      <li class="disabled"><a href="#"><?= $this->transEsc('Next') ?> &raquo;</a></li>
+    <? endif; ?>
   </ul>
 <? endif; ?>
 
-<?=$this->record($this->driver)->getToolbar()?>
+<?= $this->record($this->driver)->getToolbar() ?>
 
 <div class="row">
-  <div class="<?=$tree ? 'medium-12 columns' : $this->layoutClass('mainbody') ?>">
-	<div class="record">
-	  <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId" id="record_id" />
-	  <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" class="hiddenSource" />
-	  <?=$this->flashmessages()?>
-	  <?=$this->record($this->driver)->getCollectionMetadata()?>
-	</div>
+  <div class="<?= $tree ? 'medium-12 columns' : $this->layoutClass('mainbody') ?>">
+    <div class="record">
+      <input type="hidden" value="<?= $this->escapeHtmlAttr($this->driver->getUniqueId()) ?>" class="hiddenId" id="record_id"/>
+      <input type="hidden" value="<?= $this->escapeHtmlAttr($this->driver->getResourceSource()) ?>" class="hiddenSource"/>
+      <?= $this->flashmessages() ?>
+      <?= $this->record($this->driver)->getCollectionMetadata() ?>
+    </div>
 
-	<? if (count($this->tabs) > 0): ?>
-	  <a name="tabnav"></a>
-	  <ul class="recordTabs tabs"><? /*<!-- DO NOT use standard data-tab option (<ul class="recordTabs tabs" data-tab>) here as it triggers Foundation's normal tab behaviour while Vufind only uses tab appearance! FIXME CK */ ?>
-		<? foreach ($this->tabs as $tab => $obj): ?>
-		<? // add current tab to breadcrumbs if applicable:
-		  $desc = $obj->getDescription();
+    <? if (count($this->tabs) > 0): ?>
+      <a name="tabnav"></a>
+      <ul class="recordTabs tabs"><? /*<!-- DO NOT use standard data-tab option (<ul class="recordTabs tabs" data-tab>) here as it triggers Foundation's normal tab behaviour while Vufind only uses tab appearance! FIXME CK */ ?>
+        <? foreach ($this->tabs as $tab => $obj): ?>
+          <? // add current tab to breadcrumbs if applicable:
+          $desc = $obj->getDescription();
           $tab_classes = array();
           if (0 === strcasecmp($this->activeTab, $tab)) {
             $tab_classes[] = 'active';
-			$this->layout()->breadcrumbs .= ' <li class="active">' . $this->transEsc($desc) . '</li>';
-			$activeTabObj = $obj;
-		  }
-          if (!$obj->isVisible()) { $tab_classes[] = 'hide'; }
-          if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; }
-		?>
-        <li<?=count($tab_classes) > 0 ? ' class="tab-title ' . implode(' ', $tab_classes) . '"' : ''?>>
-          <a id="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>"><?=$this->transEsc($desc)?></a>
-		</li>
-		<? endforeach; ?>
-	  </ul>
-	<? endif; ?>
+            $this->layout()->breadcrumbs .= ' <li class="active">' . $this->transEsc($desc) . '</li>';
+            $activeTabObj = $obj;
+          }
+          if (!$obj->isVisible()) {
+            $tab_classes[] = 'hide';
+          }
+          if (!$obj->supportsAjax()) {
+            $tab_classes[] = 'noajax';
+          }
+          ?>
+          <li<?= count($tab_classes) > 0 ? ' class="tab-title ' . implode(' ', $tab_classes) . '"' : '' ?>>
+            <a id="<?= strtolower($tab) ?>" href="<?= $this->recordLink()->getTabUrl($this->driver, $tab) ?>"><?= $this->transEsc($desc) ?></a>
+          </li>
+        <? endforeach; ?>
+      </ul>
+    <? endif; ?>
 
 
-    <div class="collectionDetails<?=$tree ? 'Tree' : ''?> tabs-content" id="record-tabs">
-	    <div class="content active" id="<?=$this->activeTab ?>-tab">
-	        <?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?>
-	    </div>
+    <div class="collectionDetails<?= $tree ? 'Tree' : '' ?> tabs-content" id="record-tabs">
+      <div class="content active" id="<?= $this->activeTab ?>-tab">
+        <?= isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?>
+      </div>
     </div>
 
-	  <?=$this->driver->supportsCoinsOpenURL()?'<span class="Z3988" title="'.$this->escapeHtmlAttr($this->driver->getCoinsOpenURL()).'"></span>':''?>
+    <?= $this->driver->supportsCoinsOpenURL() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>' : '' ?>
   </div>
 
   <? if (isset($activeTabObj) && is_callable(array($activeTabObj, 'getSideRecommendations'))): ?>
-	<div class="<?=$this->layoutClass('sidebar')?>">
-	  <? foreach ($activeTabObj->getSideRecommendations() as $current): ?>
-		<?=$this->recommend($current)?>
-	  <? endforeach; ?>
-	</div>
+    <div class="<?= $this->layoutClass('sidebar') ?>">
+      <? foreach ($activeTabObj->getSideRecommendations() as $current): ?>
+        <?= $this->recommend($current) ?>
+      <? endforeach; ?>
+    </div>
   <? endif; ?>
 </div>
 <!-- collection - VIEW.phtml end -->
\ No newline at end of file
diff --git a/themes/foundation5/templates/combined/results-ajax.phtml b/themes/foundation5/templates/combined/results-ajax.phtml
index 4984c7232f0..825784a0013 100644
--- a/themes/foundation5/templates/combined/results-ajax.phtml
+++ b/themes/foundation5/templates/combined/results-ajax.phtml
@@ -1,15 +1,33 @@
 <?
+    // Make sure OpenURL support is loaded
+    $this->headScript()->appendFile("openurl.js");
+
     $view = $currentSearch['view'];
     $results = $view->results;
     $params = $results->getParams();
     $lookfor = $params->getDisplayQuery();
 
     // Set up Javascript for use below:
-    $loadJs = 'var url = path + "/Combined/Result?id=' . urlencode($searchClassId)
-        . '&lookfor=' . urlencode($lookfor) . '";'
-        . "\$('#combined_" . $this->escapeHtml($searchClassId) . "').load(url, '', function(responseText) { if (responseText.length == 0) $('#combined_" . $this->escapeHtml($searchClassId) . "').hide(); });";
+    $searchClassIdEncoded = urlencode($searchClassId);
+    $targetIdHtmlEscaped = $this->escapeHtml('#' . $currentSearch['domId']);
+    $lookforEncoded = urlencode($lookfor);
+    $loadJs = <<<JS
+$(document).ready(function(){
+    var url = path + '/Combined/Result?id=$searchClassIdEncoded&lookfor=$lookforEncoded';
+    $('$targetIdHtmlEscaped').load(url, '', function(responseText) {
+        if (responseText.length == 0) {
+            $('$targetIdHtmlEscaped').hide();
+        }
+        $('a.openUrlEmbed').click(function() {
+            embedOpenUrlLinks($(this));
+            return false;
+        });
+    });
+});
+JS;
+
 ?>
 <h2><?=$this->transEsc($currentSearch['label'])?></h2>
 <p><i class="fa fa-spinner fa-spin"></i> <?=$this->transEsc("Loading")?>&nbsp;...</p>
-<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(function(){' . $loadJs . '});', 'SET')?>
+<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $loadJs, 'SET')?>
 <noscript><?=$this->transEsc('Please enable JavaScript.')?></noscript>
diff --git a/themes/foundation5/templates/combined/results.phtml b/themes/foundation5/templates/combined/results.phtml
index 7ca709a98fa..49f400038d8 100644
--- a/themes/foundation5/templates/combined/results.phtml
+++ b/themes/foundation5/templates/combined/results.phtml
@@ -16,7 +16,7 @@
       'searchIndex' => $this->params->getSearchHandler(),
       'searchType' => $this->params->getSearchType(),
       'searchId' => $this->results->getSearchId(),
-      'searchClassId' => $this->params->getsearchClassId(),
+      'searchClassId' => $this->params->getSearchClassId(),
       'checkboxFilters' => $this->params->getCheckboxFacets(),
       'filterList' => $this->params->getFilters(),
       'hasDefaultsApplied' => $this->params->hasDefaultsApplied(),
@@ -31,7 +31,7 @@
   if (isset($this->overrideTitle)) {
     $this->layout()->breadcrumbs = '<li class="active">' . $this->escapeHtml($this->overrideTitle) . '</li>';
   } else {
-    $this->layout()->breadcrumbs = '<li class="active">' . $this->transEsc('Combined Search') . ': ' .
+    $this->layout()->breadcrumbs = '<li class="active">' . $this->transEsc('Search') . ': ' .
       $this->escapeHtml($lookfor) . '</li>';
   }
 
diff --git a/themes/foundation5/templates/combined/stack-distributed.phtml b/themes/foundation5/templates/combined/stack-distributed.phtml
index 11d30b4149c..15347364edc 100644
--- a/themes/foundation5/templates/combined/stack-distributed.phtml
+++ b/themes/foundation5/templates/combined/stack-distributed.phtml
@@ -22,7 +22,7 @@
             // Enable bulk options if appropriate:
             $viewParams['showBulkOptions'] = $this->supportsCartOptions[$columnIndex] && $this->showBulkOptions;
           ?>
-          <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
+          <div id="<?=$this->escapeHtmlAttr($currentSearch['domId'])?>">
             <? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
             <?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
           </div>
diff --git a/themes/foundation5/templates/combined/stack-left.phtml b/themes/foundation5/templates/combined/stack-left.phtml
index 27a7b165ee3..eb8b857703a 100644
--- a/themes/foundation5/templates/combined/stack-left.phtml
+++ b/themes/foundation5/templates/combined/stack-left.phtml
@@ -15,7 +15,7 @@
       // Enable bulk options if appropriate:
       $viewParams['showBulkOptions'] = $this->supportsCartOptions[$columnIndex] && $this->showBulkOptions;
     ?>
-    <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
+    <div id="<?=$this->escapeHtmlAttr($currentSearch['domId'])?>">
       <? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
       <?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
     </div>
diff --git a/themes/foundation5/templates/combined/stack-right.phtml b/themes/foundation5/templates/combined/stack-right.phtml
index 5eee60e91af..fb149f24927 100644
--- a/themes/foundation5/templates/combined/stack-right.phtml
+++ b/themes/foundation5/templates/combined/stack-right.phtml
@@ -15,7 +15,7 @@
       // Enable bulk options if appropriate:
       $viewParams['showBulkOptions'] = $this->supportsCartOptions[$columnIndex] && $this->showBulkOptions;
     ?>
-    <div id="combined_<?=$this->escapeHtmlAttr($searchClassId)?>">
+    <div id="<?=$this->escapeHtmlAttr($currentSearch['domId'])?>">
       <? $templateSuffix = (isset($currentSearch['ajax']) && $currentSearch['ajax']) ? 'ajax' : 'list'; ?>
       <?=$this->render('combined/results-' . $templateSuffix . '.phtml', $viewParams)?>
     </div>
diff --git a/themes/foundation5/templates/devtools/language.phtml b/themes/foundation5/templates/devtools/language.phtml
index b4ad84cc4b0..de175c2a756 100644
--- a/themes/foundation5/templates/devtools/language.phtml
+++ b/themes/foundation5/templates/devtools/language.phtml
@@ -1,60 +1,68 @@
 <!-- devtools LANGUAGE.phtml -->
 <?
-    $this->headTitle($this->translate('Language'));
+$this->headTitle($this->translate('Language'));
 ?>
 
-<h2>Comparing Languages Against <?=$this->escapeHtml($mainName)?></h2>
+<h2>Comparing Languages Against <?= $this->escapeHtml($mainName) ?></h2>
 
 <h3>Summary</h3>
 
 <table class="table">
-  <tr><th>Language</th><th>Missing Lines</th><th>Extra Lines</th><th>Percent Translated</th><th>Extra Help Files</th></tr>
+  <tr>
+    <th>Language</th>
+    <th>Missing Lines</th>
+    <th>Extra Lines</th>
+    <th>Percent Translated</th>
+    <th>Extra Help Files</th>
+  </tr>
   <? foreach ($details as $langCode => $diffs): ?>
     <tr>
-      <td><?=$this->escapeHtml($langCode . ' (' . $diffs['name'] . ')')?></td>
-      <td><?=count($diffs['notInL2'])?></td>
-      <td><?=count($diffs['notInL1'])?></td>
-      <td><?=$this->escapeHtml($diffs['l2Percent'])?></td>
-      <td><?=count($diffs['helpFiles'])?></td>
+      <td><?= $this->escapeHtml($langCode . ' (' . $diffs['name'] . ')') ?></td>
+      <td><?= count($diffs['notInL2']) ?></td>
+      <td><?= count($diffs['notInL1']) ?></td>
+      <td><?= $this->escapeHtml($diffs['l2Percent']) ?></td>
+      <td><?= count($diffs['helpFiles']) ?></td>
     </tr>
   <? endforeach; ?>
 </table>
 <ul class="small-block-grid-1 medium-block-grid-2">
-	<li>
-			<? foreach ($details as $langCode => $diffs): ?>
-				<? if (count($diffs['notInL1']) > 0): ?>
-					<ul class="accordion" id="accordion1" data-accordion="AccordionGroup">
-					 <li class="accordion-navigation">
-							<a href="#extra_<?=$langCode ?>">
-								Extra Lines In <?=$this->escapeHtml($diffs['name'])?> (<?=$this->escapeHtml($langCode)?>.ini)
-							</a>
-						<div id="extra_<?=$langCode ?>" class="content">
-							<div class="accordion-inner">
-							<? foreach ($diffs['notInL1'] as $key): ?>
-								<?=$this->escapeHtml($key)?> = "<?=$this->escapeHtml($diffs['object'][$key])?>"<br />
-							<? endforeach; ?>
-							</div>
-						</div>
-					 </li>
-				 </ul>
-				<? endif; ?>
-				<? if (count($diffs['notInL2']) > 0): ?>
-					<ul class="accordion" id="accordion2" data-accordion="AccordionGroup">
-					 <li class="accordion-navigation">
-							<a href="#missing_<?=$langCode ?>">
-								Missing From <?=$this->escapeHtml($diffs['name'])?> (<?=$this->escapeHtml($langCode)?>.ini)
-								<span class="pull-right"></span>
-							</a>
-						<div id="missing_<?=$langCode ?>" class="content">
-							<div class="accordion-inner">
-								<textarea class="auto" rows="15"><? foreach ($diffs['notInL2'] as $key): ?><?=$this->escapeHtml($key)?> = "<?=$this->escapeHtml($main[$key])?>"
-		<? endforeach; ?></textarea>
-							</div>
-						</div>
-					</li>
-				</ul>
-			<? endif; ?>
-		<? endforeach; ?>
-	</li>
+  <li>
+    <? foreach ($details as $langCode => $diffs): ?>
+      <? if (count($diffs['notInL1']) > 0): ?>
+        <ul class="accordion" id="accordion1" data-accordion="AccordionGroup">
+          <li class="accordion-navigation">
+            <a href="#extra_<?= $langCode ?>">
+              Extra Lines In <?= $this->escapeHtml($diffs['name']) ?> (<?= $this->escapeHtml($langCode) ?>.ini)
+            </a>
+
+            <div id="extra_<?= $langCode ?>" class="content">
+              <div class="accordion-inner">
+                <? foreach ($diffs['notInL1'] as $key): ?>
+                  <?= $this->escapeHtml($key) ?> = "<?= $this->escapeHtml($diffs['object'][$key]) ?>"<br/>
+                <? endforeach; ?>
+              </div>
+            </div>
+          </li>
+        </ul>
+      <? endif; ?>
+      <? if (count($diffs['notInL2']) > 0): ?>
+        <ul class="accordion" id="accordion2" data-accordion="AccordionGroup">
+          <li class="accordion-navigation">
+            <a href="#missing_<?= $langCode ?>">
+              Missing From <?= $this->escapeHtml($diffs['name']) ?> (<?= $this->escapeHtml($langCode) ?>.ini)
+              <span class="pull-right"></span>
+            </a>
+
+            <div id="missing_<?= $langCode ?>" class="content">
+              <div class="accordion-inner">
+                <textarea class="auto" rows="15"><? foreach ($diffs['notInL2'] as $key): ?><?= $this->escapeHtml($key) ?> = "<?= $this->escapeHtml($main[$key]) ?>"
+                  <? endforeach; ?></textarea>
+              </div>
+            </div>
+          </li>
+        </ul>
+      <? endif; ?>
+    <? endforeach; ?>
+  </li>
 </ul>
 <!-- devtools LANGUAGE.phtml end -->
\ No newline at end of file
diff --git a/themes/foundation5/templates/eds/search.phtml b/themes/foundation5/templates/eds/search.phtml
index a1f2bef83e8..6894a00ae29 100644
--- a/themes/foundation5/templates/eds/search.phtml
+++ b/themes/foundation5/templates/eds/search.phtml
@@ -1,5 +1,6 @@
 <?
   // Load standard settings from the default search results screen:
   $this->overrideSideFacetCaption = 'Refine Results';
+  $this->paginationOptions = ['disableFirst' => true, 'disableLast' => true];
   echo $this->render('search/results.phtml');
 ?>
\ No newline at end of file
diff --git a/themes/foundation5/templates/header.phtml b/themes/foundation5/templates/header.phtml
index 0501327d349..cd432ec42bb 100644
--- a/themes/foundation5/templates/header.phtml
+++ b/themes/foundation5/templates/header.phtml
@@ -1,9 +1,9 @@
 <!-- HEADER.PHTML begin -->
 <? $account = $this->auth()->getManager(); ?>
-    <nav class="top-bar" role="navigation" data-topbar data-options="sticky_on:all">
+    <nav class="top-bar" data-topbar data-options="sticky_on:all">
         <ul class="title-area">
             <li class="name">
-                <h1><a role="logo" class="navbar-brand" href="<?=$this->url('home')?>">VuFind</a></h1>
+                <h1><a class="navbar-brand" href="<?=$this->url('home')?>">VuFind</a></h1>
             </li>
             <? /*Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone */ ?>
             <li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li>
diff --git a/themes/foundation5/templates/install/fixsslcerts.phtml b/themes/foundation5/templates/install/fixsslcerts.phtml
new file mode 100644
index 00000000000..0408c875e32
--- /dev/null
+++ b/themes/foundation5/templates/install/fixsslcerts.phtml
@@ -0,0 +1,17 @@
+<?
+    // Set page title.
+    $this->headTitle($this->translate('auto_configure_title'));
+
+    // Set up breadcrumbs:
+    $this->layout()->breadcrumbs = '<li><a href="' . $this->url('install-home') .'">' . $this->transEsc('auto_configure_title') . '</a></li> <li class="active">' . $this->transEsc('Fix SSL Certificates') . '</li>';
+?>
+<h2><?=$this->transEsc('auto_configure_title')?></h2>
+
+<p>VuFind is unable to verify SSL certificates. This may adversely impact consumption of secure APIs.</p>
+
+<p>Troubleshooting steps:</p>
+
+<ol>
+  <li>Try setting the sslcapath or sslcafile setting in the [Http] section of your config.ini file to point to your local certificate store.</li>
+  <li>If you wish to disable certificate checking, you can set sslverifypeer to false in the [Http] section of config.ini. This is <b>insecure</b> and <b>not recommended</b> but may be useful for initial testing purposes.</li>
+</ol>
\ No newline at end of file
diff --git a/themes/foundation5/templates/layout/layout.phtml b/themes/foundation5/templates/layout/layout.phtml
index a1fdae32f10..5ab7f931654 100644
--- a/themes/foundation5/templates/layout/layout.phtml
+++ b/themes/foundation5/templates/layout/layout.phtml
@@ -1,6 +1,5 @@
-<!-- layout.PHTML begin -->
 <?=$this->doctype('HTML5')?>
-<html lang="<?=$this->layout()->userLang?>">
+<html lang="<?=$this->layout()->userLang?>" <? if ($this->layout()->rtl): ?>dir="rtl" <? endif; ?>>
   <head>
     <?$this->headThemeResources()?>
     <meta charset="utf-8">
@@ -19,6 +18,11 @@
         )
       );
     ?>
+    <!-- RTL styling -->
+    <? /* should work out-of-the-box in FNDTN -
+        just change lang and dir in the <html class="no-js" lang="ar" dir="rtl">
+        and activate and change line 144 in foundation/_settings.scss to $text-direction: rtl; */
+    ?>
     <?=$this->headLink()?>
     <?=$this->headStyle()?>
     <?
@@ -31,6 +35,7 @@
           array(
             'add_tag_success' => 'add_tag_success',
             'bulk_email_success' => 'bulk_email_success',
+            'bulk_noitems_advice' => 'bulk_noitems_advice',
             'bulk_save_success' => 'bulk_save_success',
             'close' => 'close',
             'libphonenumber_invalid' => 'libphonenumber_invalid',
@@ -59,7 +64,6 @@
               'bookbagFull' => 'bookbag_full_msg',
               'bookbagMax' => $cart->getMaxSize(),
               'bookbagStatusFull' => 'bookbag_full',
-              'bulk_noitems_advice' => 'bulk_noitems_advice',
               'confirmDelete' => 'confirm_delete',
               'confirmEmpty' => 'bookbag_confirm_empty',
               'itemsAddBag' => 'items_added_to_bookbag',
@@ -84,7 +88,7 @@
     ?>
     <?=$this->headScript()?>
   </head>
-  <body class="<?=$this->layoutClass('offcanvas-row')?>">
+  <body class="<?=$this->layoutClass('offcanvas-row')?><? if ($this->layout()->rtl): ?> rtl<? endif; ?>">
     <? // Set up the search box -- there are three possible cases:
       // 1. No search box was set; we should default to the normal box
       // 2. It was set to false; we should display nothing
@@ -130,7 +134,7 @@
 
     <div class="row">
       <div id="content" role="main" class="main panel template-dir-<?=$this->templateDir?> template-name-<?=$this->templateName?>">
-	    <div class="container">
+    <div class="container">
           <?=$this->layout()->content ?>
       </div>
     </div>
@@ -154,10 +158,9 @@
 <div class="offcanvas-overlay" data-toggle="offcanvas"></div>
 <?=$this->googleanalytics()?>
 <?=$this->piwik()?>
-<!-- Initializing call for FOUNDATION functions -->
+<? /* Initializing call for FOUNDATION functions */ ?>
     <script>
         $(document).foundation();
     </script>
   </body>
-</html>
-<!-- layout.PHTML end -->
\ No newline at end of file
+</html>
\ No newline at end of file
diff --git a/themes/foundation5/templates/myresearch/account.phtml b/themes/foundation5/templates/myresearch/account.phtml
index 40a1abdb00c..1a85b8b4153 100644
--- a/themes/foundation5/templates/myresearch/account.phtml
+++ b/themes/foundation5/templates/myresearch/account.phtml
@@ -9,7 +9,7 @@
 <h2><?=$this->transEsc('User Account')?></h2>
 <?=$this->flashmessages()?>
 
-<form method="post"  name="accountForm" id="accountForm" data-abide role="form">
+<form method="post" name="accountForm" id="accountForm" data-abide role="form">
   <?=$this->auth()->getCreateFields()?>
   <?=$this->recaptcha()->html($this->useRecaptcha) ?>
   <div class="row">
diff --git a/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml b/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml
index 27ec8118a05..da4e8e4935c 100644
--- a/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml
+++ b/themes/foundation5/templates/myresearch/bulk-action-buttons.phtml
@@ -19,7 +19,7 @@
       <input class="button secondary tiny" id="<?=$this->idPrefix?>delete_list_items_<?=!is_null($this->list) ? $this->escapeHtmlAttr($this->list->id) : ''?>" type="submit" name="delete" role="button" value="<?=$this->transEsc('Delete')?>" title="<?=$this->transEsc('delete_selected')?>"/>
     </li>
     <? endif; ?>
-    <? $exportOptions = $this->export()->getBulkOptions(); if (count($exportOptions) > 0): ?>
+    <? $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?>
     <li>
       <input class="button secondary tiny" type="submit" name="export" role="button" value="<?=$this->transEsc('Export')?>" title="<?=$this->transEsc('export_selected')?>"/>
     </li>
diff --git a/themes/foundation5/templates/myresearch/menu.phtml b/themes/foundation5/templates/myresearch/menu.phtml
index 1cfa03319c4..d4d67b172e9 100644
--- a/themes/foundation5/templates/myresearch/menu.phtml
+++ b/themes/foundation5/templates/myresearch/menu.phtml
@@ -3,8 +3,7 @@
 <ul class="side-nav">
   <? if ($this->userlist()->getMode() !== 'disabled'): ?>
     <li>
-      <a href="<?= $this->url('myresearch-favorites') ?>"
-         class="<?= $this->active == 'favorites' ? ' active' : '' ?>">
+      <a href="<?= $this->url('myresearch-favorites') ?>" class="<?= $this->active == 'favorites' ? ' active' : '' ?>">
         <?= $this->transEsc('Favorites') ?>
         <span class="pull-right"><i class="fa fa-fw fa-star"></i></span>
       </a>
diff --git a/themes/foundation5/templates/record/checkbox.phtml b/themes/foundation5/templates/record/checkbox.phtml
index b53628a0791..e6cba3addf1 100644
--- a/themes/foundation5/templates/record/checkbox.phtml
+++ b/themes/foundation5/templates/record/checkbox.phtml
@@ -1,2 +1,2 @@
-<input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->id ?>"/>
-<input type="hidden" name="idsAll[]" value="<?=$this->id ?>"/>
+<input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"/>
+<input type="hidden" name="idsAll[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"/>
diff --git a/themes/foundation5/templates/record/illrequest.phtml b/themes/foundation5/templates/record/illrequest.phtml
index 5dab6436f04..54ae109bf92 100644
--- a/themes/foundation5/templates/record/illrequest.phtml
+++ b/themes/foundation5/templates/record/illrequest.phtml
@@ -110,9 +110,7 @@ $this->layout()->breadcrumbs = '<li>' . $this->getLastSearchLink($this->transEsc
         <label class="medium-3 columns"><?= $this->transEsc("hold_required_by") ?>:</label>
 
         <div class="medium-9 columns">
-          <input id="requiredByDate" type="text" name="gatheredDetails[requiredBy]"
-                 value="<?= (isset($this->gatheredDetails['requiredBy']) && !empty($this->gatheredDetails['requiredBy'])) ? $this->escapeHtmlAttr($this->gatheredDetails['requiredBy']) : $this->escapeHtmlAttr($this->defaultRequiredDate) ?>"
-                 size="8" class="auto"/>
+          <input id="requiredByDate" type="text" name="gatheredDetails[requiredBy]" value="<?= (isset($this->gatheredDetails['requiredBy']) && !empty($this->gatheredDetails['requiredBy'])) ? $this->escapeHtmlAttr($this->gatheredDetails['requiredBy']) : $this->escapeHtmlAttr($this->defaultRequiredDate) ?>"  size="8" class="auto"/>
           (<?= $this->dateTime()->getDisplayDateFormat() ?>)
         </div>
       </div>
@@ -123,8 +121,7 @@ $this->layout()->breadcrumbs = '<li>' . $this->getLastSearchLink($this->transEsc
         <label class="medium-3 columns"><?= $this->transEsc("Comments") ?>:</label>
 
         <div class="medium-9 columns">
-          <textarea rows="3" cols="20" name="gatheredDetails[comment]"
-                    class="auto"><?= isset($this->gatheredDetails['comment']) ? $this->escapeHtml($this->gatheredDetails['comment']) : '' ?></textarea>
+          <textarea rows="3" cols="20" name="gatheredDetails[comment]" class="auto"><?= isset($this->gatheredDetails['comment']) ? $this->escapeHtml($this->gatheredDetails['comment']) : '' ?></textarea>
         </div>
       </div>
     <? endif; ?>
diff --git a/themes/foundation5/templates/record/view.phtml b/themes/foundation5/templates/record/view.phtml
index 3dca321a55c..30d005666be 100644
--- a/themes/foundation5/templates/record/view.phtml
+++ b/themes/foundation5/templates/record/view.phtml
@@ -1,90 +1,101 @@
 <!-- record - VIEW.phtml -->
 <?
-  // Set up standard record scripts:
-  $this->headScript()->appendFile("record.js");
-  $this->headScript()->appendFile("check_save_statuses.js");
-  // Activate Syndetics Plus if necessary:
-  if ($this->syndeticsPlus()->isActive()) {
-	echo $this->headScript()->appendFile($this->syndeticsPlus()->getScript());
-  }
+// Set up standard record scripts:
+$this->headScript()->appendFile("record.js");
+$this->headScript()->appendFile("check_save_statuses.js");
+// Activate Syndetics Plus if necessary:
+if ($this->syndeticsPlus()->isActive()) {
+  echo $this->headScript()->appendFile($this->syndeticsPlus()->getScript());
+}
 
-  // 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');
-  }
+// 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');
+}
 
-  // Set up breadcrumbs:
-  $this->layout()->breadcrumbs = '<li>' . $this->getLastSearchLink($this->transEsc('Search'), '', '</li> ') .
-	'<li class="active">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> ';
-  $this->layout()->title = $this->driver->getShortTitle();
+// Set up breadcrumbs:
+$this->layout()->breadcrumbs = '<li>' . $this->getLastSearchLink($this->transEsc('Search'), '', '</li> ') .
+    '<li class="active">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> ';
+$this->layout()->title = $this->driver->getShortTitle();
 ?>
 
 <? if (isset($this->scrollData) && ($this->scrollData['previousRecord'] || $this->scrollData['nextRecord'])): ?>
   <ul class="pager hide-for-print">
-	<? if ($this->scrollData['previousRecord']): ?>
-	  <li>
-		<a class="button" role="button" href="<?=$this->recordLink()->getUrl($this->scrollData['previousRecord'])?>" title="<?=$this->transEsc('Previous Search Result')?>" rel="nofollow">&laquo; <?=$this->transEsc('Prev')?></a>
-	  </li>
-	<? else: ?>
-	  <li class="disabled"><a href="#">&laquo; <?=$this->transEsc('Prev')?></a></li>
-	<? endif; ?>
-	#<?=$this->localizedNumber($this->scrollData['currentPosition']) . ' ' . $this->transEsc('of') . ' ' . $this->localizedNumber($this->scrollData['resultTotal']) . ' ' . $this->transEsc('results') ?>
-	<? if ($this->scrollData['nextRecord']): ?>
-	  <li>
-		<a class="button" role="button" href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>" title="<?=$this->transEsc('Next Search Result')?>" rel="nofollow"><?=$this->transEsc('Next')?> &raquo;</a>
-	  </li>
-	<? else: ?>
-	  <li class="disabled"><a href="#"><?=$this->transEsc('Next')?> &raquo;</a></li>
-	<? endif; ?>
+    <? if ($this->scrollData['previousRecord']): ?>
+      <li>
+        <a class="button" role="button" href="<?= $this->recordLink()->getUrl($this->scrollData['previousRecord']) ?>" title="<?= $this->transEsc('Previous Search Result') ?>" rel="nofollow">&laquo; <?= $this->transEsc('Prev') ?>
+        </a>
+      </li>
+    <? else: ?>
+      <li class="disabled">
+        <a href="#">&laquo; <?= $this->transEsc('Prev') ?></a>
+      </li>
+    <? endif; ?>
+    #<?= $this->localizedNumber($this->scrollData['currentPosition']) . ' ' . $this->transEsc('of') . ' ' . $this->localizedNumber($this->scrollData['resultTotal']) . ' ' . $this->transEsc('results') ?>
+    <? if ($this->scrollData['nextRecord']): ?>
+      <li>
+        <a class="button" role="button" href="<?= $this->recordLink()->getUrl($this->scrollData['nextRecord']) ?>" title="<?= $this->transEsc('Next Search Result') ?>" rel="nofollow"><?= $this->transEsc('Next') ?> &raquo;
+        </a>
+      </li>
+    <? else: ?>
+      <li class="disabled">
+        <a href="#"><?= $this->transEsc('Next') ?> &raquo;</a>
+      </li>
+    <? endif; ?>
   </ul>
 <? endif; ?>
 
-<?=$this->record($this->driver)->getToolbar()?>
+<?= $this->record($this->driver)->getToolbar() ?>
 
 <div class="row">
-  <div class="<?=$this->layoutClass('mainbody')?>">
-	<div class="record recordId source<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" id="record">
-	  <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId" id="record_id" />
-	  <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource()) ?>" class="hiddenSource" />
-	  <?=$this->flashmessages()?>
-	  <?=$this->record($this->driver)->getCoreMetadata()?>
-	</div>
+  <div class="<?= $this->layoutClass('mainbody') ?>">
+    <div class="record recordId source<?= $this->escapeHtmlAttr($this->driver->getResourceSource()) ?>" id="record">
+      <input type="hidden" value="<?= $this->escapeHtmlAttr($this->driver->getUniqueId()) ?>" class="hiddenId" id="record_id"/>
+      <input type="hidden" value="<?= $this->escapeHtmlAttr($this->driver->getResourceSource()) ?>" class="hiddenSource"/>
+      <?= $this->flashmessages() ?>
+      <?= $this->record($this->driver)->getCoreMetadata() ?>
+    </div>
 
-	<? if (count($this->tabs) > 0): ?>
-	  <a name="tabnav"></a>
-	  <ul class="recordTabs tabs"><? /* DO NOT use standard data-tab option here as it triggers Foundation's normal tab behaviour while Vufind only uses tab appearance! FIXME CK */ ?>
-		<? foreach ($this->tabs as $tab => $obj): ?>
-		<? // add current tab to breadcrumbs if applicable:
-		  $desc = $obj->getDescription();
-		  $tab_classes = array();
-		  if (0 === strcasecmp($this->activeTab, $tab)) {
-			$tab_classes[] = 'active';
-			$this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>';
-			$activeTabObj = $obj;
-		  }
-		  if (!$obj->isVisible()) { $tab_classes[] = 'hide'; }
-		  if (!$obj->supportsAjax()) { $tab_classes[] = 'noajax'; }
-		?>
-		<li class="tab-title <?=count($tab_classes) > 0 ? ' ' . implode(' ', $tab_classes) . '' : ''?>">
-		  <a id="<?=strtolower($tab) ?>" href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>"><?=$this->transEsc($desc)?></a>
-		</li>
-		<? endforeach; ?>
-	  </ul>
-	<? endif; ?>
+    <? if (count($this->tabs) > 0): ?>
+      <a name="tabnav"></a>
+      <ul class="recordTabs tabs"><? /* DO NOT use standard data-tab option here as it triggers Foundation's normal tab behaviour while Vufind only uses tab appearance! FIXME CK */ ?>
+        <? foreach ($this->tabs as $tab => $obj): ?>
+          <? // add current tab to breadcrumbs if applicable:
+          $desc = $obj->getDescription();
+          $tab_classes = array();
+          if (0 === strcasecmp($this->activeTab, $tab)) {
+            $tab_classes[] = 'active';
+            $tab_classes[] = 'initiallyActive';
+            $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>';
+            $activeTabObj = $obj;
+          }
+          if (!$obj->isVisible()) {
+            $tab_classes[] = 'hide';
+          }
+          if (!$obj->supportsAjax()) {
+            $tab_classes[] = 'noajax';
+          }
+          ?>
+          <li class="tab-title <?= count($tab_classes) > 0 ? ' ' . implode(' ', $tab_classes) . '' : '' ?>">
+            <a id="<?= strtolower($tab) ?>" href="<?= $this->recordLink()->getTabUrl($this->driver, $tab) ?>"><?= $this->transEsc($desc) ?></a>
+          </li>
+        <? endforeach; ?>
+      </ul>
+    <? endif; ?>
 
-	<div class="tabs-content" id="record-tabs">
-	  <div class="content active" id="<?=$this->activeTab ?>-tab">
-		<?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?>
-	  </div>
-	</div>
+    <div class="tabs-content" id="record-tabs">
+      <div class="content active" id="<?= $this->activeTab ?>-tab">
+        <?= isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : '' ?>
+      </div>
+    </div>
 
-    <?=$this->driver->supportsCoinsOpenURL()?'<span class="Z3988" title="'.$this->escapeHtmlAttr($this->driver->getCoinsOpenURL()).'"></span>':''?>
+    <?= $this->driver->supportsCoinsOpenURL() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>' : '' ?>
   </div>
 
-  <div class="<?=$this->layoutClass('sidebar')?>">
-	<? foreach ($this->related()->getList($this->driver) as $current): ?>
-	  <?=$this->related()->render($current)?>
-	<? endforeach; ?>
+  <div class="<?= $this->layoutClass('sidebar') ?>">
+    <? foreach ($this->related()->getList($this->driver) as $current): ?>
+      <?= $this->related()->render($current) ?>
+    <? endforeach; ?>
   </div>
 </div>
 <!-- record - VIEW.phtml end-->
\ No newline at end of file
diff --git a/themes/foundation5/templates/search/advanced/layout.phtml b/themes/foundation5/templates/search/advanced/layout.phtml
index 736da368ad6..f54bbf3f7c0 100644
--- a/themes/foundation5/templates/search/advanced/layout.phtml
+++ b/themes/foundation5/templates/search/advanced/layout.phtml
@@ -70,7 +70,7 @@ if (isset($searchDetails) && is_object($searchDetails)) {
 
         <div id="groupJoin" class="right hide">
           <label for="groupJoinOptions"><?= $this->transEsc("search_match") ?>:</label>
-          <select id="groupJoinOptions" name="join" class="auto"><? /* leave class=auto - was form-control and used in advanced_search.js - check and fixme - CK */ ?>
+          <select id="groupJoinOptions" name="join" class="auto"><? /* leave class=auto - was form-control and used in advanced_search.js - CK */ ?>
             <option value="AND"<? if ($searchDetails && $searchDetails->getOperator() == 'ALL'): ?> selected<? endif ?>><?= $this->transEsc('group_AND') ?></option>
             <option value="OR"<? if ($searchDetails && $searchDetails->getOperator() == 'OR'): ?> selected<? endif ?>><?= $this->transEsc('group_OR') ?></option>
           </select>
@@ -156,6 +156,7 @@ if (isset($searchDetails) && is_object($searchDetails)) {
         <? endif; ?>
       </div>
     </div>
+
     <div class="<?= $this->layoutClass('sidebar') ?>">
       <? if ($hasDefaultsApplied): ?>
         <input type="hidden" name="dfApplied" value="1"/>
diff --git a/themes/foundation5/templates/search/advanced/ranges.phtml b/themes/foundation5/templates/search/advanced/ranges.phtml
index 1363e87512d..e6e716a7d02 100644
--- a/themes/foundation5/templates/search/advanced/ranges.phtml
+++ b/themes/foundation5/templates/search/advanced/ranges.phtml
@@ -11,12 +11,11 @@
     <div class="row">
       <div class="medium-6 columns">
         <label for="<?= $escField ?>from"><?= $this->transEsc('date_from') ?>:</label>
-        <input type="text" name="<?= $escField ?>from" id="<?= $escField ?>from"
-               value="<?= isset($current['values'][0]) ? $this->escapeHtmlAttr($current['values'][0]) : '' ?>" <?= $extraInputAttribs ?>/>
+        <input type="text" name="<?= $escField ?>from" id="<?= $escField ?>from" value="<?= isset($current['values'][0]) ? $this->escapeHtmlAttr($current['values'][0]):''?>" <?= $extraInputAttribs ?>/>
       </div>
       <div class="medium-6 columns">
         <label for="<?= $escField ?>to"><?= $this->transEsc('date_to') ?>:</label>
-        <input type="text" name="<?= $escField ?>to" id="<?= $escField ?>to" value="<?= isset($current['values'][1]) ? $this->escapeHtmlAttr($current['values'][1]) : '' ?>" <?= $extraInputAttribs ?>/>
+        <input type="text" name="<?= $escField ?>to" id="<?= $escField ?>to" value="<?= isset($current['values'][1]) ? $this->escapeHtmlAttr($current['values'][1]):''?>" <?= $extraInputAttribs ?>/>
       </div>
     </div>
     <? if ($current['type'] == 'date'): ?>
@@ -35,6 +34,7 @@
       $max = intval($max);
       $low = intval($low);
       $high = intval($high);
+      $reversed = $this->layout()->rtl ? 'true' : 'false';
       $init = !empty($current['values'][0]) ? 'fillTexts()' : '';
       $script = <<<JS
 $(document).ready(function() {
@@ -49,7 +49,8 @@ $(document).ready(function() {
 	   'max':{$max},
 	   'handle':"square",
 	   'tooltip':"hide",
-	   'value':[{$low},{$high}]
+     'value':[{$low},{$high}],
+     'reversed': {$reversed}
 	})
 	.on('slide', fillTexts)
 	.data('slider');
diff --git a/themes/foundation5/templates/search/bulk-action-buttons.phtml b/themes/foundation5/templates/search/bulk-action-buttons.phtml
index 638572745f7..b36f62469cd 100644
--- a/themes/foundation5/templates/search/bulk-action-buttons.phtml
+++ b/themes/foundation5/templates/search/bulk-action-buttons.phtml
@@ -2,7 +2,8 @@
 <? if((isset($this->showBulkOptions)  && $this->showBulkOptions)
    || (isset($this->showCartControls) && $this->showCartControls)): ?>
   <div class="bulkActionButtons hide-for-print">
-    <div class="<? if (isset($this->showBulkOptions) && $this->showBulkOptions): ?>checkbox <? else: ?>checkbox left<? endif; ?> select-all">
+    <div class="checkbox">
+    <? /* div class="<? if (isset($this->showBulkOptions) && $this->showBulkOptions): ?>checkbox <? else: ?>checkbox left<? endif; ?> select-all" */ ?>
       <label>
         <input type="checkbox" class="checkbox-select-all" name="selectAll" id="<?=$this->idPrefix?>addFormCheckboxSelectAll"/> <?=$this->transEsc('select_page')?>
         &#124; <?=$this->transEsc('with_selected')?>:
@@ -21,7 +22,7 @@
       <? endif; ?>
       <? if (isset($this->showCartControls) && $this->showCartControls): ?>
        <input id="<?= $this->idPrefix ?>updateCart" class="button secondary small" role="button" type="submit" name="add" value="<?= $this->transEsc('Add to Book Bag') ?>" data-dropdown="<?= $this->idPrefix ?>bookbg-dd" data-options="is_hover:true; hover_timeout:5000" aria-controls="bookbg-dd" aria-haspopup="true" />
-        <ul id="<?= $this->idPrefix ?>bookbg-dd" class="f-dropdown" data-dropdown-content tabindex="-1" aria-hidden="true" aria-autoclose="true" tabindex="-1">
+        <ul id="<?= $this->idPrefix ?>bookbg-dd" class="f-dropdown" data-dropdown-content aria-hidden="true" aria-autoclose="true" tabindex="-1">
           <li class="bookbg-msg"><?= $this->transEsc('Add to Book Bag') ?></li>
         </ul>
       <? endif; ?>
diff --git a/themes/foundation5/templates/search/home.phtml b/themes/foundation5/templates/search/home.phtml
index b821cdf33f6..a20c21570b4 100644
--- a/themes/foundation5/templates/search/home.phtml
+++ b/themes/foundation5/templates/search/home.phtml
@@ -18,13 +18,12 @@ $advSearch = $options->getAdvancedSearchAction();
 
 $this->layout()->breadcrumbs = false;
 ?>
+
 <div class="searchHomeContent">
   <? if ($this->ils()->getOfflineMode() == "ils-offline"): ?>
     <div data-alert class="alert-box warning" tabindex="0" aria-live="assertive" role="dialogalert">
       <h2><?= $this->transEsc('ils_offline_title') ?></h2>
-
       <p><strong><?= $this->transEsc('ils_offline_status') ?></strong></p>
-
       <p><?= $this->transEsc('ils_offline_home_message') ?></p>
       <? $supportEmail = $this->escapeHtmlAttr($this->systemEmail()); ?>
       <p><a href="mailto:<?= $supportEmail ?>"><?= $supportEmail ?></a></p>
@@ -51,9 +50,8 @@ $(document).ready(function() {
 JS;
         ?>
         <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?>
-        <div class="facet <?= $field == 'callnumber-first' ? 'medium-6 columns' : 'medium-4 columns' ?>">
+        <div class="facet <?= $field == 'callnumber-first' ? 'medium-6' : 'medium-4' ?> columns">
           <h2><?= $this->transEsc('home_browse') . ' ' . $this->transEsc($details['label']) ?></h2>
-
           <div id="facet_<?= $this->escapeHtml($field) ?>" class="jstree-facet"
                data-facet="<?= $this->escapeHtml($field) ?>"
                data-path="<?= $this->url($basicSearch) ?>"
@@ -66,11 +64,10 @@ JS;
         <noscript>
       <? endif; ?>
       <? $sortedList = $this->sortFacetList($this->results, $field, $details['list'], $basicSearch); ?>
-      <div class="<?= $field == 'callnumber-first' ? 'medium-6 columns' : 'medium-4 columns' ?> browsesuggest">
+      <div class="<?= $field == 'callnumber-first' ? 'medium-6' : 'medium-4' ?> columns browsesuggest">
         <h2><?= $this->transEsc('home_browse') . ' ' . $this->transEsc($details['label']) ?></h2>
-
         <div class="row">
-          <ul class="list-unstyled <?= $field == "callnumber-first" ? 'medium-6 columns' : 'medium-12 columns' ?>">
+          <ul class="list-unstyled <?= $field == "callnumber-first" ? 'medium-6' : 'medium-12' ?> columns">
             <? /* Special case: two columns for LC call numbers... */ ?>
             <? if ($field == "callnumber-first"): ?>
             <? $i = 0;
diff --git a/themes/foundation5/templates/search/pagination.phtml b/themes/foundation5/templates/search/pagination.phtml
index 4bd6ebb2c41..88fa9ae366d 100644
--- a/themes/foundation5/templates/search/pagination.phtml
+++ b/themes/foundation5/templates/search/pagination.phtml
@@ -3,7 +3,9 @@
 <div class="pagination-centered">
   <ul class="pagination hide-for-print" role="menubar" aria-label="Pagination">
     <? if (isset($this->previous)): ?>
+      <? if (!isset($this->options['disableFirst']) || !$this->options['disableFirst']): ?>
       <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>">[1]</a></li>
+      <? endif; ?>
       <li><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>">&laquo; <?=$this->transEsc('Prev')?></a></li>
     <? endif; ?>
 
diff --git a/themes/foundation5/templates/search/results.phtml b/themes/foundation5/templates/search/results.phtml
index bd30cf4c02f..3e475421ad0 100644
--- a/themes/foundation5/templates/search/results.phtml
+++ b/themes/foundation5/templates/search/results.phtml
@@ -104,7 +104,7 @@ $this->headScript()->appendFile("check_save_statuses.js");
         <?= $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_')) ?>
-        <?= $this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', array('results' => $this->results)) ?>
+        <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', array('results' => $this->results, 'options' => isset($this->paginationOptions) ? $this->paginationOptions : []))?>
       </form>
 
       <div class="searchtools hide-for-print">
diff --git a/themes/foundation5/templates/vudl/details.phtml b/themes/foundation5/templates/vudl/details.phtml
index 26c417aae4f..a84d1703c32 100644
--- a/themes/foundation5/templates/vudl/details.phtml
+++ b/themes/foundation5/templates/vudl/details.phtml
@@ -1,81 +1,92 @@
 <!-- vudl - details.phtml -->
 <?php
-  $skip = array(
+$skip = array(
     'license', 'special_license', 'description', 'title'
-  );
-  $no_link = array('title', 'description');
+);
+$no_link = array('title', 'description');
 ?>
 <ul class="accordion" data-accordion>
-					<li class="accordion-navigation">
-						<h4>
-							<a href="#collapse_details">
-							<?=$this->transEsc('Summary & Rights') ?>
-							</a>
-						</h4>
-						<div id="collapse_details" class="content">
-							<table class="table">
-				<tr><td><?=$this->transEsc('Full Title') ?></td><td><?=$this->details['title']['value'] ?></td></tr>
-				<? foreach ($this->details as $attr=>$val):
-					// Skip items not placed in this table
-					if(in_array($attr, $skip)) continue; ?>
-					<tr><td><?=$this->transEsc($val['title']) ?></td><td>
-						<? // Special format for first_indexed ?>
-						<? if($attr == 'first_indexed'): ?>
-							<?=date_create($val['value'])->format('j F Y') ?>
-	
-						<? // If we need exploding and backlinking ?>
-						<? elseif($attr == 'topic' || $attr == 'series'): ?>
-							<? if(!is_array($val['value'])) $val['value'] = array($val['value']); ?>
-							<? if(count($val['value']) > 1): ?><ul class="list-unstyled"><? endif ?>
-							<? foreach($val['value'] as $v): ?>
-								<? if(count($val['value']) > 1): ?><li><? endif ?>
-							 <? $parts = explode(' -- ', $v);
-									$filter = '';
-									foreach($parts as $i=>$p):
-										$filter .= ' '.$p; ?>
-										<?=$i>0 ? ' &gt; ' : '' ?><a class="backlink" href="<?=$this->url('search-results') ?>?filter[]=<?=$attr ?>:<?=urlencode(trim($filter)) ?>"><?=$p ?></a>
-							 <? endforeach; ?>
-								<? if(count($val['value']) > 1): ?></li><? endif ?>
-							<? endforeach; ?>
-							<? if(count($val['value']) > 1): ?></ul><? endif ?>
-	
-						<? // Items not useful to link ?>
-						<? elseif(in_array($attr, $no_link)): ?>
-							<?=is_array($val['value']) ? implode('<br/>', $val['value']) : $val['value'] ?>
-	
-						<? // Array handling ?>
-						<? elseif(is_array($val['value'])): ?>
-							<? if(count($val['value']) == 1): ?>
-								<a href="<?=$this->url('search-results') ?>?filter[]=<?=$attr ?>:<?=urlencode($val['value'][0]) ?>"><?=$val['value'][0] ?></a>
-							<? else: ?>
-								<ul class="list-unstyled">
-								<? foreach($val['value'] as $v): ?>
-									 <li><a href="<?=$this->url('search-results') ?>?filter[]=<?=$attr ?>:<?=urlencode($v) ?>"><?=$v ?></a></li>
-								<? endforeach; ?>
-								</ul>
-							<? endif; ?>
-	
-						<? // The rest are linked ?>
-						<? else: ?>
-							<a href="<?=$this->url('search-results') ?>?filter[]=<?=$attr ?>:<?=urlencode($val['value']) ?>"><?=$val['value'] ?></a>
-						<? endif; ?>
-					</td></tr>
-				<? endforeach; ?>
-				<? if(isset($this->details['license'])): ?>
-					<? if(!$this->details['special_license']): ?>
-						<tr><td>License</td><td><a href="<?=$this->details['license'] ?>"><?=$this->details['license'] ?></a></td></tr>
-					<? endif; ?>
-				<? endif; ?>
-			</table>
-			<? if(isset($this->details['license'])): ?>
-			<div class="copyright">
-				<?=$this->render('/vudl/licenses/'.$this->details['special_license'], array('details'=>$this->details)); ?>
-			</div>
-			<? endif; ?>
-      <a href="<?=$this->url('record', array('id'=>$this->id))?>"><i class="fa fa-list"></i> <?=$this->transEsc('More Details') ?></a><br/>
-      <a href="<?=$this->url('vudl-record', array('id'=>$this->id))?>"><i class="fa fa-book"></i> <?=$this->transEsc('Permanent Link') ?></a>
-			<? if(isset($this->details['description'])): ?><p class="description"><?=html_entity_decode($this->details['description']['value'], 2 /*ENT_COMPAT|ENT_HTML401*/, 'UTF-8') ?></p><? endif ?>
-		</div>
-	</li>
+  <li class="accordion-navigation">
+    <h4>
+      <a href="#collapse_details">
+        <?= $this->transEsc('Summary & Rights') ?>
+      </a>
+    </h4>
+
+    <div id="collapse_details" class="content">
+      <table class="table">
+        <tr>
+          <td><?= $this->transEsc('Full Title') ?></td>
+          <td><?= $this->details['title']['value'] ?></td>
+        </tr>
+        <? foreach ($this->details as $attr => $val):
+          // Skip items not placed in this table
+          if (in_array($attr, $skip)) continue; ?>
+          <tr>
+            <td><?= $this->transEsc($val['title']) ?></td>
+            <td>
+              <? // Special format for first_indexed
+              ?>
+              <? if ($attr == 'first_indexed'): ?>
+                <?= date_create($val['value'])->format('j F Y') ?>
+
+                <? // If we need exploding and backlinking ?>
+              <? elseif ($attr == 'topic' || $attr == 'series'): ?>
+                <? if (!is_array($val['value'])) $val['value'] = array($val['value']); ?>
+                <? if (count($val['value']) > 1): ?><ul class="list-unstyled"><? endif ?>
+                <? foreach ($val['value'] as $v): ?>
+                  <? if (count($val['value']) > 1): ?><li><? endif ?>
+                  <? $parts = explode(' -- ', $v);
+                  $filter = '';
+                  foreach ($parts as $i => $p):
+                    $filter .= ' ' . $p; ?>
+                    <?= $i > 0 ? ' &gt; ' : '' ?><a class="backlink" href="<?= $this->url('search-results') ?>?filter[]=<?= $attr ?>:<?= urlencode(trim($filter)) ?>"><?= $p ?></a>
+                  <? endforeach; ?>
+                  <? if (count($val['value']) > 1): ?></li><? endif ?>
+                <? endforeach; ?>
+                <? if (count($val['value']) > 1): ?></ul><? endif ?>
+
+                <? // Items not useful to link ?>
+              <? elseif (in_array($attr, $no_link)): ?>
+                <?= is_array($val['value']) ? implode('<br/>', $val['value']) : $val['value'] ?>
+
+                <? // Array handling ?>
+              <? elseif (is_array($val['value'])): ?>
+                <? if (count($val['value']) == 1): ?>
+                  <a href="<?= $this->url('search-results') ?>?filter[]=<?= $attr ?>:<?= urlencode($val['value'][0]) ?>"><?= $val['value'][0] ?></a>
+                <? else: ?>
+                  <ul class="list-unstyled">
+                    <? foreach ($val['value'] as $v): ?>
+                      <li><a href="<?= $this->url('search-results') ?>?filter[]=<?= $attr ?>:<?= urlencode($v) ?>"><?= $v ?></a></li>
+                    <? endforeach; ?>
+                  </ul>
+                <? endif; ?>
+
+                <? // The rest are linked ?>
+              <? else: ?>
+                <a href="<?= $this->url('search-results') ?>?filter[]=<?= $attr ?>:<?= urlencode($val['value']) ?>"><?= $val['value'] ?></a>
+              <? endif; ?>
+            </td>
+          </tr>
+        <? endforeach; ?>
+        <? if (isset($this->details['license'])): ?>
+          <? if (!$this->details['special_license']): ?>
+            <tr>
+              <td>License</td>
+              <td><a href="<?= $this->details['license'] ?>"><?= $this->details['license'] ?></a></td>
+            </tr>
+          <? endif; ?>
+        <? endif; ?>
+      </table>
+      <? if (isset($this->details['license'])): ?>
+        <div class="copyright">
+          <?= $this->render('/vudl/licenses/' . $this->details['special_license'], array('details' => $this->details)); ?>
+        </div>
+      <? endif; ?>
+      <a href="<?= $this->url('record', array('id' => $this->id)) ?>"><i class="fa fa-list"></i> <?= $this->transEsc('More Details') ?></a><br/>
+      <a href="<?= $this->url('vudl-record', array('id' => $this->id)) ?>"><i class="fa fa-book"></i> <?= $this->transEsc('Permanent Link') ?></a>
+      <? if (isset($this->details['description'])): ?><p class="description"><?= html_entity_decode($this->details['description']['value'], 2 /*ENT_COMPAT|ENT_HTML401*/, 'UTF-8') ?></p><? endif ?>
+    </div>
+  </li>
 </ul>
 <!-- vudl - details.phtml - END -->
\ No newline at end of file
diff --git a/themes/foundation5/templates/vudl/record.phtml b/themes/foundation5/templates/vudl/record.phtml
index c45f4feb88a..dbacdb345ca 100644
--- a/themes/foundation5/templates/vudl/record.phtml
+++ b/themes/foundation5/templates/vudl/record.phtml
@@ -58,7 +58,6 @@ function json_php_encode($op, $quotes = false)
             <i class="fa fa-caret-left"></i>
           </a>
         </h4>
-
         <div id="side-nav-acc" class="content">
           <?= $this->context($this)->renderInContext('vudl/details.phtml', array()) ?>
           <ul class="accordion" data-accordion>
diff --git a/themes/foundation5/templates/vudl/views/audio.phtml b/themes/foundation5/templates/vudl/views/audio.phtml
index ab1f722eebd..ba42a658460 100644
--- a/themes/foundation5/templates/vudl/views/audio.phtml
+++ b/themes/foundation5/templates/vudl/views/audio.phtml
@@ -27,7 +27,7 @@
       <i class="fa fa-caret-right"></i>
     </a>
   </dd>
-  <dd class="active"><a>Player and Downloads</a></dd><? /* This doesn't appeat 2 b correct - Fixme - CK */  ?>
+  <dd class="active"><a>Player and Downloads</a></dd>
 </dl>
 <div class="tab-container text-center tabs-content">
 		<audio controls preload="auto">
diff --git a/themes/foundation5/templates/vudl/views/video.phtml b/themes/foundation5/templates/vudl/views/video.phtml
index 2b1eb33c84f..e474d31ffce 100644
--- a/themes/foundation5/templates/vudl/views/video.phtml
+++ b/themes/foundation5/templates/vudl/views/video.phtml
@@ -27,7 +27,7 @@
       <i class="fa fa-caret-right"></i>
     </a>
   </dd>
-  <dd class="active"><a>Player and Downloads</a></dd><? /* This doesn't appear 2 b right - fixme - CK */ ?>
+  <dd class="active"><a>Player and Downloads</a></dd>
 </dl>
 <div class="tab-container text-center content">
   <video controls>
diff --git a/themes/foundation5/theme.config.php b/themes/foundation5/theme.config.php
index d135ea43deb..415e02730ae 100644
--- a/themes/foundation5/theme.config.php
+++ b/themes/foundation5/theme.config.php
@@ -1,41 +1,38 @@
 <?php
 return array(
-	'extends' => 'root',
-	'css' => array(
-		'vendor/normalize.css',
-		// import foundation into default.scss and leave next line out
-		'vendor/font-awesome.css',
-		'default.css',
-		),
-	'js' => array(
-		'vendor/base64.js:lt IE 10', // btoa polyfill
-		'vendor/jquery.min.js',
-		'vendor/modernizr.js',
-		'vendor/fastclick.js',
-		'vendor/rc4.js',
-		'foundation.min.js',		// This includes all components
-		//	'foundation/foundation.js', 	// Activate this plus individual FNDTN component scripts below, if desired
-		//	'foundation/foundation.topbar.js',
-		'vendor/typeahead.js',
-		'common.js',
-		'lightbox.js',
-	),
+  'extends' => 'root',
+  'css' => array(
+    'vendor/normalize.css',
+    // import foundation into default.scss and leave next line out
+    'vendor/font-awesome.css',
+    'default.css',
+    ),
+  'js' => array(
+    'vendor/base64.js:lt IE 10', // btoa polyfill
+    'vendor/jquery.min.js',
+    'vendor/modernizr.js', // html5 for older browsers
+    'vendor/fastclick.js',  // improves experience for mobile users
+    'vendor/rc4.js',
+    'foundation.min.js', // This includes all components
+    //	'foundation/foundation.js', // Activate this plus individual FNDTN component scripts below, if desired
+    //	'foundation/foundation.topbar.js',
+    'vendor/typeahead.js',
+    'common.js',
+    'lightbox.js',
+  ),
 
-	// CSS-compiler
-	/* Chris - I have started using sassc to compile:
-             - https://github.com/sass/sassc
-             - ~/sassc/bin/sassc -t compact themes/foundation5/scss/default.scss > themes/foundation5/css.default.css */
+// CSS-compiler: We use Sass and compile per grunt
 
-	'favicon' => 'vufind-favicon.ico',
-	'helpers' => array(
-		'factories' => array(
-			'flashmessages' => 'VuFind\View\Helper\Foundation\Factory::getFlashmessages',
-			'layoutclass' => 'VuFind\View\Helper\Foundation\Factory::getLayoutClass',
-		),
-		'invokables' => array(
-			'highlight' => 'VuFind\View\Helper\Foundation\Highlight',
-			'search' => 'VuFind\View\Helper\Foundation\Search',
-			'vudl' => 'VuDL\View\Helper\Foundation\VuDL',
-		)
-	)
+  'favicon' => 'vufind-favicon.ico',
+  'helpers' => array(
+    'factories' => array(
+      'flashmessages' => 'VuFind\View\Helper\Foundation\Factory::getFlashmessages',
+      'layoutclass' => 'VuFind\View\Helper\Foundation\Factory::getLayoutClass',
+    ),
+    'invokables' => array(
+      'highlight' => 'VuFind\View\Helper\Foundation\Highlight',
+      'search' => 'VuFind\View\Helper\Foundation\Search',
+      'vudl' => 'VuDL\View\Helper\Foundation\VuDL',
+    )
+  )
 );
-- 
GitLab