diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index 7ff72940c256459a274e279d92698682853ba51e..ff01db2d2da08a4a6eebccb212e4f114aaa58c3f 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -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' ]; diff --git a/module/finc/src/finc/Export.php b/module/finc/src/finc/Export.php deleted file mode 100644 index 5a2a4692c7a392a8ac9ec6a6623f945ef6d34983..0000000000000000000000000000000000000000 --- a/module/finc/src/finc/Export.php +++ /dev/null @@ -1,53 +0,0 @@ -<?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; - } -} diff --git a/themes/finc/templates/ContentBlock/FacetList.phtml b/themes/finc/templates/ContentBlock/FacetList.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b6a8d836a526fc00815ae8c0f1a59fafc641af06 --- /dev/null +++ b/themes/finc/templates/ContentBlock/FacetList.phtml @@ -0,0 +1,98 @@ +<!-- 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 diff --git a/themes/finc/templates/RecordDriver/AbstractBase/export-bibtex.phtml b/themes/finc/templates/RecordDriver/AbstractBase/export-bibtex.phtml index 03029631f40cbfb4ac0ad3eb09b5a686ea53cb27..d88424557670c8b94223cace16745248e60f2505 100644 --- a/themes/finc/templates/RecordDriver/AbstractBase/export-bibtex.phtml +++ b/themes/finc/templates/RecordDriver/AbstractBase/export-bibtex.phtml @@ -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"; } diff --git a/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml b/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml index 9a3c7f380e0202b5effe35a1819bfeaf92c44b2e..19a6e94b4b2ae6f4fd4cce8283d06ecf3eebc58b 100644 --- a/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml +++ b/themes/finc/templates/RecordDriver/AbstractBase/export-endnote.phtml @@ -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"; } diff --git a/themes/finc/templates/RecordDriver/AbstractBase/export-ris.phtml b/themes/finc/templates/RecordDriver/AbstractBase/export-ris.phtml index 06440fddf74f9a4120b10a429bb4437227ef44db..80e2734d82244d0566e881fd2355047438eff9d4 100644 --- a/themes/finc/templates/RecordDriver/AbstractBase/export-ris.phtml +++ b/themes/finc/templates/RecordDriver/AbstractBase/export-ris.phtml @@ -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"; }