Skip to content
Snippets Groups Projects
Commit d7345abd authored by Dorian Merz's avatar Dorian Merz
Browse files

Merge branch 'master-v5' into instance/fid

parents 1ce5fa62 dcc6c9e0
No related merge requests found
......@@ -14,7 +14,6 @@ $config = [
'VuFind\ILS\Connection' => 'finc\Service\Factory::getILSConnection',
'VuFind\ILS\Logic\Holds' => 'finc\Service\Factory::getILSHoldLogic',
'finc\Rewrite' => 'finc\Rewrite\Factory',
'VuFind\Export' => 'finc\Service\Factory::getExport',
'VuFind\SessionManager' => 'finc\Session\ManagerFactory',
],
'delegators' => [
......@@ -260,7 +259,6 @@ $nonTabRecordActions = [
// Define record view routes once again to add new nonTabRecordActions
$recordRoutes = [
'record' => 'Record',
'export' => 'Export',
'resources' => 'Resources'
];
......
<?php
/**
* Export support class
*
* PHP version 5
*
* Copyright (C) Villanova University 2010.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category VuFind
* @package Export
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org Main Site
*/
namespace finc;
use VuFind\SimpleXML;
use Zend\Config\Config;
/**
* Export support class
*
* @category VuFind
* @package Export
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org Main Site
*/
class Export extends \VuFind\Export
{
/**
* Get Main VuFind Configuration
*
* @return Config
*/
public function getMainConfig()
{
return $this->mainConfig;
}
}
<!-- finc: ContentBlock -- FacetList -->
<?php
// Load search actions and settings (if any):
$options = $this->searchOptions($searchClassId);
$basicSearch = $options->getSearchAction();
$advSearch = $options->getAdvancedSearchAction();
$noJsSupport = $this->config()->nonJavascriptSupportEnabled();
?>
<?php if (!empty($facetList)): ?>
<div class="search-home-facets">
<?php
$itemSum = $fieldSum = 0;
$maxColumns = 4;
foreach ($facetList as $field => $details) {
$itemSum += count($details['list']);
$fieldSum += 1;
}
?>
<?php foreach ($facetList as $field => $details): ?>
<?php if ($isHierarchy = in_array($field, $hierarchicalFacets ?? [])):
$this->headScript()->appendFile('vendor/jsTree/jstree.min.js');
$this->headScript()->appendFile('facets.js');
$sort = $hierarchicalFacetSortOptions[$field] ?? '';
$script = <<<JS
$(document).ready(function() {
$('#facet_{$this->escapeHtml($field)}_container').removeClass('hide');
initFacetTree($('#facet_{$this->escapeHtml($field)}'), false);
});
JS;
echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET');
?>
<div id="facet_<?=$this->escapeHtml($field)?>_container" class="home-facet <?=$this->escapeHtmlAttr($field)?> hide">
<h2><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></h2>
<div id="facet_<?=$this->escapeHtml($field)?>" class="jstree-facet"
data-source="<?=$this->escapeHtml($this->searchClassId)?>"
data-facet="<?=$this->escapeHtml($field)?>"
data-path="<?=$this->url($basicSearch)?>"
data-exclude="0"
data-operator="AND"
data-exclude-title="<?=$this->transEsc('exclude_facet')?>"
data-sort="all">
</div>
</div>
<noscript>
<?php if (!$noJsSupport): ?>
<h2><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></h2>
<?=$this->transEsc('Please enable JavaScript.')?>
<?php endif; ?>
<?php endif; ?>
<?php if (!$isHierarchy || $noJsSupport): // do we need regular display? ?>
<?php $sortedList = $this->sortFacetList($results, $field, $details['list'], $basicSearch); ?>
<div class="home-facet <?=$this->escapeHtmlAttr($field) ?>">
<h2><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></h2>
<div class="home-facet-container">
<ul class="home-facet-list">
<?php
// Convenience variable:
$currentListLength = count($sortedList);
// Special case: two columns for LC call numbers...
$maxListLength = $field == 'callnumber-first'
|| ($currentListLength * 2 >= $itemSum && $fieldSum < $maxColumns) // #15579 ... or outnumbered facets
? $columnSize * 2 : $columnSize;
// Special case: custom URLs for collections...
$moreUrl = $field == 'hierarchy_top_title'
? $this->url('collections-home') : $this->url($advSearch);
?>
<?php $i = 0; foreach ($sortedList as $url => $value):
// Special case: custom URLs for collections...
if ($field == 'hierarchy_top_title') {
$url = $this->url('collections-bytitle') . '?title=' . urlencode($value);
}
?>
<li><a href="<?=$url?>"><?=$this->escapeHtml(empty($value) ? '-' : $value)?></a></li>
<?php if (++$i >= $currentListLength) break; // end of list? bail out! ?>
<?php if ($i >= $maxListLength): // list too long? show more link! ?>
<li><a href="<?=$moreUrl?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li>
<?php break; ?>
<?php elseif ($i % $columnSize === 0): // end of column? insert break! ?>
</ul><ul class="home-facet-list">
<?php endif; ?>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>
<?php if ($isHierarchy): // close tag opened in matching if above ?>
</noscript>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<!-- finc: ContentBlock -- FacetList - END -->
\ No newline at end of file
......@@ -194,8 +194,8 @@ foreach ($this->record($this->driver)->getUrlList() as $doi) {
echo "url = {{$doi}},\n";
}
$baseUrl = $this->export()->getMainConfig()->Site->url;
$url = $baseUrl . $this->recordLink()->getUrl($this->driver->getUniqueId());
$serverurl = $this->serverUrl();
$url = $serverurl . $this->url('record', ['id' => $this->driver->getUniqueId()]);
if (!empty($url)) {
echo "url = {{$url}}\n";
}
......
......@@ -135,7 +135,7 @@ if (is_array($issns)) {
}
}
$library = $this->export()->getMainConfig()->Site->title;
$library = $this->config()->get('config')->Site->title;
if (!empty($library)) {
echo "%~ {$library}\n";
}
......@@ -191,14 +191,14 @@ if (!empty($summary)) {
echo "%X {$summary[0]}\n";
}
$baseUrl = $this->export()->getMainConfig()->Site->url;
$url = $baseUrl . $this->recordLink()->getUrl($this->driver->getUniqueId());
$serverurl = $this->serverUrl();
$url = $serverurl . $this->url('record', ['id' => $this->driver->getUniqueId()]);
if (!empty($url)) {
echo "%Z {$url}\n";
}
$baseUrl = $this->export()->getMainConfig()->Site->url;
$url = $baseUrl . $this->recordLink()->getUrl($this->driver->getUniqueId());
$serverurl = $this->serverUrl();
$url = $serverurl . $this->url('record', ['id' => $this->driver->getUniqueId()]);
if (!empty($url)) {
echo "%U {$url}\n";
}
......
......@@ -235,8 +235,8 @@ foreach ($this->record($this->driver)->getUrlList() as $doi) {
echo 'UR - ' . "$doi\r\n";
}
$baseUrl = $this->export()->getMainConfig()->Site->url;
$url = $baseUrl . $this->recordLink()->getUrl($this->driver->getUniqueId());
$serverurl = $this->serverUrl();
$url = $serverurl . $this->url('record', ['id' => $this->driver->getUniqueId()]);
if (!empty($url)) {
echo 'UR - ' . "$url\r\n";
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment