diff --git a/local/languages/de.ini b/local/languages/de.ini index 1f737d2386fa1c7f17e3e6dbf2da9d736ea91ffa..aaae6bd5eff3acedcab299d86346812f6515ddcd 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -113,6 +113,7 @@ Electronicresourcedatacarrier = "Elektronische Ressource auf Datenträger" ElectronicResourceRemoteAccess = "Elektronische Ressource im Fernzugriff" Electronicresourceremoteaccess = "Elektronische Ressource im Fernzugriff" ElectronicIntegratingResource = "Elektronische Ressource im Fernzugriff" +ReliefPrint = Druckgrafik Unknown Format = Sonstige ### # Formate Primo Central @@ -345,7 +346,7 @@ Holdings = Exemplare Holdings details from = "Bestandsangaben von" Holdnep-Submit = "Benutzergesteuerte Erwerbung" Holds = Bestellungen -Holds and Recalls = "Bestellungen und Vormerkungen" +Holds and Recalls = "Bestellungen & Vormerkungen" Home = "Start" Identity Number = Personalausweisnummer Illustrated = Abbildungen diff --git a/local/languages/en.ini b/local/languages/en.ini index aa1bbf0afa266dd124311b8c513569a0b1c41109..fa25648ea63a1c057f9d9ad34e9d15811ae2efb9 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -826,6 +826,7 @@ Motion Picture = Motion Picture Music Recording = Music Recording Notated Music = Notated Music Newspaper, E-Paper = Newspaper, E-Paper +ReliefPrint = Relief Print Sound Cassette = Sound Cassette Sound Disc = Sound Disc Sound Recording Medium = Sound Recording Medium diff --git a/module/finc/src/finc/RecordDriver/SolrAI.php b/module/finc/src/finc/RecordDriver/SolrAI.php index 850d5659fea55a48cd9cc0e2ee44cc9922da9574..c6a54b21631fa762b4c9b5e00d3daa92aaa98710 100644 --- a/module/finc/src/finc/RecordDriver/SolrAI.php +++ b/module/finc/src/finc/RecordDriver/SolrAI.php @@ -111,40 +111,6 @@ class SolrAI extends SolrDefault implements return $this->getAIRecord('rft.issue'); } - - /** - * Get an array of publication detail of first entry combined from - * place, publisher and data. - * - * @return array - */ - /*public function getFirstPublicationDetails() - { - $place = $this->getPlacesOfPublication(); - $date = $this->getPublicationDates(); - $array = array(); - if (isset($this->fields['format']) && is_array($this->fields['format'])) { - $array['issue'] = (isset($this->fields['hierarchy_parent_title']) ? - 'In: '.$this->fields['hierarchy_parent_title'][0] : ''); - $array['date'] = ((is_array($date) && (count($date) > 0) ? - $date[0] : '')); - switch ((count($this->fields['format']) > 0) ? - $this->fields['format'][0] : '') { - case 'eBook': - $array['place'] = ((is_array($place) && (count($place) > 0) ? - $place[0] : '')); - break; - case 'ElectronicArticle': - $array['place'] = ''; - break; - default: - break; - } - } - - return $array; - }*/ - /** * Has FirstPublicationsDetails a Date in it * @@ -240,8 +206,9 @@ class SolrAI extends SolrDefault implements * "Published in" line in RecordDriver core.phtml * * @return array + * @todo revision of method due */ - public function getAIDataIn() + public function getPublishedIn() { return [ 'jtitle' => $this->getJTitle(), @@ -340,7 +307,7 @@ class SolrAI extends SolrDefault implements } /** - * Return the jtitle field of ai records + * Return the rft.jtitle field of ai records * * @return array Return jtitle fields. */ @@ -350,9 +317,9 @@ class SolrAI extends SolrDefault implements } /** - * Return the jtitle field of ai records + * Return the rft.atitle field of ai records * - * @return array Return jtitle fields. + * @return array Return atitle fields. */ public function getATitle() { @@ -360,9 +327,9 @@ class SolrAI extends SolrDefault implements } /** - * Return the jtitle field of ai records + * Return the rft.btitle field of ai records * - * @return array Return jtitle fields. + * @return array Return btitle fields. */ public function getBTitle() { diff --git a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..de1180469102f55b32b4bdc84301a3b3c0a6834b --- /dev/null +++ b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php @@ -0,0 +1,640 @@ +<?php +/** + * Factory for record driver data formatting view helper + * + * PHP version 5 + * + * Copyright (C) Villanova University 2016. + * Copyright (C) The National Library of Finland 2017. + * + * 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 View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @author Konsta Raunio <konsta.raunio@helsinki.fi> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:architecture:record_data_formatter + * Wiki + */ +namespace finc\View\Helper\Root; + +use VuFind\View\Helper\Root\RecordDataFormatter; + +/** + * Factory for record driver data formatting view helper + * + * @category VuFind + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @author Konsta Raunio <konsta.raunio@helsinki.fi> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:architecture:record_data_formatter + * Wiki + */ +class RecordDataFormatterFactory +{ + /** + * Create the helper. + * + * @return RecordDataFormatter + */ + public function __invoke() + { + $helper = new RecordDataFormatter(); + + $helper->setDefaults('core', [$this, 'getDefaultCoreSpecs']); + $helper->setDefaults( + 'description', [$this, 'getDefaultDescriptionSpecs'] + ); + + $helper->setDefaults('core-ai', [$this, 'getAiCoreSpecs']); + + $helper->setDefaults('core-lido', [$this, 'getLidoCoreSpecs']); + $helper->setDefaults( + 'description-lido', [$this, 'getLidoDescriptionSpecs'] + ); + + $helper->setDefaults('core-marc', [$this, 'getMarcCoreSpecs']); + return $helper; + } + + /** + * Get default specifications for displaying data in core metadata. + * + * @return array + */ + public function getAiCoreSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Journal Title', 'getContainerTitle', 'data-containerTitle.phtml' + ); + $spec->setTemplateLine( + 'Authors/Corporations', + 'getDeduplicatedAuthors', + 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ] + ] + ); + $spec->setLine( + 'Edition', 'getEdition', null, + ['prefix' => '<span property="bookEdition">', 'suffix' => '</span>'] + ); + $spec->setTemplateLine( + 'In', + 'getJTitle', + 'data-jTitle.phtml' + ); + $spec->setLine( + 'Format', 'getFormats', 'RecordHelper', + ['helperMethod' => 'getFormatList'] + ); + $spec->setTemplateLine( + 'Language', 'getLanguages', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Published', + 'getPublicationDetails', + 'data-publicationDetails.phtml' + ); + $spec->setLine( + 'Series', 'getSeries', null, ['recordLink' => 'series'] + ); + $spec->setTemplateLine( + 'Subjects', 'getAllSubjectHeadings', 'data-allSubjectHeadings.phtml' + ); + $spec->setTemplateLine( + 'child_records', 'getChildRecordCount', 'data-childRecords.phtml', + ['allowZero' => false] + ); + $spec->setTemplateLine( + 'Online Access', true, 'data-onlineAccess.phtml' + ); + $spec->setTemplateLine( + 'Related Items', 'getAllRecordLinks', 'data-allRecordLinks.phtml' + ); + $spec->setTemplateLine('Tags', true, 'data-tags.phtml'); + return $spec->getArray(); + } + + + /** + * Get default specifications for displaying data in core metadata. + * + * @return array + */ + public function getDefaultCoreSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Published in', 'getContainerTitle', 'data-containerTitle.phtml' + ); + $spec->setLine( + 'New Title', 'getNewerTitles', null, ['recordLink' => 'title'] + ); + $spec->setLine( + 'Previous Title', 'getPreviousTitles', null, ['recordLink' => 'title'] + ); + $spec->setTemplateLine( + 'Authors/Corporations', 'getDeduplicatedAuthors', 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ] + ] + ); + $spec->setTemplateLine( + 'Title', 'getTitleDetails', 'data-titleDetails.phtml' + ); + $spec->setTemplateLine( + 'Title Uniform', 'getTitleUniform', 'data-titleUniform.phtml', + [ + 'labelFunction' => function() { return null; } + ] + ); + $spec->setLine( + 'Edition', 'getEdition', null, + ['prefix' => '<span property="bookEdition">', 'suffix' => '</span>'] + ); + $spec->setLine( + 'Dissertation Note', + 'getDissertationNote', + 'data-escapeHtmlCommaSep.phtml' + ); + $spec->setLine( + 'Format', 'getFormats', 'RecordHelper', + ['helperMethod' => 'getFormatList'] + ); + $spec->setTemplateLine( + 'Language', 'getLanguages', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Published', + 'getPublicationDetails', + 'data-publicationDetails.phtml' + ); + $spec->setTemplateLine( + 'Set Multipart', + 'getHierarchyParentTitle', + 'data-hierarchyParentTitle.phtml' + ); + $spec->setTemplateLine( + 'Subjects', 'getAllSubjectHeadings', 'data-allSubjectHeadings.phtml' + ); + $spec->setTemplateLine( + 'child_records', 'getChildRecordCount', 'data-childRecords.phtml', + ['allowZero' => false] + ); + $spec->setTemplateLine('Online Access', true, 'data-onlineAccess.phtml'); + $spec->setTemplateLine( + 'Related Items', 'getAllRecordLinks', 'data-allRecordLinks.phtml' + ); + $spec->setTemplateLine( + 'Additionals', + 'getAdditionals', + 'data-additionals.phtml', + [ + 'labelFunction' => function() { return null; } + ] + ); + $spec->setTemplateLine( + 'Source', + 'getMegaCollection', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + null, + 'getOtherRelationshipEntry', + 'data-otherRelationshipEntry.phtml', + [ + + ] + ); + $spec->setTemplateLine( + 'Notes', + 'getAdditionalNotes', + 'data-escapeHtml.phtml', + [ + 'useCache' => true + ] + ); + $spec->setTemplateLine('Tags', true, 'data-tags.phtml'); + return $spec->getArray(); + } + + /** + * Get default specifications for displaying data in the description tab. + * + * @return array + */ + public function getDefaultDescriptionSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Summary', 'getSummary', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Dates of publication', 'getDateSpan', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Item Description', 'getGeneralNotes', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Physical Description', + 'getPhysicalDescriptions', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Publication Frequency', + 'getPublicationFrequency', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Playing Time', 'getPlayingTimes', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Format', 'getSystemDetails', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Audience', 'getTargetAudienceNotes', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Awards', 'getAwards', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Production Credits', + 'getProductionCredits', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Bibliography', 'getBibliographyNotes', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'ISBN', 'getISBNs', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'ISSN', 'getISSNs', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'DOI', 'getCleanDOI', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'EISSN', 'getEISSNs', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Related Items', 'getRelationshipNotes', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Access', 'getAccessRestrictions', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Finding Aid', 'getFindingAids', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Publication_Place', + 'getHierarchicalPlaceNames', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Author Notes', true, 'data-authorNotes.phtml' + ); + $spec->setTemplateLine( + 'Call Number', + 'getLocalSignature', + 'data-localSignature.phtml' + ); + $spec->setTemplateLine( + 'Notes', + 'getAdditionalNotes', + 'data-escapeHtml.phtml', + [ + 'useCache' => true + ] + ); + return $spec->getArray(); + } + + /** + * Get default specifications for displaying data in collection-info metadata. + * + * @return array + */ + public function getLidoCoreSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Originators', 'getDeduplicatedAuthors', 'data-authors.phtml', + [ + 'useCache' => true, + 'labelFunction' => function ($data) { + return count($data['main']) > 1 + ? 'Originators' : 'Originator'; + }, + 'context' => [ + 'type' => 'main', + 'schemaLabel' => 'author', + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ], + ] + ); + $spec->setTemplateLine( + 'Corporate Originator', 'getDeduplicatedAuthors', 'data-authors.phtml', + [ + 'useCache' => true, + 'labelFunction' => function ($data) { + return count($data['corporate']) > 1 + ? 'Corporate Originators' : 'Corporate Originator'; + }, + 'context' => [ + 'type' => 'corporate', + 'schemaLabel' => 'creator', + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ], + ] + ); + $spec->setTemplateLine( + 'Other Originators', 'getDeduplicatedAuthors', 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'type' => 'secondary', + 'schemaLabel' => 'contributor', + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ], + ] + ); + $spec->setTemplateLine( + 'Subject Detail', 'getSubjectDetails', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordSubjects'] + ] + ); + $spec->setTemplateLine( + 'Subject Place', 'getSubjectPlaces', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordSubjects'] + ] + ); + $spec->setTemplateLine( + 'Subject Date', 'getSubjectDates', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordSubjects'] + ] + ); + + $spec->setTemplateLine( + 'Subject Actor', 'getSubjectActors', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordSubjects'] + ] + ); + $spec->setTemplateLine( + 'Institution', 'getInstitutions', 'data-institutions.phtml', + [ + 'context' => ['class' => 'recordInstitution'] + ] + ); + $spec->setTemplateLine( + 'Inventory ID', 'getIdentifier', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordIdentifier'] + ] + ); + $spec->setTemplateLine( + 'Inventory ID', 'getIdentifier', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordIdentifier'] + ] + ); + $spec->setTemplateLine( + 'Measurements', 'getMeasurements', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordMeasurements'] + ] + ); + $spec->setTemplateLine( + 'Measurements', + 'getMeasurementsDescription', + 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordMeasurements'] + ] + ); + $spec->setTemplateLine( + 'Collection', 'getCollections', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordCollection'] + ] + ); + $spec->setLine( + 'Object type', 'getFormats', 'RecordHelper', + ['helperMethod' => 'getFormatList'] + ); + $spec->setTemplateLine( + 'Other Classification', + 'getFormatClassifications', + 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordClassifications'] + ] + ); + $spec->setTemplateLine( + 'Other ID', 'getLocalIdentifiers', 'data-escapeHtml.phtml', + [ + 'context' => ['class' => 'recordIdentifiers'] + ] + ); + $spec->setTemplateLine( + 'Events', true, 'data-events.phtml', + [ + 'labelFunction' => function() { return null; } + ] + ); + // , context: "recordEvents" + $spec->setTemplateLine( + 'Language', 'getLanguages','data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Time of origin', 'getDateSpan', 'data-dateSpan.phtml' + ); + $spec->setTemplateLine('Edition', 'getEdition', 'data-escapeHtml.phtml', + [ + 'prefix' => '<span property="bookEdition">', + 'suffix' => '</span>' + ] + ); + $spec->setTemplateLine( + 'Subjects', 'getAllSubjectHeadings', 'data-allSubjectHeadings.phtml' + ); + $spec->setTemplateLine('Online Access', true, 'data-onlineAccess.phtml'); + $spec->setTemplateLine( + 'Related Items', 'getAllRecordLinks', 'data-allRecordLinks.phtml' + ); + return $spec->getArray(); + } + + /** + * Get default specifications for displaying data in collection-record metadata. + * + * @return array + */ + public function getLidoDescriptionSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Time of origin', 'getDateSpan', 'data-dateSpan.phtml' + ); + $spec->setTemplateLine( + 'Access', 'getAccessNote','data-accessNote.phtml' + ); + return $spec->getArray(); + } + + /** + * Get marc specifications for displaying data in core metadata. + * + * @return array + */ + public function getMarcCoreSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Published in', 'getContainerTitle', 'data-containerTitle.phtml' + ); + $spec->setLine( + 'New Title', 'getNewerTitles', null, ['recordLink' => 'title'] + ); + $spec->setLine( + 'Previous Title', + 'getPreviousTitles', + null, + [ + 'recordLink' => 'title' + ] + ); + $spec->setTemplateLine( + 'Authors/Corporations', + 'getDeduplicatedAuthors', + 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ] + ] + ); + $spec->setTemplateLine( + 'Title', 'getTitleDetails', 'data-titleDetails.phtml' + ); + $spec->setTemplateLine( + 'Title Uniform', 'getTitleUniform', 'data-titleUniform.phtml', + [ + 'labelFunction' => function() { return null; } + ] + ); + $spec->setLine( + 'Edition', 'getEdition', null, + ['prefix' => '<span property="bookEdition">', 'suffix' => '</span>'] + ); + $spec->setLine( + 'Dissertation Note', + 'getDissertationNote', + 'data-escapeHtmlCommaSep.phtml' + ); + $spec->setLine( + 'Format', 'getFormats', 'RecordHelper', + ['helperMethod' => 'getFormatList'] + ); + $spec->setTemplateLine( + 'Language', 'getLanguages', 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Published', + 'getPublicationDetails', + 'data-publicationDetails.phtml' + ); + $spec->setTemplateLine( + 'German Prints Index Number', + 'getIndexOfGermanPrints', + 'data-publicationDetails.phtml' + ); + $spec->setTemplateLine( + 'Set Multipart', + 'getHierarchyParentTitle', + 'data-hierarchyParentTitle.phtml' + ); + $spec->setTemplateLine( + 'Subjects', 'getAllSubjectHeadings', 'data-allSubjectHeadings.phtml' + ); + $spec->setTemplateLine( + 'child_records', 'getChildRecordCount', 'data-childRecords.phtml', + ['allowZero' => false] + ); + $spec->setTemplateLine('Online Access', true, 'data-onlineAccess.phtml'); + $spec->setTemplateLine( + 'Related Items', 'getAllRecordLinks', 'data-allRecordLinks.phtml' + ); + $spec->setTemplateLine( + 'Local Subjects', + 'getLocalSubjects', + 'data-localSubjects.phtml', + [ + 'labelFunction' => function() { return 'Subject'; } + ] + ); + $spec->setTemplateLine( + 'Source', + 'getMegaCollection', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'OtherRelationshipEntry', + 'getOtherRelationshipEntry', + 'data-otherRelationshipEntry.phtml', + [ + 'labelFunction' => function() { return null; } + ] + ); + $spec->setTemplateLine( + 'Notes', + 'getAdditionalNotes', + 'data-escapeHtml.phtml', + [ + 'useCache' => true + ] + ); + $spec->setTemplateLine('Tags', true, 'data-tags.phtml'); + return $spec->getArray(); + } + + +} diff --git a/themes/finc/js/check_item_statuses.js b/themes/finc/js/check_item_statuses.js index a8dd205a8b8fddc94bffa3ac90525c0e335e69b5..8741775e9b40a808c20a1fe7c67f5fc2f18f00d8 100644 --- a/themes/finc/js/check_item_statuses.js +++ b/themes/finc/js/check_item_statuses.js @@ -1,119 +1,162 @@ -/*global VuFind */ +/*global Hunt, VuFind */ + +/*exported checkItemStatuses, itemStatusFail */ + function linkCallnumbers(callnumber, callnumber_handler) { if (callnumber_handler) { var cns = callnumber.split(',\t'); for (var i = 0; i < cns.length; i++) { cns[i] = '<a href="' + VuFind.path + '/Alphabrowse/Home?source=' + encodeURI(callnumber_handler) + '&from=' + encodeURI(cns[i]) + '">' + cns[i] + '</a>'; - } + } return cns.join(',\t'); } return callnumber; } -function checkItemStatuses(_container) { - var container = _container || $('body'); - - var elements = {}; - var data = $.map(container.find('.ajaxItem'), function ajaxItemMap(record) { - if ($(record).find('.hiddenId').length === 0) { - return null; - } - var datum = $(record).find('.hiddenId').val(); - if (typeof elements[datum] === 'undefined') { - elements[datum] = $(); +function displayItemStatus(result, $item) { + $item.removeClass('js-item-pending'); + $item.find('.status').empty().append(result.availability_message); + $item.find('.ajax-availability').removeClass('ajax-availability hidden'); + if (typeof(result.full_status) != 'undefined' + && result.full_status.length > 0 + && $item.find('.callnumAndLocation').length > 0 + ) { + // Full status mode is on -- display the HTML and hide extraneous junk: + $item.find('.callnumAndLocation').empty().append(result.full_status); + $item.find('.callnumber,.hideIfDetailed,.location,.status').addClass('hidden'); + } else if (typeof(result.missing_data) != 'undefined' + && result.missing_data + ) { + // No data is available -- hide the entire status area: + $item.find('.callnumAndLocation,.status').addClass('hidden'); + } else if (result.locationList) { + // We have multiple locations -- build appropriate HTML and hide unwanted labels: + $item.find('.callnumber,.hideIfDetailed,.location').addClass('hidden'); + var locationListHTML = ""; + for (var x = 0; x < result.locationList.length; x++) { + locationListHTML += '<div class="groupLocation">'; + if (result.locationList[x].availability) { + locationListHTML += '<span class="text-success"><i class="fa fa-ok" aria-hidden="true"></i> ' + + result.locationList[x].location + '</span> '; + } else if (typeof(result.locationList[x].status_unknown) !== 'undefined' + && result.locationList[x].status_unknown + ) { + if (result.locationList[x].location) { + locationListHTML += '<span class="text-warning"><i class="fa fa-status-unknown" aria-hidden="true"></i> ' + + result.locationList[x].location + '</span> '; + } + } else { + locationListHTML += '<span class="text-danger"><i class="fa fa-remove" aria-hidden="true"></i> ' + + result.locationList[x].location + '</span> '; + } + locationListHTML += '</div>'; + locationListHTML += '<div class="groupCallnumber">'; + locationListHTML += (result.locationList[x].callnumbers) + ? linkCallnumbers(result.locationList[x].callnumbers, result.locationList[x].callnumber_handler) : ''; + locationListHTML += '</div>'; } - elements[datum] = elements[datum].add($(record)); - return datum; - }); - if (!data.length) { + $item.find('.locationDetails').removeClass('hidden'); + $item.find('.locationDetails').html(locationListHTML); + // next three lines finc-specific, added in #5737, check functionality, CK + } else if (result.callnumber.length == 0 && result.location.length == 0) { + // hide location and callnumber information if both are empty + $item.find('.callnumAndLocation').addClass('hidden'); + } else { + // Default case -- load call number and location into appropriate containers: + $item.find('.callnumber').empty().append(linkCallnumbers(result.callnumber, result.callnumber_handler) + '<br/>'); + $item.find('.location').empty().append( + result.reserve === 'true' + ? result.reserve_message + : result.location + ); + } +} + +function itemStatusFail(response, textStatus) { + if (textStatus === 'abort' || typeof response.responseJSON === 'undefined') { return; } + // display the error message on each of the ajax status place holder + $('.js-item-pending').addClass('text-danger').append(response.responseJSON.data); +} - $(".ajax-availability").removeClass('hidden'); +var itemStatusIds = []; +var itemStatusEls = {}; +var itemStatusTimer = null; +var itemStatusDelay = 200; +var itemStatusRunning = false; + +function runItemAjaxForQueue() { + // Only run one item status AJAX request at a time: + if (itemStatusRunning) { + itemStatusTimer = setTimeout(runItemAjaxForQueue, itemStatusDelay); + return; + } + itemStatusRunning = true; $.ajax({ dataType: 'json', method: 'POST', url: VuFind.path + '/AJAX/JSON?method=getItemStatuses', - data: {'id':data} + data: {'id': itemStatusIds} }) - .done(function checkItemStatusDone(response) { - $.each(response.data, function checkItemDoneEach(i, result) { - var item = elements[result.id]; - if (!item) { - return; - } - - item.find('.status').empty().append(result.availability_message); - if (typeof(result.full_status) != 'undefined' - && result.full_status.length > 0 - && item.find('.callnumAndLocation').length > 0 - ) { - // Full status mode is on -- display the HTML and hide extraneous junk: - item.find('.callnumAndLocation').empty().append(result.full_status); - item.find('.callnumber').addClass('hidden'); - item.find('.location').addClass('hidden'); - item.find('.hideIfDetailed').addClass('hidden'); - item.find('.status').addClass('hidden'); - } else if (typeof(result.missing_data) != 'undefined' - && result.missing_data - ) { - // No data is available -- hide the entire status area: - item.find('.callnumAndLocation').addClass('hidden'); - item.find('.status').addClass('hidden'); - } else if (result.locationList) { - // We have multiple locations -- build appropriate HTML and hide unwanted labels: - item.find('.callnumber').addClass('hidden'); - item.find('.hideIfDetailed').addClass('hidden'); - item.find('.location').addClass('hidden'); - var locationListHTML = ""; - for (var x=0; x<result.locationList.length; x++) { - locationListHTML += '<div class="groupLocation">'; - if (result.locationList[x].availability) { - locationListHTML += '<i class="fa fa-ok text-success" aria-hidden="true"></i> <span class="text-success">' - + result.locationList[x].location + '</span> '; - } else if (typeof(result.locationList[x].status_unknown) !== 'undefined' - && result.locationList[x].status_unknown - ) { - if (result.locationList[x].location) { - locationListHTML += '<i class="fa fa-status-unknown text-warning" aria-hidden="true"></i> <span class="text-warning">' - + result.locationList[x].location + '</span> '; - } - } else { - locationListHTML += '<i class="fa fa-remove text-danger" aria-hidden="true"></i> <span class="text-danger"">' - + result.locationList[x].location + '</span> '; - } - locationListHTML += '</div>'; - locationListHTML += '<div class="groupCallnumber">'; - locationListHTML += (result.locationList[x].callnumbers) - ? linkCallnumbers(result.locationList[x].callnumbers, result.locationList[x].callnumber_handler) : ''; - locationListHTML += '</div>'; - } - item.find('.locationDetails').removeClass('hidden'); - item.find('.locationDetails').empty().append(locationListHTML); - } else if (result.callnumber.length == 0 && result.location.length == 0) { - // hide location and callnumber information if both are empty - item.find('.callnumAndLocation').addClass('hidden'); - } else { - // Default case -- load call number and location into appropriate containers: - item.find('.callnumber').empty().append(linkCallnumbers(result.callnumber, result.callnumber_handler) + '<br/>'); - item.find('.location').empty().append( - result.reserve === 'true' - ? result.reserve_message - : result.location - ); + .done(function checkItemStatusDone(response) { + for (var j = 0; j < response.data.length; j++) { + displayItemStatus(response.data[j], itemStatusEls[response.data[j].id]); + itemStatusIds.splice(itemStatusIds.indexOf(response.data[j].id), 1); } + itemStatusRunning = false; + }) + .fail(function checkItemStatusFail(response, textStatus) { + itemStatusFail(response, textStatus); + itemStatusRunning = false; }); +} - $(".ajax-availability").removeClass('ajax-availability'); - }) - .fail(function checkItemStatusFail(response, textStatus) { - $('.ajax-availability').empty(); - if (textStatus === 'abort' || typeof response.responseJSON === 'undefined') { return; } - // display the error message on each of the ajax status place holder - $('.ajax-availability').append(response.responseJSON.data).addClass('text-danger'); - }); +function itemQueueAjax(id, el) { + if (el.hasClass('js-item-pending')) { + return; + } + clearTimeout(itemStatusTimer); + itemStatusIds.push(id); + itemStatusEls[id] = el; + itemStatusTimer = setTimeout(runItemAjaxForQueue, itemStatusDelay); + el.addClass('js-item-pending').removeClass('hidden'); + el.find('.status').removeClass('hidden'); } +function checkItemStatus(el) { + var $item = $(el); + if ($item.find('.hiddenId').length === 0) { + return false; + } + var id = $item.find('.hiddenId').val(); + itemQueueAjax(id + '', $item); +} + +function checkItemStatuses(_container) { + var container = _container instanceof Element + ? _container + : document.body; + + var ajaxItems = $(container).find('.ajaxItem'); + for (var i = 0; i < ajaxItems.length; i++) { + var id = $(ajaxItems[i]).find('.hiddenId').val(); + itemQueueAjax(id, $(ajaxItems[i])); + } + // Stop looking for a scroll loader + if (itemStatusObserver) { + itemStatusObserver.disconnect(); + } +} + +var itemStatusObserver = null; $(document).ready(function checkItemStatusReady() { - checkItemStatuses(); + if (typeof Hunt === 'undefined') { + checkItemStatuses(); + } else { + itemStatusObserver = new Hunt( + $('.ajaxItem').toArray(), + {enter: checkItemStatus} + ); + } }); diff --git a/themes/finc/js/openurl.js b/themes/finc/js/openurl.js index ae4358d1e31e06217d17d3fe66ffe1673212dcee..a103e375c61dc68a2ac4b7874a6f3b26e2197e24 100644 --- a/themes/finc/js/openurl.js +++ b/themes/finc/js/openurl.js @@ -1,27 +1,32 @@ -/*global extractClassParams, VuFind */ +/*global extractClassParams, Hunt, VuFind */ +/* Finc has its own specific 'resolvertype', make sure it is included when updating, CK */ VuFind.register('openurl', function OpenUrl() { - var _loadResolverLinks = function($target, openUrl, searchClassId, resolvertype) { + function _loadResolverLinks($target, openUrl, searchClassId, resolvertype) { $target.addClass('ajax_availability'); var url = VuFind.path + '/AJAX/JSON?' + $.param({ - method:'getResolverLinks', - openurl:openUrl, - searchClassId:searchClassId, - resolvertype:resolvertype}); + method: 'getResolverLinks', + openurl: openUrl, + searchClassId: searchClassId, + resolvertype: resolvertype + }); $.ajax({ dataType: 'json', url: url }) - .done(function getResolverLinksDone(response) { - $target.removeClass('ajax_availability').empty().append(response.data); - }) - .fail(function getResolverLinksFail(response, textStatus) { - $target.removeClass('ajax_availability').addClass('text-danger').empty(); - if (textStatus === 'abort' || typeof response.responseJSON == 'undefined') { return; } - $target.append(response.responseJSON.data); - }); + .done(function getResolverLinksDone(response) { + $target.removeClass('ajax_availability').empty().append(response.data); + }) + .fail(function getResolverLinksFail(response, textStatus) { + $target.removeClass('ajax_availability').addClass('text-danger').empty(); + if (textStatus === 'abort' || typeof response.responseJSON == 'undefined') { + return; + } + $target.append(response.responseJSON.data); + }); } - function embedOpenUrlLinks(element) { + function embedOpenUrlLinks(el) { + var element = $(el); // Extract the OpenURL associated with the clicked element: var openUrl = element.children('span.openUrl:first').attr('title'); @@ -32,7 +37,7 @@ VuFind.register('openurl', function OpenUrl() { // Locate the target area for displaying the results: var target = controls.next('div.resolver'); - // To chose the right resolver we have to get the resolvertype: + // finc-specific, #5334; To chose the right resolver we have to get the resolvertype: var resolvertype = element.children('span.resolvertype:first').attr('title'); // If the target is already visible, a previous click has populated it; @@ -56,12 +61,20 @@ VuFind.register('openurl', function OpenUrl() { // assign action to the openUrlEmbed link class container.find('.openUrlEmbed a').unbind('click').click(function openUrlEmbedClick() { - embedOpenUrlLinks($(this)); + embedOpenUrlLinks(this); return false; }); - container.find('.openUrlEmbed.openUrlEmbedAutoLoad a').trigger('click'); + if (typeof Hunt === 'undefined') { + container.find('.openUrlEmbed.openUrlEmbedAutoLoad a').trigger('click'); + } else { + new Hunt( + container.find('.openUrlEmbed.openUrlEmbedAutoLoad a').toArray(), + {enter: embedOpenUrlLinks} + ); + } } + return { init: init, embedOpenUrlLinks: embedOpenUrlLinks diff --git a/themes/finc/scss/_customVariables.scss b/themes/finc/scss/_customVariables.scss index db702e66fd6b2b8d1c83cdc2c32d2d38aa737622..c85a24a6039b3d625215bfbef8153f023a7c585a 100644 --- a/themes/finc/scss/_customVariables.scss +++ b/themes/finc/scss/_customVariables.scss @@ -61,6 +61,7 @@ $state-info-bg: $brand-info !default; $state-warning-text: $state-light-text-on-dark !default; $state-warning-bg: $brand-warning !default; +$alert-warning-bkg: $brand-warning !default; // $state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default; $state-danger-text: $state-light-text-on-dark !default; // NOTE: this renders the text white -- requires red background! @@ -107,8 +108,8 @@ $btn-transparent-border: $border-color !default; $badge-bg: transparent !default; $badge-color: $jet !default; $badge-font-weight: normal !default; -$badge-link-color: $brand-primary !default; -$badge-link-hover-color: $brand-danger !default; +$badge-link-color: $brand-danger !default; +$badge-link-hover-color: saturate($brand-danger, 50%) !default; ////// Sidebar Badge/fa Colors $sidebar-badge-fa-color: darken($brand-secondary, 40%) !default; @@ -163,14 +164,17 @@ $grid-gutter-width: 30px !default; //// When using 'affix' instead of 'navbar-fixed-top', set '$navbar-height', '$navbar-height-xs' and '$navbar-height-sm' to '=0' //// or set the paddings-top under 'body' in compiled.scss to '=0'; see also the comment in header.phtml $navbar-height: 80px !default; -$navbar-height-sm: $navbar-height / 2 !default; +$navbar-height-sm: $navbar-height !default; //// Set navbar-height for small devices, USE px as rem will throw an error in conjunction _variables.scss -$navbar-height-xs: $navbar-height / 3 !default; -$navbar-max-height-xs: 40px; +$navbar-height-xs: $navbar-height + 40px !default; +$navbar-max-height-xs: $navbar-height + 40px !default; //// Top-padding for #content -> .row first-of-type (and .sidebar) - change this value to change both; //// sidebar gets an additional padding on half the content-top-padding for better horizontal alignment -$content-top-padding: $grid-gutter-width / 4 !default; +$content-top-padding: $grid-gutter-width / 2 !default; + +//// Sidebar item padding +$sidebar-item-padding: .75em 1em !default; //// MODAL dimensions $modal-lg: 900px !default; @@ -205,6 +209,9 @@ $label-radius: 0 !default; // ALIGNMENTS +//// Align tops of elements to transparent button-content in same row (e.g. header: searchbox content + navigation on right-hand side) +$button-top-padding: 6px; + //// Text alignment 'more'-toggles in sidebar; //// default is center. If center alignment is desired, comment out this next line //// and the '.narrow-toggle ...' in compiled.scss @@ -221,7 +228,7 @@ $narrow-toggle-text-alignment: left !default; // ALIGNMENTS - END // FUNCTIONS -//// em Calculator (just write the desired px into the function call, like so font-size: em(12) or em(12px) +//// em Calculator (just write the desired px into the function call, like so: font-size: em(12) or em(12px) @function em($pixels, $context: $font-size-base) { @if (unitless($pixels)) { $pixels: $pixels * 1px; diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 30003eb8d3ebf58a03bc35f5b8bdaff7572c5061..bbf32a464358bcddce10c2c31ba0c03860444132 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -17,10 +17,10 @@ // $brand-warning: #f08a24 !default; // carrot // 1.2 DO NOT define site-specific colours in finc - this will be done in site-specific themes // 2. For Media queries use: -// Extra small screen / phone: '$screen-xs-min' (480px); -// Small screen / tablet: '$screen-sm-min' (768px); -// Medium screen / desktop: '$screen-md-min' (992px) and -// Large screen / wide desktop: '$screen-lg-min' (1200px); +// Extra small screen / phone: '$screen-xs-min' (=480px); +// Small screen / tablet: '$screen-sm-min' (=768px); +// Medium screen / desktop: '$screen-md-min' (=992px) and +// Large screen / wide desktop: '$screen-lg-min' (=1200px); // The maximum ranges are defined as the next higher element minus 1px, so: // '$screen-xs-max' = $screen-sm-min - 1 // etc: you can use '$screen-xs-max', '$screen-sm-max' and '$screen-md-max' @@ -33,7 +33,7 @@ // Allow us to use sections that act as rows section { - @include make-row(); + @include make-row; } // PLEASE ORGANIZE YOUR CSS ACCORDING TO THIS GENERAL RULE - keep exceptions to a minimum @@ -61,7 +61,7 @@ section { // .foo { // border: 1px solid red; // margin-left: 1em; -// padding: 0 $grid-gutter-width / 2; +// padding: 0 ($grid-gutter-width / 2); // width: auto; // } // @@ -112,10 +112,12 @@ h3 { //// h4 ////// H4 atop Sidebar - align to limit and sort .sidebar h4 { - margin-top: .25em; + margin-top: 0; + // keep level with left-hand content @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { font-size: $font-size-base + 2px; + margin-top: ($grid-gutter-width / 2); } } @@ -149,16 +151,16 @@ h3 { border: 1px solid $brand-secondary; // make columns adapt to content table-layout: auto; +} - // Remove top borders (_tables.scss) - > thead, - > tbody, - > tfoot { - > tr { - > th, - > td { - border-top: 0; - } +// Remove top borders (_tables.scss) +thead, +tbody, +tfoot { + > tr { + > th, + > td { + border-top: 0; } } } @@ -178,12 +180,12 @@ form { // For INLINE, left-floated 'hits per page' and 'sort by' selectors use &.limit, - &.sort { + &.search-sort { float: left; } &.limit { - margin-right: $grid-gutter-width / 2; + margin-right: ($grid-gutter-width / 2); } // limit the width of the select field if necessary - more select details below @@ -201,7 +203,7 @@ form { } .form-control { - max-width: 400px; + max-width: em(400px); } } @@ -209,30 +211,23 @@ form { fieldset { border: 1px solid $border-color; - // Advanced Search - make fieldsets fit in a row (see last-of-type and &col-sm-4 below) + // Advanced Search - make fieldsets fit in a row (see last-of-type below) .template-name-advanced & { - margin-right: $grid-gutter-width / 2; margin-top: $grid-gutter-width; - padding-bottom: $grid-gutter-width / 2; + padding-bottom: ($grid-gutter-width / 2); + padding-left: ($grid-gutter-width / 2); + + // Advanced Search - make fieldsets fit in a row (see margin-right above below) + &:nth-of-type(3) { + margin-left: ($grid-gutter-width / 2); + margin-right: ($grid-gutter-width / 2); + width: 30.25%; + } - // Advanced Search - make fieldsets fit in a row (see margin-right above and &col-sm-4 below) &:last-of-type { float: right; margin-right: 0; } - - // Advanced Search - make 3 fieldsets fit in a row ( see margin-right and last-of-type above) - @media (min-width: $screen-sm-min) { - &.col-sm-4 { - width: (33.3333333333% - 10.5%); - } - } - - @media (min-width: $screen-md-min) { - &.col-sm-4 { - width: (33.3333333333% - 1.5%); - } - } } } @@ -243,8 +238,8 @@ legend { font-size: ($font-size-base * 1.25); margin-bottom: 0; // margin-top: $grid-gutter-width; - padding-left: $grid-gutter-width / 2; - padding-right: $grid-gutter-width / 2; + padding-left: ($grid-gutter-width / 2); + padding-right: ($grid-gutter-width / 2); width: auto; } @@ -253,12 +248,12 @@ legend { //// input {} input[type='email'] { border: $border-default-styles; - padding: $grid-gutter-width / 4; + padding: ($grid-gutter-width / 4); } input[type='text'] { border: $border-default-styles; - padding: $grid-gutter-width / 4; + padding: ($grid-gutter-width / 4); } //// Select - for limit and sort-select widths see above @@ -349,6 +344,7 @@ select { display: block; } } + //// OR use on ALL dropdowns like so //.dropdown:hover .dropdown-menu { // display: block; @@ -365,6 +361,7 @@ select { .alert-success, .alert-info, .alert-danger { + clear: both; color: $state-light-text-on-dark; &:hover { @@ -374,23 +371,26 @@ select { .text-danger { background-color: $brand-danger; - padding: $grid-gutter-width / 8; + padding: ($grid-gutter-width / 8); } //// Off-Canvas @media only screen and (max-width: $screen-xs-max) { body.offcanvas .offcanvas-toggle { - background: $brand-primary; + background: transparentize($brand-primary, .2); color: $white; display: block; + height: auto; + line-height: normal; padding: 1.5rem 0; position: fixed; text-align: center; top: 50%; - width: calc(2em - 5px); + width: calc(2em - 1px); z-index: 5; } } + //// Off-Canvas - END //// DATE-RANGE slider (CSS is included in bootstrap-slider.min.css - currently no SCSS version!) @@ -407,7 +407,6 @@ select { width: 1em; } - //// Transparent BUTTONs (Button with border and darker text on light or white BGs) .btn-transparent { @include button-variant($btn-transparent-color, $btn-transparent-bg, $btn-transparent-border); @@ -423,7 +422,7 @@ select { .accordion-toggler { background: $toggler; display: block; - padding: $grid-gutter-width / 2; + padding: ($grid-gutter-width / 2); text-align: left; width: 100%; @@ -459,6 +458,7 @@ select { table.collapse.in { display: table; } + //// Collapse on tables - END //// Source-id branding (WISO etc) @@ -468,12 +468,13 @@ table.collapse.in { &.SID48 { background: url('../images/wiso-transparent-70x20.png') 0 0 no-repeat; display: inline-block; - height: 20px; + font-size: 100%; // important to render width and height correctly + height: em(20px); margin-left: .2em; - //margin-top: $grid-gutter-width / 8; + //margin-top: ($grid-gutter-width / 8); margin-top: 0; vertical-align: middle; - width: 70px; + width: em(70px); } } @@ -633,6 +634,24 @@ table.collapse.in { position: absolute; } +// Flex container for wrapping flex elements, such als header +.flex-container { + @media (min-width: $grid-float-breakpoint) { + display: flex; + } +} + +//// we need to reverse order of the child elements (searchbox + navbar) on anything but mobile for the mobile menu to work as xpected +@media (min-width: $screen-sm-min) { + .flex-container > *:first-child { + order: 2; + } + + .flex-container > *:nth-child(2) { + order: 1; + } +} + //// force inline display .inline { display: inline; @@ -648,9 +667,15 @@ table.collapse.in { } //// Gutters / No-Gutters; Margins / No-margins +////// NO Gutter/Padding at all +.no-gutter-all { + padding: 0 !important; +} + +////// No LEFT and RIGHT gutters .no-gutter { - padding-left: 0; - padding-right: 0; + padding-left: 0 !important; + padding-right: 0 !important; > [class^='col-'] { padding-left: 0; @@ -658,6 +683,12 @@ table.collapse.in { } } +////// NO gutter top and bottom (keep !important) +.no-gutter-tp-btm { + padding-bottom: 0 !important; + padding-top: 0 !important; +} + ////// NO gutter bottom .no-gutter-btm { padding-bottom: 0; @@ -681,49 +712,49 @@ table.collapse.in { ////// gutter left .gutter-l, .no-gutter-r.gutter-l { - padding-left: $grid-gutter-width / 2; + padding-left: ($grid-gutter-width / 2); } ////// gutter bottom .gutter-btm { - padding-bottom: $grid-gutter-width / 2; + padding-bottom: ($grid-gutter-width / 2); } ////// gutter right .gutter-r { - padding-right: $grid-gutter-width / 2; + padding-right: ($grid-gutter-width / 2); } ////// gutter top .gutter-top { - padding-top: $grid-gutter-width / 2; + padding-top: ($grid-gutter-width / 2); } ////// margin bottom .margin-btm { - margin-bottom: $grid-gutter-width / 2; + margin-bottom: ($grid-gutter-width / 2); } ////// margin left .margin-l { - margin-left: $grid-gutter-width / 2; + margin-left: ($grid-gutter-width / 2); } ////// margin left on mobile .margin-l-xs { @media (max-width: $screen-xs-max) { - margin-left: $grid-gutter-width / 2; + margin-left: ($grid-gutter-width / 2); } } ////// margin right .margin-r { - margin-right: $grid-gutter-width / 2; + margin-right: ($grid-gutter-width / 2); } ////// margin top .margin-t { - margin-top: $grid-gutter-width / 2; + margin-top: ($grid-gutter-width / 2); } ////// NO margin bottom @@ -850,16 +881,19 @@ table.collapse.in { } } } -//// Redi link-resolver traffic lights - END - +//// Redi link-resolver traffic lights - END // HEADER and NAVBAR FIXED having the same width as rest of the page // (the header can also run the full width of the viewport!) header, .navbar { background-color: $header-bg-color; +} +header, +.navbar, +.breadcrumbs { // For a full-width header de-activate margin and all the media queries below; // if not using a fixed navbar, also remove '.navbar' above margin: 0 auto; @@ -889,14 +923,14 @@ header, //// push navbar in from right, to allow for offcanvas scrollbar .offcanvas .navbar-fixed-top { @media only screen and (max-width: $screen-xs-max) { - right: $grid-gutter-width / 2; + right: ($grid-gutter-width / 2); } } //// Keep navbar on left, when offcanvas is active, give same appearance as ever .offcanvas.active .navbar-fixed-top { @media only screen and (max-width: $screen-xs-max) { - margin-top: -$navbar-height; + margin-top: -$navbar-height-xs; position: relative; } } @@ -918,11 +952,11 @@ header, span { display: inline-block; margin-left: 0; - margin-top: $grid-gutter-width / 2; + margin-top: ($grid-gutter-width / 2); @media (max-width: $screen-sm-max) { - margin-left: $grid-gutter-width / 2; - margin-top: $grid-gutter-width / 8; + margin-left: ($grid-gutter-width / 2); + margin-top: ($grid-gutter-width / 8); } } } @@ -936,14 +970,16 @@ header, // Define height for navbar on small, allow for stacked search box + @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { min-height: $navbar-height-sm; - //padding-bottom: $grid-gutter-width / 2; + //padding-bottom: ($grid-gutter-width / 2); } // style navbar toggler content when opened .navbar-collapse.collapse.in { - background-color: $navbar-bg-color; - position: absolute; - top: $navbar-height-xs * 1.5; + @media (min-width: $screen-sm-min) { + background-color: $navbar-bg-color; + position: absolute; + top: $navbar-height-xs * 1.5; + } } // Make language dropdown visible, style it and hide active but show selectable language(s) @@ -980,22 +1016,49 @@ header, } } -//// Make header navbar on mobile 100% wide +//// Make right-hand header parts fit with searchbox - see also .search.container above +#header-collapse { + @media (min-width: $grid-float-breakpoint) { + flex: 0 1 40%; + padding-top: .5em; + } + // Make smaller to fit searchbox and right-hand nav-elements in + @media only screen and (min-width: $screen-sm-min) and (max-width: 994px) { + flex: 0 1 25%; + } + + // Make right-hand header parts full width for advanced search page since it doesn't use any left-hand header parts + .template-name-advanced & { + @media (min-width: $grid-float-breakpoint) { + flex: 0 1 100%; + } + } +} + +//// Define header navbar on mobile #header-collapse.collapse.in { @media (max-width: $screen-sm-max) { - width: 100%; + background-color: $header-bg-color; + // margin-top: -$navbar-height-xs - 10px; // pull over searchbox li > a.btn { text-align: left; } #langmenu { - padding-left: $grid-gutter-width / 2; + padding-left: ($grid-gutter-width / 2); width: 100%; } } } +// Remove cart text to make searchbox fit on intermediate tablets +.cart-label { + @media only screen and (min-width: $screen-sm-min) and (max-width: 994px) { + display: none; + } +} + //// Library name in navbar - we give it the same padding as a button, so if fits in with the header .navbar-brand { padding: ($grid-gutter-width / 4) ($grid-gutter-width / 2) ($grid-gutter-width / 4) 0; @@ -1017,10 +1080,10 @@ header, } } -//// navbar-right - remove default negative right margin +//// navbar-right - add negative right margin to align last button in row to content in sidebar below (right padding) @media (min-width: $grid-float-breakpoint) { .navbar-right { - margin-right: 0; + margin-right: -$navbar-padding-horizontal; } } @@ -1037,14 +1100,26 @@ header, // NAVBAR - END // SEARCHBOX and Autocomplete +// Make seachbox container flexible -- values should complement those of #header-collapse (right-hand side navigation elements) +.search.container { + @media (min-width: $grid-float-breakpoint) { + flex: 0 1 60%; + padding-top: $button-top-padding; + } + + // Make wider to fit searchbox and right-hand nav-elements in + @media only screen and (min-width: $screen-sm-min) and (max-width: 994px) { + flex: 0 1 75%; + } +} + //// this will get search box and buttons in line .searchForm { - .navbar-left, - .navbar-right { + .navbar-left { // push searchbox down on mobile + add border for better looks @media only screen and (max-width: $screen-xs-max) { border: 1px solid $border-color; - margin-bottom: $grid-gutter-width / 4; + margin-bottom: ($grid-gutter-width / 4); margin-top: 0; } } @@ -1066,12 +1141,19 @@ header, .checkbox { clear: both; float: none; - padding-top: $grid-gutter-width / 4; + padding-top: ($grid-gutter-width / 4); input { margin-left: 0; } } + + // make search area fit on Tablets up to 994px by reducing buttons + .find-label { + @media only screen and (min-width: $screen-sm-min) and (max-width: 994px) { + display: none; + } + } } //// Searchbox on Homepage @@ -1081,7 +1163,7 @@ header, background-color: transparent; border: 0; box-shadow: none; - min-height: $grid-gutter-width / 2; + min-height: ($grid-gutter-width / 2); padding: 0; } @@ -1090,7 +1172,7 @@ header, border: 0; margin-top: 0; } -} + } } //// Autocomplete: @@ -1148,7 +1230,10 @@ header, //// When Breadcrumbs are added to header.phtml, it might be necessary to remove the breadcrumb bottom margin .breadcrumb { font-size: $font-size-breadcrumbs; + margin-bottom: 0; + margin-top: 0; padding-left: ($grid-gutter-width / 2 - 2px); // take 2 px off for borders + padding-top: 10px; // Divider: > li + li::before { @@ -1165,42 +1250,27 @@ header, // BREADCRUMBS - END // MAIN CONTENT (SIDEBAR BELOW, ADVANCED SEARCH BELOW) -#content { - // push content a little lower to allow for height of navbar/header, same needs to be applied to .sidebar, below! - .row:not(.short-view):first-of-type { - padding-top: $content-top-padding; - - // correct content padding on subsequent rows - .row .row { - padding-top: 0; - } - - // for all widths that use Offcanvas (767px) ($screen-xs-max) - @media only screen and (max-width: $screen-xs-max) { - padding-top: $content-top-padding * 4; - - .result .checkbox { - margin-top: 0; - } - } - } -} - //// set background and add border round main content, also applies to footer .main .container, .main .container-fluid, -footer .container { +footer { background-color: $main-bg; border: 1px solid $border-color; padding-bottom: $grid-gutter-width / 1.5; } -footer .container { +footer { border-top: 0; - padding-top: $grid-gutter-width / 1.5; + padding-top: ($grid-gutter-width / 1.5); } //// Search results +//// Add top padding to sidebar and content for better looks -- same as for #content, above; +.mainbody, +.sidebar { + padding-top: $content-top-padding; +} + ////// Bulk Action Toolbar .bulk-action-buttons, .bulkActionButtons { @@ -1220,14 +1290,6 @@ footer .container { margin-left: -($grid-gutter-width / 2); } -////// Search results column: make full width on XS -.search-results-col { - @media only screen and (max-width: $screen-xs-max) { - padding-left: 0; - padding-right: 0; - } -} - //// Results and bulk action buttons -- add padding, to create normal column padding appearance .result, .bulk-action-buttons, @@ -1237,11 +1299,9 @@ footer .container { //// Results (see BS SCSS/COMPONENTS/... for details) .result { - display: inline-block; // make sure background stripes display on entire container hyphens: auto; // Results padding - Do not add margin-top or -bottom as it will result in uneven heights - padding-bottom: $grid-gutter-width / 1.5; - padding-top: $grid-gutter-width / 1.5; + padding-bottom: ($grid-gutter-width / 2); width: 100%; // make full width, otherwise ugly look // Alternating colors in search results @@ -1262,6 +1322,11 @@ footer .container { font-size: $font-size-base + 2px; } } + + // Make add-to-cart icon same color as link + .cart-link-icon { + color: inherit; + } } //// Saved in @@ -1299,15 +1364,15 @@ footer .container { @include content-centered-display-as-table; } -//// Fix pagination on XS +//// Fix pagination on XS to display fewer items and remove first and last .pagination { @media screen and (max-width: $screen-xs-max) { - li { + li { // hide last and first page buttons &.first, &.last, - // select 7th to 11th child - &:nth-child(n+10):nth-child(-n+13){ + // select 7th to 11th child + &:nth-child(n+10):nth-child(-n+13) { display: none; } } @@ -1326,24 +1391,36 @@ footer .container { } ////// Pager - END + ////// Tabs +/////// Add padding-left to tabs area +.record-tabs { + padding-left: 1em; + + @media screen and (max-width: $screen-xs-max) { + padding-left: 0; + } +} + /////// Add left and right borders .tab-content { border-bottom: 1px solid $nav-tabs-border-color; border-left: 1px solid $nav-tabs-border-color; border-right: 1px solid $nav-tabs-border-color; - padding: $grid-gutter-width / 2; + padding: ($grid-gutter-width / 2); } //////// Tab-content active needs to display 'inline-block' top display the border correctly (or content will bleed over) .tab-content > .active { display: inline-block; + // make tables inside tabs use full width + width: 100%; } ////// branch info, opening hours etc .holdings-tab { .collapse.in { - padding-left: $grid-gutter-width / 2; + padding-left: ($grid-gutter-width / 2); } } @@ -1363,7 +1440,7 @@ footer .container { .hierarchy-tree .jstree-open > .jstree-ocl::before { font-size: 150%; margin-top: -5px; - min-width: 30px; + min-width: 30px; // do not translate into em } ////// Hierarchy tree - END @@ -1402,9 +1479,9 @@ footer .container { //// Record View - END //// Home Page -////// push searchbox well down -.template-name-home .container { - padding-top: $grid-gutter-width / 2; +////// Add top margin for better looks +.searchHomeContent { + margin-top: 1em; } ////// browsing suggestion lists on home (prevent torn-apart look when 2 columns only) @@ -1415,30 +1492,35 @@ footer .container { //// Home Page - END //// Advanced Search -#advSearchForm { - // Push Searchform box back in - .group.row { - margin-left: 0; +////// Set colors for remove search field buttons +.adv-term-remove { + color: $alert-danger-color; - // overwrite BS value here for column width to work - .search .middle { - width: auto; - } + &:hover, + &:focus { + color: $brand-danger; + opacity: 1; } +} - // Redefine hover link colors over delete Xes - .help-block { +#advSearchForm { + // Remove dotted lines around items when hovering over + .close { &:hover, &:focus { - color: $brand-danger; - text-decoration: none; + outline: none; } } +} - // Remove dotted lines around items when hovering over - .close { - &:hover, - &:focus {outline: none;} +////// Swap find and clear buttons for consistency +.adv-submit { + .fnd-btn { + float: right; + } + + .clear-btn { + float: left; } } @@ -1447,22 +1529,64 @@ footer .container { // MAIN CONTENT - END // SIDEBAR -//// Add top padding to sidebar for better looks -- same as for #content, above -.sidebar { - padding-top: $content-top-padding / 2; +//// pull content to right border +.container .sidebar { + margin-right: -15px; + + &.right { + padding-left: 0; + } +} + +//// Style my account sidebar menues to get the same look as facets +.myresearch-menu { + border-bottom: 1px solid $border-color; + border-left: 1px solid $border-color; + border-top: 1px solid $border-color; + + a:not(:last-of-type) { + border-bottom: 1px solid $border-color; + padding: $sidebar-item-padding; // overwrite values from BS with more sensible values + } +} + +//// Style facets to have the same height as items in myresearch-menu + remove right-hand borders +.facet-group .facet, +.facet-group .title { + border-right: 0; + padding: $sidebar-item-padding; +} + +.facet-group .collapse, +.facet-group .collapsing, +.facet-group > .facet { + border-right: 0; +} + +////// Pull exclude facets to the right, align with accordion/collapse triangles and headings +.facet-group .facet.excludable { + padding-left: 1.5em; + padding-right: 0.5em; } //// Offcanvas is used to widths of 767px ($screen-xs-max) @media only screen and (max-width: $screen-xs-max) { .offcanvas.active .sidebar { - margin-top: $grid-gutter-width / 2; + padding-right: ($grid-gutter-width /2); } } -//// Selected/active filters on top -.sidebar .list-group-item.active { +//// Sidebar standard items - fixme +.sidebar a { + // border: 1px solid $border-color; + // margin-bottom: -1px; +} + +//// Selected/active filters on top - fixme +.sidebar .facet.active, +.sidebar a.active { background-color: $brand-warning; - border-color: $border-color; + // border-color: $border-color; // also include icon .fa { @@ -1471,47 +1595,57 @@ footer .container { } //// Collapse-Facet Titles -.list-group-item.title { +.facet.title, +.sidebar a.title { background-color: $brand-secondary; } //// Create hover-effect -.list-group-item:hover:not(.button), -.list-group-item:focus:not(.button) { +.facet:hover:not(.button), +.facet:focus:not(.button) { background: $sidebar-item-hover-bg; + + .active-filters & { + background: $sidebar-item-active-hover-bg; + } } -.list-group-item.active:hover:not(.button), -.list-group-item.active:focus:not(.button) { +.facet.active:hover:not(.button), +.facet.active:focus:not(.button) { background: $sidebar-item-active-hover-bg; } -//// OR- and AND-Facets, item counts in My Account -.badge { - // remove right padding to align with accordion arrows - padding-right: 2px; +//// OR- and AND-Facets + item counts in My Account +///// Style the exclude icons +.exclude i { + color: $badge-link-color; - a { - color: $badge-link-color; + &:hover, + &:focus { + color: $badge-link-hover-color; + } +} - // make result number appear the same way as before it was linked up (#11177) - CK - &.badge-result-count { - color: $sidebar-badge-fa-color; - cursor: default; - } +.itemCount { + &:hover, + &:focus { + color: $badge-link-hover-color; - // render only the exclude link element in strong hover color - i { - &:hover, - &:focus { - color: $badge-link-hover-color; - } + .active & { + color: $brand-secondary; } } } -////// light color on dark, when active (My Account) - we need the parent for specificity -.list-group-item.active > .badge { +.badge { + font-size: 1em; + // remove right padding to align with accordion arrows + padding-right: 2px; +} + +////// light color on dark, when active (Facets + My Account) - we need the parent for specificity +.facet.active > .badge, +.sidebar a.active > .badge { background-color: transparent; color: $btn-primary-color; } @@ -1526,32 +1660,43 @@ footer .container { //// More-Toggle - END //// Toolbar in Detailview -- remove padding on SM up +@media (max-width: $screen-xs-max) { + .record-nav > li > a, + .btn-bookbag-toggle { + text-align: left; + } +} + @media (min-width: $screen-sm-min) { .nav-stacked.nav > li > a { padding-left: 0; padding-right: 0; } } -//// Toolbar in Detailview - END +.nav .btn-bookbag-toggle a { + padding-left: 2px; +} + +//// Toolbar in Detailview - END // SIDEBAR - END // FOOTER -//// For border round footer, see 'footer .container' above +//// For border around footer and background + top padding, see 'footer' above //// Align footer lists to their headings footer ul { - padding-left: $grid-gutter-width / 2; + padding-left: ($grid-gutter-width / 2); } .powered-by { - padding: $grid-gutter-width / 2; + padding: ($grid-gutter-width / 2); img { height: 1.75em; - margin-left: $grid-gutter-width / 4; - margin-right: $grid-gutter-width / 4; + margin-left: ($grid-gutter-width / 4); + margin-right: ($grid-gutter-width / 4); } span { @@ -1574,13 +1719,38 @@ footer ul { max-width: 85%; min-width: $modal-md; width: auto; + + // complex nesting required to overwrite BS values, CK + #modal & { + input.form-control { + max-width: em(400px); + } + } } } @media (min-width: $screen-lg-min) { .modal-dialog { - max-width: 900px; + max-width: em(900px); } } // MODALS - END + +// Bookbag +//// Style items list in bookbag +.cart ul li { + margin-bottom: .5em; +} + +.record-checkbox { + float: left; + margin-right: .5em; + + input[type='checkbox'], + input[type='checkbox']:focus { + margin-top: 2px; + } +} + +// Bookbag - END diff --git a/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml b/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml index 84a59fd28f2ff87fa13fcc6297082639100c7ba6..0efa905a3b7432b183522c69b3726b422eceecf3 100644 --- a/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml +++ b/themes/finc/templates/Auth/AbstractBase/resetpassword.phtml @@ -1,10 +1,10 @@ -<!-- finc - auth - abstractbase - RESETPASSWORD (custom finc template)--> +<!-- finc - auth - abstractbase - resetpassword (custom finc template)--> <? // Set page title. $this->headTitle($this->translate('Reset Password')); ?> <h2><?=$this->transEsc('Reset Password') ?></h2> -<form method="post" name="resetPasswordForm" class="form-horizontal" action="<?=$this->url('myresearch-resetpassword')?>"> +<form method="post" name="resetPasswordForm" action="<?=$this->url('myresearch-resetpassword')?>"> <?=$this->flashmessages()?> <p> <?=$this->translate('reset_password_text')?> @@ -41,4 +41,4 @@ $this->headTitle($this->translate('Reset Password')); </div> </div> </form> -<!-- finc - auth - abstractbase - RESETPASSWORD - END --> +<!-- finc - auth - abstractbase - resetpassword - END --> diff --git a/themes/finc/templates/Helpers/openurl.phtml b/themes/finc/templates/Helpers/openurl.phtml index 851ea76c7de6b735cff67da899e9e506fb4037bc..5f9fb847f699ebd971e3db330415c9b4e8d52e8d 100644 --- a/themes/finc/templates/Helpers/openurl.phtml +++ b/themes/finc/templates/Helpers/openurl.phtml @@ -17,7 +17,7 @@ <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?> data-search-class-id="<?=$this->escapeHtmlAttr($this->searchClassId) ?>"> + <a href="<?=$this->escapeHtmlAttr($this->resolverUrl)?>"<?=$class?> data-search-class-id="<?=$this->escapeHtmlAttr($this->searchClassId) ?>"> <? /* put the openUrl here in a span (COinS almost) so we can retrieve it later */ ?> <span title="<?=$this->escapeHtmlAttr($this->openUrl)?>" class="openUrl"></span> <? /* Custom finc, in #5334 (support for multiple resolver drivers) - CK */ ?> diff --git a/themes/finc/templates/Recommend/CollectionSideFacets.phtml b/themes/finc/templates/Recommend/CollectionSideFacets.phtml index 25397b568751cf69f0fa3a622e284acde820592b..50cacf72e2a5d55dd7348d214e7ee4961d8c582f 100644 --- a/themes/finc/templates/Recommend/CollectionSideFacets.phtml +++ b/themes/finc/templates/Recommend/CollectionSideFacets.phtml @@ -6,16 +6,16 @@ <? $keywordFilter = $this->recommend->getKeywordFilter(); if (!empty($keywordFilter)) { - $this->extraSideFacetFilters = array( - 'Keyword' => array( - array( + $this->extraSideFacetFilters = [ + 'Keyword' => [ + [ 'value' => $keywordFilter, 'displayText' => $keywordFilter, 'specialType' => 'keyword', 'operator' => 'OR' - ) - ) - ); + ] + ] + ]; } ?> <? ob_start() ?> diff --git a/themes/finc/templates/Recommend/SideFacets.phtml b/themes/finc/templates/Recommend/SideFacets.phtml index 9c91f99151a1b180ac431419bcf35100f75e69b8..133ee8db0ef7af9628fc1b9a2ad636deb4551a82 100644 --- a/themes/finc/templates/Recommend/SideFacets.phtml +++ b/themes/finc/templates/Recommend/SideFacets.phtml @@ -1,260 +1,78 @@ -<!-- finc:- recommend - sidefacets --> +<!-- finc: recommend - sidefacets --> <? $this->headScript()->appendFile('facets.js'); -$results = $this->recommend->getResults(); -$options = $this->searchOptions($this->searchClassId); +// Save results/options to $this so they are available to sub-templates: +$this->results = $results = $this->recommend->getResults(); +$this->options = $options = $this->searchOptions($this->searchClassId); ?> <? if ($results->getResultTotal() > 0): ?> <h4><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></h4> <? endif; ?> -<? $checkboxFilters = $results->getParams()->getCheckboxFacets(); -if (count($checkboxFilters) > 0): ?> - <? - $html = ''; - $shown = 0; +<? $checkboxFilters = $results->getParams()->getCheckboxFacets(); ?> +<? $checkboxesShown = false; ?> +<? if (count($checkboxFilters) > 0): foreach ($checkboxFilters as $current) { - $html .= '<label class="checkbox'; - if ($results->getResultTotal() < 1 && !$current['selected'] && !$current['alwaysVisible']) { - $html .= ' hidden'; - } else { - $shown++; + if ($results->getResultTotal() > 0 || $current['selected'] || $current['alwaysVisible']) { + $checkboxesShown = true; + break; } - $html .= '"><input type="checkbox" name="filter[]" value="' . $this->escapeHtmlAttr($current['filter']) . '" - ' . ($current['selected'] ? 'checked="checked"' : '') . ' id="' . $this->escapeHtmlAttr(str_replace(' ', '', $current['desc'])) . '" - onclick="document.location.href=\'' . ($current['selected'] ? $results->getUrlQuery()->removeFilter($current['filter']) : $results->getUrlQuery()->addFilter($current['filter'])) . '\';" />' . $this->transEsc($current['desc']) . '</label>'; } ?> - <div class="checkboxFilter<? if ($shown == 0): ?> hidden<? endif; ?>"><?=$html?></div> + <? if ($checkboxesShown):?> + <div class="checkboxFilter"> + <?=$this->context($this)->renderInContext('Recommend/SideFacets/checkbox-filters.phtml', ['checkboxFilters' => $checkboxFilters, 'results' => $results]);?> + </div> +<? endif; ?> <? endif; ?> -<? $extraFilters = isset($this->extraSideFacetFilters) ? $this->extraSideFacetFilters : array(); ?> +<? $extraFilters = isset($this->extraSideFacetFilters) ? $this->extraSideFacetFilters : []; ?> <? $collapsedFacets = $this->recommend->getCollapsedFacets() ?> -<? $hierarchicalFacetSortOptions = $this->recommend->getHierarchicalFacetSortOptions() ?> -<? $hierarchicalFacets = $this->recommend->getHierarchicalFacets() ?> -<? $filterList = array_merge($results->getParams()->getFilterList(true), $extraFilters); -if (!empty($filterList)): ?> - <div class="list-group filters"> - <div class="list-group-item title"><?=$this->transEsc('Remove Filters')?></div> - <? foreach ($filterList as $field => $filters): ?> - <? foreach ($filters as $i => $filter): ?> - <? - $index = isset($filter['field']) ? array_search($filter['field'], $collapsedFacets) : false; - if ($index !== false) { - unset($collapsedFacets[$index]); // Open if we have a match - } - if (isset($filter['specialType']) && $filter['specialType'] == 'keyword') { - $removeLink = $this->currentPath() . $results->getUrlQuery()->replaceTerm($filter['value'], ''); - } else { - $removeLink = $this->currentPath() . $results->getUrlQuery()->removeFacet($filter['field'], $filter['value'], true, $filter['operator']); - } - if ($filter['displayText'] == '[* TO *]') { - $filter['displayText'] = $this->translate('filter_wildcard'); - } - ?> - <? /* use tooltip toggler in finc, CK */ ?> - <a class="list-group-item active" href="<?=$removeLink?>" data-toggle="tooltip" title="<?=$this->transEsc('clear_tag_filter')?>"> - <span class="pull-right flip"><i class="fa fa-minus-square-o" aria-hidden="true"></i></span> - <? if ($filter['operator'] == 'NOT') echo $this->transEsc('NOT') . ' '; - if ($filter['operator'] == 'OR' && $i > 0) echo $this->transEsc('OR') . ' '; ?><?=$this->transEsc($field)?>: <?=$this->escapeHtml($filter['displayText'])?> - </a> - <? endforeach; ?> - <? endforeach; ?> - </div> +<? $filterList = array_merge($results->getParams()->getFilterList(true), $extraFilters); ?> +<? if (!empty($filterList)): ?> + <?=$this->context($this)->renderInContext('Recommend/SideFacets/filter-list.phtml', [ + 'collapsedFacets' => $collapsedFacets, + 'extraFilters' => $extraFilters, + 'filterList' => $filterList, + ]);?> <? endif; ?> <?=isset($this->sideFacetExtraControls) ? $this->sideFacetExtraControls : ''?> -<? /* finc-specific: sidefacet()->displayAllowedFacetValues, #7624 - CK*/ ?> -<? $sideFacetSet = $this->sidefacet()->displayAllowedFacetValues($this->recommend->getFacetSet()); -$rangeFacets = $this->recommend->getAllRangeFacets(); ?> +<? /* finc-specific line: sidefacet()->displayAllowedFacetValues ..., #7624 - CK */ /* Original line was: *//* +<? $sideFacetSet = $this->recommend->getFacetSet(); $rangeFacets = $this->recommend->getAllRangeFacets(); ?> + */ ?> +<? $sideFacetSet = $this->sidefacet()->displayAllowedFacetValues($this->recommend->getFacetSet()); $rangeFacets = $this->recommend->getAllRangeFacets(); ?> +<? $hierarchicalFacets = $this->recommend->getHierarchicalFacets() ?> +<? $hierarchicalFacetSortOptions = $this->recommend->getHierarchicalFacetSortOptions() ?> <? if (!empty($sideFacetSet) && $results->getResultTotal() > 0): ?> <? foreach ($sideFacetSet as $title => $cluster): ?> - <? $allowExclude = $this->recommend->excludeAllowed($title); ?> - <? $facets_before_more = $this->recommend->getShowMoreSetting($title); ?> - <? $showMoreInLightbox = $this->recommend->getShowInLightboxSetting($title); ?> - <div class="list-group facet" id="side-panel-<?=$this->escapeHtmlAttr($title)?>"> - <? /* Fix in all instance branches to avoid validation error 'href not allowed on div'; CK */ ?> - <a class="list-group-item title<? if (in_array($title, $collapsedFacets)): ?> collapsed<? endif ?>" data-toggle="collapse" href="#side-collapse-<?=$this->escapeHtmlAttr($title)?>"> + <div class="facet-group" id="side-panel-<?=$this->escapeHtmlAttr($title)?>"> + <? /* use 'a' instead of 'div' below! Fix this in all instance branches to avoid validation error 'href not allowed on div'; #9416, CK */ ?> + <a class="title<? if (in_array($title, $collapsedFacets)): ?> collapsed<? endif ?>" data-toggle="collapse" href="#side-collapse-<?=$this->escapeHtmlAttr($title)?>"> <?=$this->transEsc($cluster['label'])?> </a> <div id="side-collapse-<?=$this->escapeHtmlAttr($title)?>" class="collapse<? if (!in_array($title, $collapsedFacets)): ?> in<? endif ?>"> <? if (isset($rangeFacets[$title])): ?> - <div class="list-group-item"> - <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="col-sm-6"> - <label for="<?=$this->escapeHtmlAttr($title)?>from"> - <?=$this->transEsc('date_from')?>: - </label> - <input type="text" class="form-control" 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="col-sm-6"> - <label for="<?=$this->escapeHtmlAttr($title)?>to"> - <?=$this->transEsc('date_to')?>: - </label> - <input type="text" class="form-control" 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="hidden" id="<?=$this->escapeHtmlAttr($title)?><?=$this->escapeHtml($rangeFacets[$title]['type'])?>Slider"/></div> - <? endif; ?> - <input class="btn btn-transparent" type="submit" value="<?=$this->transEsc('Set')?>"/> - </form> - </div> - <? if ($rangeFacets[$title]['type'] == 'date'): ?> - <? $this->headScript()->appendFile('vendor/bootstrap-slider.js'); ?> - <? $this->headLink()->appendStylesheet('vendor/bootstrap-slider.min.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(); - $('#{$this->escapeHtmlAttr($title)}from').val(v[0]); - $('#{$this->escapeHtmlAttr($title)}to').val(v[1]); - }; - var {$this->escapeHtmlAttr($title)}dateSlider = $('#{$this->escapeHtmlAttr($title)}dateSlider') - .slider({ - 'min':{$min}, - 'max':{$max}, - 'handle':"square", - 'tooltip':"hide", - 'value':[{$low},{$high}], - 'reversed': {$reversed} - }) - .on('change', fillTexts) - .data('slider'); -}); -// finc: Update slider handle position with input date - CK (adapted from search - advanced - ranges -$('#{$this->escapeHtmlAttr($title)}from, #{$this->escapeHtmlAttr($title)}to').change(function () { - var from = Number($('#{$this->escapeHtmlAttr($title)}from').val()); - var to = Number($('#{$this->escapeHtmlAttr($title)}to').val()); - if (from <= 0) { - from = {$min}; - } - if (to <= 0) { - to = {$max}; - } - $('#{$this->escapeHtmlAttr($title)}dateSlider').slider('setValue', [from, to], true); -}); -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'); ?> - <? $sort = isset($hierarchicalFacetSortOptions[$title]) ? $hierarchicalFacetSortOptions[$title] : ''; ?> - <? if (!in_array($title, $collapsedFacets)): ?> - <? - $script = <<<JS -$(document).ready(function() { - initFacetTree($('#facet_{$this->escapeHtml($title)}'), true); -}); -JS; - ?> - <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> + <?=$this->context($this)->renderInContext('Recommend/SideFacets/range-slider.phtml', ['title' => $title, 'facet' => $rangeFacets[$title]]);?> <? else: ?> - <? - $script = <<<JS -$('#side-collapse-{$this->escapeHtmlAttr($title)}').on('show.bs.collapse', 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; ?> - <? foreach ($cluster['list'] as $i => $thisFacet): ?> - <? - if (strlen($thisFacet['displayText']) == 0) { - $thisFacet['displayText'] = "-"; - } - ?> - <? $moreClass = 'narrowGroupHidden-'.$this->escapeHtmlAttr($title).' hidden'; ?> - <? if ($i == $facets_before_more): ?> - <? $idAndClass = 'id="more-narrowGroupHidden-'.$this->escapeHtmlAttr($title).'" class="list-group-item narrow-toggle"'; ?> - <? if ($facetLightbox = $options->getFacetListAction()): ?> - <? $moreUrl = $this->url($facetLightbox) . $results->getUrlQuery()->getParams().'&facet='.$title.'&facetop='.$thisFacet['operator'].'&facetexclude='.($allowExclude ? 1 : 0); ?> - <? else: ?> - <? $moreUrl = '#'; ?> - <? endif; ?> - <? if (($showMoreInLightbox && $showMoreInLightbox !== 'more') && $facetLightbox): ?> - <a <?=$idAndClass ?> data-lightbox href="<?=$moreUrl ?>" rel="nofollow"><?=$this->transEsc('more')?> ...</a> - <? break; ?> - <? else: ?> - <a <?=$idAndClass ?> href="<?=$moreUrl ?>" onclick="return moreFacets('narrowGroupHidden-<?=$this->escapeHtmlAttr($title) ?>')" rel="nofollow"><?=$this->transEsc('more')?> ...</a> - <? endif; ?> - <? endif; ?> - <? if ($thisFacet['isApplied']): ?> - <a class="list-group-item active<? if ($i >= $facets_before_more): ?><?=$moreClass ?><?endif ?><? if ($thisFacet['operator'] == 'OR'): ?> facetOR applied<? endif ?>" href="<?=$this->currentPath().$results->getUrlQuery()->removeFacet($title, $thisFacet['value'], true, $thisFacet['operator']) ?>" title="<?=$this->transEsc('applied_filter') ?>"> - <? if ($thisFacet['operator'] == 'OR'): ?> - <i class="fa fa-check-square-o" aria-hidden="true"></i> - <? else: ?> - <span class="pull-right flip"><i class="fa fa-check" aria-hidden="true"></i></span> - <? endif; ?> - <?= $this->escapeHtml($thisFacet['displayText']) ?> - </a> - <? else: ?> - <? $addURL = $this->currentPath() . $results->getUrlQuery()->addFacet($title, $thisFacet['value'], $thisFacet['operator']); ?> - <? if ($allowExclude): ?> - <div class="list-group-item facet<?=$thisFacet['operator'] ?><? if ($i >= $facets_before_more): ?> <?=$moreClass ?><?endif ?>"> - <? else: ?> - <a href="<?=$addURL ?>" class="list-group-item facet<?=$thisFacet['operator'] ?><? if ($i >= $facets_before_more): ?> <?=$moreClass ?><?endif ?>"> - <? endif; ?> - - <? /* Fixme: Is this correct? - CK */ ?> - <? /* Finc-specific: make click on found items number select facet, like facet-title - CK */ ?> - <span class="badge"> - <? if ($allowExclude): ?> - <a href="<?= $addURL ?>" class="badge-result-count"><?= $this->localizedNumber($thisFacet['count']) ?></a> - <a href="<?=$this->currentPath().$results->getUrlQuery()->addFacet($title, $thisFacet['value'], 'NOT') ?>" title="<?=$this->transEsc('exclude_facet') ?>"><i class="fa fa-minus-square-o" aria-hidden="true"></i></a> - <? else: ?> - <?= $this->localizedNumber($thisFacet['count']) ?> - <? endif; ?> - </span> - <? /* Fixme END - CK */ ?> - - <? if ($allowExclude): ?> - <a href="<?= $addURL ?>"> - <? endif; ?> - <? if ($thisFacet['operator'] == 'OR'): ?> - <i class="fa fa-square-o" aria-hidden="true"></i> - <? endif; ?> - <?= $this->escapeHtml($thisFacet['displayText']) ?> - <? if ($allowExclude): ?> - </a> - </div> - <? else: ?> - </a> - <? endif; ?> - <? endif; ?> - <? endforeach; ?> - <? if ($showMoreInLightbox === 'more' && $facetLightbox = $options->getFacetListAction()): ?> - <? $moreUrl = $this->url($facetLightbox) . $results->getUrlQuery()->getParams().'&facet='.$title.'&facetop='.$thisFacet['operator'].'&facetexclude='.($allowExclude ? 1 : 0); ?> - <a class="list-group-item narrow-toggle <?=$moreClass ?>" data-lightbox href="<?=$moreUrl ?>" rel="nofollow"><?=$this->transEsc('see all')?> ...</a> - <? endif; ?> - <? if ($i >= $facets_before_more): ?><a class="list-group-item narrow-toggle <?=$moreClass ?>" href="#" onclick="return lessFacets('narrowGroupHidden-<?=$this->escapeHtmlAttr($title) ?>')"><?=$this->transEsc('less')?> ...</a><? endif; ?> + <? $contextVars = [ + 'allowExclude' => $this->recommend->excludeAllowed($title), + 'title' => $title, + 'sortOptions' => isset($hierarchicalFacetSortOptions[$title]) ? $hierarchicalFacetSortOptions[$title] : '', + 'collapsedFacets' => $collapsedFacets + ]; ?> + <? if (in_array($title, $hierarchicalFacets)): ?> + <?=$this->context($this)->renderInContext('Recommend/SideFacets/hierarchical-facet.phtml', $contextVars);?> + <noscript> <? endif; ?> + <? $contextVars = [ + 'options' => $options, + 'allowExclude' => $this->recommend->excludeAllowed($title), + 'facets_before_more' => $this->recommend->getShowMoreSetting($title), + 'showMoreInLightbox' => $this->recommend->getShowInLightboxSetting($title) + ]; ?> + <?=$this->context($this)->renderInContext('Recommend/SideFacets/cluster-list.phtml', array_merge($contextVars, ['title' => $title, 'cluster' => $cluster]));?> <? if (in_array($title, $hierarchicalFacets)): ?> - </noscript> + </noscript> + <? endif; ?> <? endif; ?> </div> </div> diff --git a/themes/finc/templates/RecordDriver/SolrAI/core.phtml b/themes/finc/templates/RecordDriver/SolrAI/core.phtml index 679281c8adba6602f4b0c08f79f38cb5aa566e62..28c1d89cef01e346e03a62d34ccb7e94c221c0a6 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/core.phtml @@ -1,345 +1,84 @@ <!-- finc: recordDriver - solrAI - CORE --> <? /* Created in 4826, based on SolrDefault - core, compare with SolrDefault - core during updates! */ ?> -<? -if($loggedin = $this->auth()->isLoggedIn()) { - $user_id = $loggedin->id; - $loggedin = true; -} else { - $user_id = false; -} - - $formatRoles = function ($roles) { - if (count($roles) == 0) { - return ''; - } - $that = $this; - $translate = function ($str) use ($that) { - return $that->transEsc('CreatorRoles::' . $str); - }; - return ' (' . implode(', ', array_unique(array_map($translate, $roles))) . ')'; - }; -?> <div class="row" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> - <? $QRCode = $this->record($this->driver)->getQRCode("core"); - $cover = $this->record($this->driver)->getCover('core', 'medium', $this->record($this->driver)->getThumbnail('large')); - $preview = $this->record($this->driver)->getPreviews(); ?> + <? + $QRCode = $this->record($this->driver)->getQRCode("core"); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; + $preview = $this->record($this->driver)->getPreviews(); + ?> <? if ($QRCode || $cover || $preview): ?> <div class="col-sm-3 img-col"> <div class="gutter-l"> - <? /* Display thumbnail if appropriate: */ ?> + <? /* Display thumbnail if appropriate: */ ?> <? if($cover): ?> <?=$cover?> - <? /* BOF - finc-specific StyleBasedIcons */ ?> + <? /* BOF - finc-specific StyleBasedIcons */ ?> <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> <?=$this->record($this->driver)->getFormatIcon()?> - <? /* EOF - finc-specific StyleBasedIcons */ ?> + <? /* EOF - finc-specific StyleBasedIcons */ ?> <? endif; ?> - <? /* Display qrcode if appropriate: */ ?> - <? if($QRCode): ?> + <? /* Display qrcode if appropriate: */ ?> + <? if($QRCode): ?> <span class="hidden-xs"> <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> </span> - <? endif; ?> + <? endif; ?> </div> <? // if you have a preview tab but want to move or remove the preview link // from this area of the record view, this can be split into // getPreviewData() (should stay here) and // getPreviewLink() (can go in your desired tab) ?> - <? if ($preview): ?><?=$preview?><? endif; ?> - </div> - - <div class="col-sm-9 info-col"> - <? else: ?> - <div class="col-sm-12"> - <? endif; ?> - - <? /* For all finc-records; We want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> - <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> - - <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> - <? if ($summary): ?> - <p><?=$this->truncate($summary, 300)?></p> - - <? if(strlen($summary) > 300): ?> - <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>'><?=$this->transEsc('Full description')?></a></p> - <? endif; ?> - <? endif; ?> - - <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <? /* Display the lists that this record is saved to */ ?> - <div class="savedLists hidden alert alert-info"> - <strong><?=$this->transEsc("Saved in")?>:</strong> + <? if ($preview): ?> + <div class="record-previews"> + <?=$preview?> </div> <? endif; ?> + </div> - <?/* Display Main Details */?> - <table class="table table-striped"> - <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> - <? $journalTitle = $this->driver->getContainerTitle(); if (!empty($journalTitle)): ?> - <tr> - <?/* solrAi: Journal Title below */?> - <th><?=$this->transEsc('Journal Title')?>:</th> - <td> - <? - $containerSource = $this->driver->getSourceIdentifier(); - $containerID = $this->driver->getContainerRecordID(); - - // finc specific journalLink generation - $journalLink = ''; - $issns = $this->driver->getISSNs(); - - // first, try to link to container id (VuFind stock-behaviour) - if ($containerID) { - $journalLink = $this->recordLink()->getUrl("$containerSource|$containerID"); - } - - // second, try to search issn (finc specific) - elseif (!empty($issns)) { - $journalLink = $this->record($this->driver)->getLink('isn', $issns); - } - - // third, search for journal title (VuFind stock-behaviour) - else { - $journalLink = $this->record($this->driver)->getLink('journaltitle', $journalTitle); - } - ?> - <a href="<?=$journalLink?>"><?=$this->escapeHtml($journalTitle)?></a> - <? /* finc specific journalLink generation - END */ ?> - - <? $ref = $this->driver->getContainerReference(); if (!empty($ref)) { echo $this->escapeHtml($ref); } ?> - </td> - </tr> - <? endif; ?> - - <? $nextTitles = $this->driver->getNewerTitles(); $prevTitles = $this->driver->getPreviousTitles(); ?> - <? if (!empty($nextTitles)): ?> - <tr> - <th><?=$this->transEsc('New Title')?>: </th> - <td> - <? foreach($nextTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (!empty($prevTitles)): ?> - <tr> - <th><?=$this->transEsc('Previous Title')?>: </th> - <td> - <? foreach($prevTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* BS standard dedupe etc, compare with BS solrDefault - core; CK */ ?> - <? $authors = $this->driver->getDeduplicatedAuthors(); ?> - <? if (isset($authors['main']) && !empty($authors['main'])): ?> - <tr> - <th><?=$this->transEsc(count($authors['main']) > 1 ? 'Main Authors' : 'Main Author')?>: </th> - <td> - <? $i = 0; foreach ($authors['main'] as $author => $roles): ?><?=($i++ == 0)?'':', '?><span property="author"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?></a><?=$formatRoles($roles)?></span><? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (isset($authors['corporate']) && !empty($authors['corporate'])): ?> - <tr> - <th><?=$this->transEsc(count($authors['corporate']) > 1 ? 'Corporate Author' : 'Corporate Authors')?>: </th> - <td> - <? $i = 0; foreach ($authors['corporate'] as $corporate => $roles): ?><?=($i++ == 0)?'':', '?><span property="creator"><a href="<?=$this->record($this->driver)->getLink('author', $corporate)?>"><?=$this->escapeHtml($corporate)?></a><?=$formatRoles($roles)?></span><? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (isset($authors['secondary']) && !empty($authors['secondary'])): ?> - <tr> - <th><?=$this->transEsc('Other Authors')?>: </th> - <td> - <? $i = 0; foreach ($authors['secondary'] as $author => $roles): ?><?=($i++ == 0)?'':', '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?></a><?=$formatRoles($roles)?></span><? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* BS standard dedupe etc, compare with BS solrDefault - core - END */ ?> - - <? /* solrMarc-specific: Compare getFormats section with BS solrDefault - core; this section is not in finc solrDefault! - CK */ ?> - <? if (count($this->driver->getFormats()) > 0): ?> - <tr> - <th><?=$this->transEsc('Format')?>: </th> - <td><?=$this->record($this->driver)->getFormatList()?></td> - </tr> - <? endif; ?> - - <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?> - <tr> - <th><?=$this->transEsc('Language')?>: </th> - <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang)?><br/><? endforeach; ?></td> - </tr> - <? endif; ?> - - <? /* AI-specific change - CK */?> - <? $aidatain = $this->driver->getAIDataIn(); if (!empty($aidatain)): ?> - <tr> - <th><?=$this->transEsc('In')?>: </th> - <td> - <? $jtitle = $aidatain['jtitle']; $issns = $aidatain['issns']; if (!empty($issns)): ?> - <a href="<?=$this->record($this->driver)->getLink('isn', $issns)?>"><? if (!empty($jtitle)): ?><?=$this->escapeHtml($jtitle)?><? endif; ?></a> - <? elseif (!empty($jtitle)): ?> - <?=$this->escapeHtml($jtitle)?> - <? endif; ?> - <? $volume = $aidatain['volume']; if (!empty($volume)): ?><? if (empty($jtitle)): ?>, <? endif; ?><?=$this->escapeHtml($volume) ?><? endif; ?><? $date = $aidatain['date']; if (!empty($date)): ?><? if (empty($volume)): ?>, <? endif; ?>(<?=$this->escapeHtml($date) ?>)<? endif; ?><? $issue = $aidatain['issue']; if (!empty($issue)): ?>, <?=$this->escapeHtml($issue) ?><? endif; ?><? $pages = $aidatain['pages']; if (!empty($pages)): ?>, <?=$this->transEsc('p.')?> <?=$this->escapeHtml($pages) ?><? endif; ?> - </td> - </tr> - <? endif; ?> - <? /* AI-specific change - END */?> - - <? /* compare next section with solrDefault - core; CK */?> - <? $publications = $this->driver->getPublicationDetails(); if (!empty($publications)): ?> - <tr> - <th><?=$this->transEsc('Published')?>: </th> - <? /* microdate/schema org improvements - CK */?> - <td itemscope itemtype="http://schema.org/publisher"> - <? foreach ($publications as $field): ?> - <span property="publisher"> - <? $pubPlace = $field->getPlace(); if (!empty($pubPlace)): ?> - <span itemprop="location"><?=$this->escapeHtml($pubPlace)?></span> - <? endif; ?> - <? $pubName = $field->getName(); if (!empty($pubName)): ?> - <span itemprop="name"><?=$this->escapeHtml($pubName)?></span> - <? endif; ?> - </span> - <? $pubDate = $field->getDate(); if (!empty($pubDate)): ?> - <span property="datePublished"><?=$this->escapeHtml($pubDate)?></span> - <? endif; ?> - <br/> - <? endforeach; ?> - </td> - <? /* microdate/schema org improvements - END */?> - </tr> + <div class="col-sm-9 info-col"> + <? else: ?> + <div class="col-sm-12"> <? endif; ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> - <? /* Compare next section (getEdition) with solrDefault - core; CK */ ?> - <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> - <tr> - <th><?=$this->transEsc('Edition')?>: </th> - <td property="bookEdition"><?=$this->escapeHtml($edition)?></td> - </tr> - <? endif; ?> + <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> + <? if ($summary): ?> + <p><?=$this->truncate($summary, 300)?></p> - <?/* Display series section if at least one series exists. */?> - <?/* compare with BS solrDefault - core, as series section doesn't exist in finc solrDefault - core; CK */?> - <? /* finc-specific: adds '&& is_array($series)' in #9556 - CK */?> - <? $series = $this->driver->getSeries(); if (!empty($series) && is_array($series)): ?> - <tr> - <th><?=$this->transEsc('Series')?>: </th> - <td> - <? foreach ($series as $field): ?> - <?/* Depending on the record driver, $field may either be an array with - "name" and "number" keys or a flat string containing only the series - name. We should account for both cases to maximize compatibility. */?> - <? if (is_array($field)): ?> - <? if (!empty($field['name'])): ?> - <a href="<?=$this->record($this->driver)->getLink('series', $field['name'])?>"><?=$this->escapeHtml($field['name'])?></a> - <? if (!empty($field['number'])): ?> - <?=$this->escapeHtml($field['number'])?> - <? endif; ?> - <br/> - <? endif; ?> - <? else: ?> - <a href="<?=$this->record($this->driver)->getLink('series', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endif; ?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $subjects = $this->driver->getAllSubjectHeadings(); if (!empty($subjects)): ?> - <tr> - <th><?=$this->transEsc('Subjects')?>: </th> - <td> - <? foreach ($subjects as $field): ?> - <div class="subject-line" property="keywords"> - <? $subject = ''; ?> - <? if(count($field) == 1) $field = explode('--', $field[0]); ?> - <? $i = 0; foreach ($field as $subfield): ?> - <?=($i++ == 0) ? '' : ' > '?> - <? $subject = trim($subject . ' ' . $subfield); ?> - <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a> - <? endforeach; ?> - </div> - <? endforeach; ?> - </td> - </tr> + <? if(strlen($summary) > 300): ?> + <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> + <? endif; ?> <? endif; ?> - <? $childRecordCount = $this->driver->tryMethod('getChildRecordCount'); if ($childRecordCount): ?> - <tr> - <th><?=$this->transEsc('child_records')?>: </th> - <td> - <a href="<?=$this->recordLink()->getChildRecordSearchUrl($this->driver)?>"><?=$this->transEsc('child_record_count', array('%%count%%' => $childRecordCount))?></a> - </td> - </tr> + <? if ($this->userlist()->getMode() !== 'disabled'): ?> + <? /* Display the lists that this record is saved to */ ?> + <div class="savedLists"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> <? endif; ?> + <?/* Display Main Details */?> <? - $openUrl = $this->openUrl($this->driver, 'record'); - $openUrlActive = $openUrl->isActive(); - // Account for replace_other_urls setting - $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); + $formatter = $this->recordDataFormatter(); + $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-ai')); ?> - <? if (!empty($urls) || $openUrlActive): ?> - <tr> - <th><?=$this->transEsc('Online Access')?>: </th> - <td> - <? foreach ($urls as $current): ?> - <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> - <? endforeach; ?> - <? if ($openUrlActive): ?> - <?=$openUrl->renderTemplate()?><br/> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? $recordLinks = $this->driver->getAllRecordLinks(); ?> - <? if(!empty($recordLinks)): ?> - <tr> - <th><?=$this->transEsc('Related Items')?>:</th> - <td> - <? foreach ($recordLinks as $recordLink): ?> - <?=$this->transEsc($recordLink['title'])?>: - <a href="<?=$this->recordLink()->related($recordLink['link'])?>"><?=$this->escapeHtml($recordLink['value'])?></a><br /> - <? endforeach; ?> - <? /* if we have record links, display relevant explanatory notes */ - $related = $this->driver->getRelationshipNotes(); - if (!empty($related)): ?> - <? foreach ($related as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> + <? if (!empty($coreFields)): ?> + <table class="table table-striped"> + <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <? foreach ($coreFields as $key => $current): ?> + <? if ($key == null): ?> + <?=$current['value']?> + <? else: ?> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? if ($this->usertags()->getMode() !== 'disabled'): ?> - <? $tagList = $this->driver->getTags(null, null, 'count', $user_id); ?> - <tr> - <th><?=$this->transEsc('Tags')?>: </th> - <td> - <a class="tag-record btn btn-link pull-right flip hidden-print" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox> - <i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Add Tag')?> - </a> - <?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?> - </td> - </tr> + <? endforeach; ?> + </table> <? endif; ?> - </table> - <?/* End Main Details */?> + <?/* End Main Details */?> + </div> </div> -</div> <!-- recordDriver - solrAI - CORE - END --> diff --git a/themes/finc/templates/RecordDriver/SolrAI/data-containerTitle.phtml b/themes/finc/templates/RecordDriver/SolrAI/data-containerTitle.phtml new file mode 100644 index 0000000000000000000000000000000000000000..3bb6c33903eac85a0b4a112f4bf292d14b084ffb --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrAI/data-containerTitle.phtml @@ -0,0 +1,30 @@ +<!-- finc: RecordDriver - SolrAi - data-containerTitle --> +<? if (!(empty($data))): ?> + <? + $containerSource = $this->driver->tryMethod('getSourceIdentifier'); + $containerID = $this->driver->tryMethod('getContainerRecordID'); + + // finc specific journalLink generation + $issns = $this->driver->tryMethod('getISSNs'); + $journalLink = ''; + + // try container id as link - VuFind native behaviour + if ($containerID) { + $journalLink = $this->recordLink()->getUrl("$containerSource|$containerID"); + } + // try to link via issn - finc adapted behaviour + elseif (!empty($issns)) { + $journalLink = $this->record($this->driver)->getLink('isn', $issns); + } + // default take the journal title as link - VuFind native behaviur + else { + $journalLink = $this->record($this->driver)->getLink('journaltitle', $data); + } + ?> + <a href="<?=$journalLink?>"><?=$this->escapeHtml($data)?></a> + <? $ref = $this->driver->tryMethod('getContainerReference'); ?> + <? if (!empty($ref)): ?> + <?= $this->escapeHtml($ref) ?> + <? endif; ?> +<? endif; ?> +<!-- finc: RecordDriver - SolrAi - data-containerTitle - END --> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrAI/data-jTitle.phtml b/themes/finc/templates/RecordDriver/SolrAI/data-jTitle.phtml new file mode 100644 index 0000000000000000000000000000000000000000..55b2ac1b17b816bb33b3c90fe4633c39797efa2b --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrAI/data-jTitle.phtml @@ -0,0 +1,30 @@ +<!-- finc: RecordDriver - SolrAi - data-jTitle --> +<? $jtitle = []; ?> +<? if (!(empty($data))): ?> +<? $issns = $this->driver->tryMethod('getISSNs'); ?> + <? ob_start(); ?> + <? if (!empty($issns)): ?> + <a href="<?=$this->record($this->driver)->getLink('isn', $issns)?>"> + <?=$this->escapeHtml($data)?> + </a> + <? else: ?> + <?=$this->escapeHtml($jtitle)?> + <? endif; ?> + <? + $jtitle[] = trim(preg_replace('/\s+<\//', '</', ob_get_contents())); + ob_end_clean(); + ?> +<? endif; ?> +<? + // please note: direction of iteration will be displayed + $methods = ['getVolume', 'getPublishDateSort', 'getIssues', 'getPages']; + foreach ($methods as $method) { + if (!(empty($retval = $this->driver->tryMethod($method)))) { + $jtitle[] = ($method == 'getPages') + ? $this->transEsc('p.') .' '. $this->escapeHtml($retval) + : $this->escapeHtml($retval); + } + } +?> +<?=implode(', ', $jtitle)?> +<!-- finc: RecordDriver - SolrAi - data-jTitle - END --> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml b/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml index 90f7077590e543ff877cd8f3acaf302c1601df50..15c4616ab2043e0596ca316533090a3b7221b190 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/link-isn.phtml @@ -1,3 +1,4 @@ +<!-- finc: RecordDriver - SolrAi - link-isn --> <? // use advanced search if we have multiple issns if (is_array($this->lookfor) && count($this->lookfor) > 1) { @@ -11,4 +12,5 @@ $query = '?lookfor=%22' . urlencode($this->lookfor) . '%22&type=ISN'; } ?> -<?=$this->url('search-results') . $query?> \ No newline at end of file +<?=$this->url('search-results') . $query?> +<!-- finc: RecordDriver - SolrAi - link-isn - END --> diff --git a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml index d0a0d0f9afe20580f5dfe9c44037640aef686d7d..284352c9705174d63f7904fa98009ab38422b962 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml @@ -1,4 +1,4 @@ -<!-- finc: recordDriver - solrAI - RESULT-LIST --> +<!-- finc: recordDriver - solrAI - result-list --> <? /* compare with solrDefault - result-list during upgrades! - CK */ ?> <? $coverDetails = $this->record($this->driver)->getCoverDetails('result-list', 'medium', $this->recordLink()->getUrl($this->driver)); @@ -12,7 +12,7 @@ if ($cover): </div> <? $thumbnail = ob_get_contents(); ?> <? ob_end_clean(); ?> - <? /* Show finc style-based icons; FIXME: FRANK: BITTE PRUEFEN, ob ich das richtig gebastelt habe! */ ?> + <? /* Show finc style-based icons; */ ?> <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> <? ob_start(); ?> <div class="media-<?=$thumbnailAlignment?> record-icon"> @@ -30,9 +30,7 @@ if ($cover): <?=$thumbnail?> <? endif ?> <div class="media-body"> - <div class="row short-view"> - <? /* finc: use col-xs too for better mobile looks, CK*/ ?> - <div class="col-xs-10 col-sm-8 middle"> + <div class="result-body"> <div> <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>"> <?=$this->record($this->driver)->getTitleHtml()?> @@ -56,11 +54,9 @@ if ($cover): <? if (!empty($journalTitle)): ?> <?=!empty($summAuthor) ? '<br />' : ''?> <?=$this->transEsc('Published in')?> - <? - $containerSource = $this->driver->getSourceIdentifier(); - $containerID = $this->driver->getContainerRecordID(); - - // finc specific journalLink generation + <? $containerSource = $this->driver->getSourceIdentifier(); + $containerID = $this->driver->getContainerRecordID(); + // finc-specific journalLink generation $journalLink = ''; $issns = $this->driver->getISSNs(); @@ -81,6 +77,7 @@ if ($cover): <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?> <? elseif (!empty($summDate)): ?> <?=!empty($summAuthor) ? '<br />' : ''?> + <? /* finc-specific: nxt line #8639 - CK */ ?> <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?> <? endif; ?> <? $summInCollection = $this->driver->getContainingCollections(); @@ -177,6 +174,7 @@ if ($cover): <? endif; ?> <? endif; ?> + <div class="result-formats"> <?=$this->record($this->driver)->getFormatList()?> <? /* WISO Label - finc-specific - CK */ ?> @@ -190,10 +188,13 @@ if ($cover): <span class="label label-default"><?=$this->transEsc('Loading')?> ...</span> </span> <? endif; ?> + </div> + + <div class="result-previews"> <?=$this->record($this->driver)->getPreviews()?> </div> - <? /* finc: use col-xs too for better mobile looks, CK*/ ?> - <div class="col-xs-2 col-sm-3 right hidden-print"> + </div> + <div class="result-links hidden-print"> <? /* Display qrcode if appropriate: */ ?> <? if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?> <? @@ -211,28 +212,33 @@ if ($cover): </span> <? endif; ?> + <? if ($this->cart()->isActiveInSearch() && $this->params->getOptions()->supportsCart() && $this->cart()->isActive()): ?> + <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]); ?><br/> + <? endif; ?> + <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <? /* Add to favorites */ ?> - <? /* Keep Icon inside link - CK */ ?> - <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" title="<?=$this->transEsc('Add to favorites')?>"> - <i class="fa fa-fw fa-star" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?=$this->transEsc('Add to favorites')?></span> + <?/* if ($this->permission()->allowDisplay('feature.Favorites')): */?> + <? /* Add to favorites; finc: keep Icon inside link - CK */ ?> + <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" title="<?=$this->transEsc('Add to favorites')?>"> + <i class="result-link-icon fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Add to favorites')?> </a><br/> + <? elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> + <?=$block?> + <? endif; ?> <? /* Saved lists */ ?> <div class="savedLists alert alert-info hidden"> <strong><?=$this->transEsc("Saved in")?>:</strong> </div> - <? endif; ?> + <? /* endif; */?> - <? /* Hierarchy tree link */ ?> - <? /* Keep Icon inside link - CK */ ?> + <? /* Hierarchy tree link; finc: keep Icon inside link - CK */ ?> <? $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"/> - <a class="hierarchyTreeLinkText" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" data-lightbox-post="tab=hierarchytree"> - <i class="fa fa-fw fa-sitemap" aria-hidden="true"></i> - <span class="hidden-xs hidden-sm"><?=$this->transEsc('hierarchy_view_context')?></span><? if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><? endif; ?> + <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" data-lightbox-post="tab=hierarchytree"> + <i class="result-link-icon fa fa-fw fa-sitemap" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?=$this->transEsc('hierarchy_view_context')?></span><? if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><? endif; ?> </a> </div> <? endforeach; ?> @@ -241,9 +247,8 @@ if ($cover): <?=$this->driver->supportsCoinsOpenUrl() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()) . '"></span>' : ''?> </div> </div> - </div> <? if ($thumbnail && $thumbnailAlignment == 'right'): ?> <?=$thumbnail?> <? endif ?> </div> -<!-- finc: recordDriver - solrAI - RESULT-LIST - END --> +<!-- finc: recordDriver - solrAI - result-list - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/collection-info.phtml b/themes/finc/templates/RecordDriver/SolrDefault/collection-info.phtml index 508bfdd30dd10467307d89e54529a14103550fc5..2215d787c0e93b2f5d250d04218c2dc14861431f 100644 --- a/themes/finc/templates/RecordDriver/SolrDefault/collection-info.phtml +++ b/themes/finc/templates/RecordDriver/SolrDefault/collection-info.phtml @@ -1,12 +1,12 @@ <!-- finc: recordDriver - solrDefault - collection-info --> <? $this->headScript()->appendFile('collection_record.js'); ?> -<div class="row"> +<div class="media"> <? $QRCode = $this->record($this->driver)->getQRCode("core"); - $cover = $this->record($this->driver)->getCover('collection-info', 'medium', $this->record($this->driver)->getThumbnail('large')); + $coverDetails = $this->record($this->driver)->getCoverDetails('collection-info', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; $preview = $this->record($this->driver)->getPreviews(); ?> <? if ($QRCode || $cover || $preview): ?> - <div class="col-sm-3"> - <div class="text-center"> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?>"> <? /* Display thumbnail if appropriate: */ ?> <? if($cover): ?> <?=$cover?> @@ -18,18 +18,13 @@ <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> </span> <? endif; ?> - </div> <? if ($preview): ?><?=$preview?><? endif; ?> </div> - - <? /* Use 9 columns if image is available, use 12 cols, if not -- CK */ ?> - <div class="col-sm-9"> - <? else: ?> - <div class="col-sm-12"> <? endif; ?> + <div class="media-body"> - <? /* For all finc-records we want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> + <? /* finc: we want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> <h2><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h2> <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $summary[0] : false; ?> @@ -46,261 +41,20 @@ <? /* Do not set to 'hidden' and make table below collapsible - CK */ ?> <a id="moreInfoToggle" href="#" class="accordion-toggler" data-toggle="collapse" aria-expanded="false"><?=$this->transEsc('Description')?></a> <?/* Display Main Details */?> + <? + $formatter = $this->recordDataFormatter(); + $fields = $formatter->getData($driver, $formatter->getDefaults('collection-info')); + ?> + <? if (!empty($fields)): ?> <?/* finc: we use 'collapse in' to initially hide the content, CK */?> <table id="collectionInfo" class="table table-striped collapse in"> <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> - <? /* finc spec. authors dedupe; same in recordDriver - solrDefault - core, and other core.phtml files, CK */ ?> - <? $authors = $this->driver->getDeduplicatedAuthors(); if ((isset($authors['main']) && count($authors['main'])) || (isset($authors['secondary']) && count($authors['secondary'])) || (isset($authors['corporate']) && count($authors['corporate'])) || (isset($authors['corporate_secondary']) && count($authors['corporate_secondary']))): ?> - <? /* finc spec. authors dedupe - END */ ?> - <tr> - <th> - <? /* BS version with '1. Verfasser ..., 2. Verfasser ... etc.' -- there is a larger block from 2016, dubbed 'Improved author indexing', see git hostroy of bootstrap/RecordDriver/SolrDefault/collection-info.phtml */ - /* <?=$this->transEsc(count($authors['main']) > 1 ? 'Main Authors' : 'Main Author')?>: - */ ?> - - <? /* finc version: 'Personen und Koerperschaften' */ ?> - <?=$this->transEsc('Authors/Corporations')?>: - </th> - <td> - <? if (isset($authors['main']) && count($authors['main'])): ?> - <? $i = 0; foreach ($authors['main'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="author"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['main_orig'][$author])?" / ".array_pop($authors['main_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['secondary']) && count($authors['secondary'])): ?> - <?=count($authors['main'])?'; ':''?> - <? $i = 0; foreach ($authors['secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['secondary_orig'][$author])?" / ".array_pop($authors['secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate']) && count($authors['corporate'])): ?> - <?=count($authors['main'])||count($authors['secondary'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="creator"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_orig'][$author])?" / ".array_pop($authors['corporate_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate_secondary']) && count($authors['corporate_secondary'])): ?> - <?=count($authors['main'])||count($authors['secondary'])||count($authors['corporate'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate_secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_secondary_orig'][$author])?" / ".array_pop($authors['corporate_secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - </td> - </tr> - <? endif; ?> - <? /* finc version: 'Personen und Koerperschaften' - END */ ?> - - <? /* finc: NO corporate authors here but title details, CK */ ?> - <? $titleDetails = $this->driver->getTitleDetails(); if (!empty($titleDetails)): ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"> - <? $i = 0; foreach ($titleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? else: ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection()) . ($this->driver->getTitleStatement() ? ' / ' . $this->driver->getTitleStatement() : '')?><br /><?=($this->driver->tryMethod('getTitleOrig') && $this->driver->getTitleOrig() != '' ? $this->escapeHtml($this->driver->getTitleOrig()) : '')?></td> - </tr> - <? endif; ?> - <? /* finc: NO corporate authors here but title details - END */ ?> - <? /* finc: dateSpan, CK */ ?> - <? $dateSpan = $this->driver->getDateSpan(); if (!empty($dateSpan)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Dates of publication')?>: </th> - <td> - <? foreach ($dateSpan as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc: dateSpan - END */ ?> - <? /* finc-specific snippet - END */ ?> - - <? if (count($summary) > 1): ?> - <tr> - <th><?=$this->transEsc('Summary')?>: </th> - <td> - <? foreach (array_slice($summary, 1) as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc specific - formats - below, in BS here - CK */ ?> - - <? /* finc-specific: langs at the end of the table, not here - CK */ ?> - - <? $publications = $this->driver->getPublicationDetails(); if (!empty($publications)): ?> - <tr> - <th><?=$this->transEsc('Published')?>: </th> - <td> - <? foreach ($publications as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> - <tr> - <th><?=$this->transEsc('Edition')?>: </th> - <td><?=$this->escapeHtml($edition)?></td> - </tr> - <? endif; ?> - - <?/* Display series section if at least one series exists. */?> - <? $series = $this->driver->getSeries(); if (!empty($series)): ?> - <tr> - <th><?=$this->transEsc('Series')?>: </th> - <td> - <? foreach ($series as $field): ?> - <?/* Depending on the record driver, $field may either be an array with - "name" and "number" keys or a flat string containing only the series - name. We should account for both cases to maximize compatibility. */?> - <? if (is_array($field)): ?> - <? if (!empty($field['name'])): ?> - <a href="<?=$this->record($this->driver)->getLink('series', $field['name'])?>"><?=$this->escapeHtml($field['name'])?></a> - <? if (!empty($field['number'])): ?> - <?=$this->escapeHtml($field['number'])?> - <? endif; ?> - <br/> - <? endif; ?> - <? else: ?> - <a href="<?=$this->record($this->driver)->getLink('series', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endif; ?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $subjects = $this->driver->getAllSubjectHeadings(); if (!empty($subjects)): ?> - <tr> - <th><?=$this->transEsc('Subjects')?>: </th> - <td> - <? foreach ($subjects as $field): ?> - <div class="subject-line"> - <? $subject = ''; ?> - <? $i = 0; foreach ($field as $subfield): ?> - <?=($i++ == 0) ? '' : ' > '?> - <? $subject = trim($subject . ' ' . $subfield); ?> - <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" class="subjectHeading" rel="nofollow"><?=$this->escapeHtml($subfield)?></a> - <? endforeach; ?> - </div> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? - $openUrl = $this->openUrl($this->driver, 'record'); - $openUrlActive = $openUrl->isActive(); - // Account for replace_other_urls setting - $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); - ?> - <? if (!empty($urls) || $openUrlActive): ?> - <tr> - <th><?=$this->transEsc('Online Access')?>: </th> - <td> - <? foreach ($urls as $current): ?> - <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> - <? endforeach; ?> - <? if ($openUrlActive): ?> - <?=$openUrl->renderTemplate()?><br/> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? $notes = $this->driver->getGeneralNotes(); if (!empty($notes)): ?> - <tr> - <th><?=$this->transEsc('Notes')?>: </th> - <td> - <? foreach ($notes as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $credits = $this->driver->getProductionCredits(); if (!empty($credits)): ?> - <tr> - <th><?=$this->transEsc('Production Credits')?>: </th> - <td> - <? foreach ($credits as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc-specific hierarchyParentTitle - not in BS- CK */ ?> - <? $hierarchyParentTitle = $this->driver->getHierarchyParentTitle(); if (!empty($hierarchyParentTitle) && empty($series)): ?> - <tr> - <th><?=$this->transEsc('Set Multipart')?>: </th> - <td> - <? $hierarchyParentId = $this->driver->getHierarchyParentID(); ?> - <? foreach ($hierarchyParentTitle as $key=>$hTitle): ?> - <? if(isset($hierarchyParentId[$key])): ?><a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key])?>"><? endif; ?><?=$this->escapeHtml($hTitle)?><? if(isset($hierarchyParentId[$key])): ?></a><? endif; ?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc-specific hierarchyParentTitle - END */ ?> - - <? $isbns = $this->driver->getISBNs(); if (!empty($isbns)): ?> - <tr> - <th><?=$this->transEsc('ISBN')?>: </th> - <td> - <? foreach ($isbns as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $issns = $this->driver->getISSNs(); if (!empty($issns)): ?> - <tr> - <th><?=$this->transEsc('ISSN')?>: </th> - <td> - <? foreach ($issns as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc specific snippet - additionalNotes - not in BS - CK */ ?> - <? $additionalNotes = (array) $this->driver->tryMethod('getAdditionalNotes'); if (!empty($additionalNotes)): ?> - <tr> - <th><?=$this->transEsc('Notes')?>: </th> - <td> - <? foreach ($additionalNotes as $note): ?> - <?=$this->escapeHtml($note)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc specific snippet - additionalNotes - END */ ?> - - <? /* finc specific snippet - formats - here, in BS above - CK */ ?> - <? $formats = $this->driver->getFormats(); if (!empty($formats)): ?> - <tr> - <th><?=$this->transEsc('Format')?>: </th> - <td><?=$this->record($this->driver)->getFormatList()?></td> - </tr> - <? endif; ?> - <? /* finc specific snippet - formats - END */ ?> - - <? /* finc-specific langs here, at the end of the table -CK */ ?> - <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?> - <tr> - <th><?=$this->transEsc('Language')?>: </th> - <td><? $i = 0; foreach ($langs as $lang): ?><?=($i++ == 0)?'':', '?><?= $this->transEsc($lang)?><? endforeach; ?></td> - </tr> - <? endif; ?> - <? /* finc-specific langs here, at the end of the table - END */ ?> - - </table> + <? foreach ($fields as $key => $current): ?> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> + <? endforeach; ?> + </table> + <? endif; ?> <?/* End Main Details */?> </div> </div> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/collection-record.phtml b/themes/finc/templates/RecordDriver/SolrDefault/collection-record.phtml index 1323bce9613b84d901ef44b722cc3f2c64c4fe08..40a043a32bcfd020ec52df83d0c9055bce6e7c7c 100644 --- a/themes/finc/templates/RecordDriver/SolrDefault/collection-record.phtml +++ b/themes/finc/templates/RecordDriver/SolrDefault/collection-record.phtml @@ -4,83 +4,17 @@ </h2> <a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc('View Full ' . ($this->driver->isCollection() ? 'Collection' : 'Record'))?></a> +<? +$formatter = $this->recordDataFormatter(); +$fields = $formatter->getData($driver, $formatter->getDefaults('collection-record')); +?> +<? if (!empty($fields)): ?> <table class="table table-striped"> <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> - <caption class="sr-only"> - <?=$this->transEsc('Bibliographic Details')?> - </caption> - <? $summary = $this->driver->getSummary(); - $summary = isset($summary[0]) ? $summary[0] : false; ?> - <? if ($summary): ?> - <tr valign="top"> - <th><?=$this->transEsc('Description')?>:</th> - <td><?=$this->escapeHtml($summary)?></td> - </tr> - <? endif; ?> - - <? $authors = $this->driver->getDeduplicatedAuthors(); ?> - <? if (isset($authors['main']) && !empty($authors['main'])): ?> - <tr valign="top"> - <th><?=$this->transEsc(count($authors['main']) > 1 ? 'Main Authors' : 'Main Author')?>:</th> - <td> - <? $i = 0; - foreach ($authors['main'] as $author => $roles): ?><?=($i++ == 0) ? '' : ', '?><a - href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?></a><? if (count($roles) > 0): ?> (<? $j = 0; - foreach ($roles as $role): ?><?=($j++ == 0) ? '' : ', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?><? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (isset($authors['corporate']) && !empty($authors['corporate'])): ?> - <tr valign="top"> - <th><?=$this->transEsc(count($authors['corporate']) > 1 ? 'Corporate Author' : 'Corporate Authors')?>:</th> - <td> - <? $i = 0; - foreach ($authors['corporate'] as $corporate => $roles): ?><?=($i++ == 0) ? '' : ', '?><a - href="<?=$this->record($this->driver)->getLink('author', $corporate)?>"><?=$this->escapeHtml($corporate)?></a><? if (count($roles) > 0): ?> (<? $j = 0; - foreach ($roles as $role): ?><?=($j++ == 0) ? '' : ', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?><? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $langs = $this->driver->getLanguages(); - if (!empty($langs)): ?> - <tr valign="top"> - <th><?=$this->transEsc('Language')?>:</th> - <td><? foreach ($langs as $lang): ?><?=$this->escapeHtml($lang)?><br/><? endforeach; ?></td> - </tr> - <? endif; ?> - - <? $formats = $this->driver->getFormats(); - if (!empty($formats)): ?> - <tr valign="top"> - <th><?=$this->transEsc('Format')?>:</th> - <td><?=$this->record($this->driver)->getFormatList()?></td> - </tr> - <? endif; ?> - - <? $access = $this->driver->getAccessRestrictions(); - if (!empty($access)): ?> - <tr valign="top"> - <th><?=$this->transEsc('Access')?>:</th> - <td> - <? foreach ($access as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $related = $this->driver->getRelationshipNotes(); - if (!empty($related)): ?> - <tr valign="top"> - <th><?=$this->transEsc('Related Items')?>:</th> - <td> - <? foreach ($related as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <? foreach ($fields as $key => $current): ?> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> + <? endforeach; ?> </table> +<? endif; ?> <!-- finc: recordDriver - solrDefault - collection-record - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/core.phtml b/themes/finc/templates/RecordDriver/SolrDefault/core.phtml index bebac1e6eb2ee9a1ae34e15006f87cf24dbbcd16..b921fe2429d2110c1289aacbb4bc36e3530d0ef2 100644 --- a/themes/finc/templates/RecordDriver/SolrDefault/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrDefault/core.phtml @@ -1,39 +1,21 @@ -<!-- finc: recordDriver - solrDefault - CORE --> -<? /* also compare SolrMarc, SolrAi, SolrLido - core with SolrDefault - core during updates! */ ?> -<? -if($loggedin = $this->auth()->isLoggedIn()) { - $user_id = $loggedin->id; - $loggedin = true; -} else { - $user_id = false; -} - - $formatRoles = function ($roles) { - if (count($roles) == 0) { - return ''; - } - $that = $this; - $translate = function ($str) use ($that) { - return $that->transEsc('CreatorRoles::' . $str); - }; - return ' (' . implode(', ', array_unique(array_map($translate, $roles))) . ')'; - }; -?> -<div class="row" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> - <? $QRCode = $this->record($this->driver)->getQRCode("core"); - $cover = $this->record($this->driver)->getCover('core', 'medium', $this->record($this->driver)->getThumbnail('large')); - $preview = $this->record($this->driver)->getPreviews(); ?> +<!-- finc: RecordDriver - solrDefault - core --> +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> + <? + $QRCode = $this->record($this->driver)->getQRCode("core"); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; + $preview = $this->record($this->driver)->getPreviews(); + ?> <? if ($QRCode || $cover || $preview): ?> - <div class="col-sm-3 img-col"> - <div class="gutter-l"> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> <? /* Display thumbnail if appropriate: */ ?> - <? if($cover): ?> - <?=$cover?> - <? /* BOF - finc-specific StyleBasedIcons */ ?> - <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> - <?=$this->record($this->driver)->getFormatIcon()?> - <? /* EOF - finc-specific StyleBasedIcons */ ?> - <? endif; ?> + <? if($cover): ?> + <?=$cover?> + <? /* BOF - finc-specific StyleBasedIcons */ ?> + <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <?=$this->record($this->driver)->getFormatIcon()?> + <? /* EOF - finc-specific StyleBasedIcons */ ?> + <? endif; ?> <? /* Display qrcode if appropriate: */ ?> <? if($QRCode): ?> @@ -41,29 +23,29 @@ if($loggedin = $this->auth()->isLoggedIn()) { <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> </span> <? endif; ?> - </div> - <? // if you have a preview tab but want to move or remove the preview link - // from this area of the record view, this can be split into - // getPreviewData() (should stay here) and - // getPreviewLink() (can go in your desired tab) ?> - <? if ($preview): ?><?=$preview?><? endif; ?> + <? // if you have a preview tab but want to move or remove the preview link + // from this area of the record view, this can be split into + // getPreviewData() (should stay here) and + // getPreviewLink() (can go in your desired tab) ?> + <? if ($preview): ?> + <div class="record-previews"> + <?=$preview?> + </div> + <? endif; ?> </div> - - <div class="col-sm-9 info-col"> - <? else: ?> - <div class="col-sm-12"> <? endif; ?> + <div class="media-body"> - <? /* For all finc-records; We want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> - <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> + <? /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> <? if ($summary): ?> <p><?=$this->truncate($summary, 300)?></p> <? if(strlen($summary) > 300): ?> - <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>'><?=$this->transEsc('Full description')?></a></p> + <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> <? endif; ?> <? endif; ?> @@ -75,338 +57,20 @@ if($loggedin = $this->auth()->isLoggedIn()) { <? endif; ?> <?/* Display Main Details */?> - <table class="table table-striped"> - <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> - <? $journalTitle = $this->driver->getContainerTitle(); if (!empty($journalTitle)): ?> - <tr> - <th><?=$this->transEsc('Published in')?>:</th> - <td> - <? - $containerSource = $this->driver->getSourceIdentifier(); - $containerID = $this->driver->getContainerRecordID(); - ?> - <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', $journalTitle))?>"><?=$this->escapeHtml($journalTitle)?></a> - <? $ref = $this->driver->getContainerReference(); if (!empty($ref)) { echo $this->escapeHtml($ref); } ?> - </td> - </tr> - <? endif; ?> - - <? $nextTitles = $this->driver->getNewerTitles(); $prevTitles = $this->driver->getPreviousTitles(); ?> - <? if (!empty($nextTitles)): ?> - <tr> - <th><?=$this->transEsc('New Title')?>: </th> - <td> - <? foreach($nextTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (!empty($prevTitles)): ?> - <tr> - <th><?=$this->transEsc('Previous Title')?>: </th> - <td> - <? foreach($prevTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc specific rows - Start; same in recordDriver - solrDefault - collection-info, and other core.phtml files */ ?> - <? /* finc spec. authors dedupe, CK */ ?> - <? $authors = $this->driver->getDeduplicatedAuthors(); if ((isset($authors['main']) && count($authors['main'])) || (isset($authors['secondary']) && count($authors['secondary'])) || (isset($authors['corporate']) && count($authors['corporate'])) || (isset($authors['corporate_secondary']) && count($authors['corporate_secondary']))): ?> - <? /* finc spec. authors dedupe - END */ ?> - <tr> - <th> - <? /* BS version with '1. Verfasser ..., 2. Verfasser ... etc.' -- there is a larger block from 2016, dubbed 'Improved author indexing', see git hostroy of bootstrap/RecordDriver/SolrDefault/collection-info.phtml */ - /* <?=$this->transEsc(count($authors['main']) > 1 ? 'Main Authors' : 'Main Author')?>: - */ ?> - <? /* finc version: 'Personen und Koerperschaften' */ ?> - <?=$this->transEsc('Authors/Corporations')?>: - </th> - <td> - <? if (isset($authors['main']) && count($authors['main'])): ?> - <? $i = 0; foreach ($authors['main'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="author"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['main_orig'][$author])?" / ".array_pop($authors['main_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['secondary']) && count($authors['secondary'])): ?> - <?=count($authors['main'])?'; ':''?> - <? $i = 0; foreach ($authors['secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['secondary_orig'][$author])?" / ".array_pop($authors['secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate']) && count($authors['corporate'])): ?> - <?=count($authors['main'])||count($authors['secondary'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="creator"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_orig'][$author])?" / ".array_pop($authors['corporate_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate_secondary']) && count($authors['corporate_secondary'])): ?> - <?=count($authors['main'])||count($authors['secondary'])||count($authors['corporate'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate_secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_secondary_orig'][$author])?" / ".array_pop($authors['corporate_secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - </td> - </tr> - <? endif; ?> - <? /* finc version: 'Personen und Koerperschaften' - END */ ?> - - <? /* finc: NO corporate authors here but title details, CK */ ?> - <? $titleDetails = $this->driver->getTitleDetails(); if (!empty($titleDetails)): ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"> - <? $i = 0; foreach ($titleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? else: ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection()) . ($this->driver->getTitleStatement() ? ' / ' . $this->driver->getTitleStatement() : '')?><br /><?=($this->driver->tryMethod('getTitleOrig') && $this->driver->getTitleOrig() != '' ? $this->escapeHtml($this->driver->getTitleOrig()) : '')?></td> - </tr> - <? endif; ?> - <? /* finc: NO corporate authors here but title details - END */ ?> - <? /* finc: NO authors secondary here, but getTitleUniform, CK */ ?> - <? $titleUniform = $this->driver->getTitleUniform(); ?> - <? if (!empty($titleUniform)): ?> - <tr> - <th><?=$this->driver->isRDA()?$this->transEsc('rda_original_title'):$this->transEsc('non_rda_original_title')?>: </th> - <td><a href="<?=$this->record($this->driver)->getLink('title', $titleUniform)?>"><?=$this->escapeHtml($titleUniform)?></a></td> - </tr> - <? endif; ?> - <? /* finc: NO authors secondary here, but getTitleUniform - END */ ?> - <? /* finc: NO getFormats here, but getEdition, getFormats below; CK */ ?> - <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> - <tr> - <th><?=$this->transEsc('Edition')?>: </th> - <td property="bookEdition"><?=$this->escapeHtml($edition)?><? $editionOrig = $this->driver->getEditionOrig(); if (!empty($editionOrig)): ?><br /><?=$this->escapeHtml($editionOrig)?><? endif; ?></td> - </tr> - <? endif; ?> - <? /* finc: NO getFormats here, but getEdition - END */ ?> - <? /* finc: getDissertationNote, CK */ ?> - <? $dissertationNote = $this->driver->getDissertationNote(); if (!empty($dissertationNote)): ?> - <? $first = true; $dissertation = ''; foreach ($dissertationNote as $val): $dissertation .= (false === $first) ? ', ' . $val : $val ; $first = false; endforeach; ?> - <tr> - <th><?=$this->transEsc('Dissertation Note')?>: </th> - <td><?=$this->transEsc($dissertation)?></td> - </tr> - <? endif; ?> - <? /* finc: getDissertationNote, CK */ ?> - <? /* finc specific snippets - END */ ?> - - <? /* getFormats as in BS solrDefault - core; CK */ ?> - <? if (count($this->driver->getFormats()) > 0): ?> - <tr> - <th><?=$this->transEsc('Format')?>: </th> - <td><?=$this->record($this->driver)->getFormatList()?></td> - </tr> - <? endif; ?> - - <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?> - <tr> - <th><?=$this->transEsc('Language')?>: </th> - <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang)?><br/><? endforeach; ?></td> - </tr> - <? endif; ?> - - <? $publications = $this->driver->getPublicationDetails(); - if (!empty($publications)): ?> - <tr> - <th><?=$this->transEsc('Published')?>: </th> - <? /* finc: microdate/schema org improvements - CK */?> - <td itemscope itemtype="http://schema.org/publisher"> - <? foreach ($publications as $field): ?> - <span property="publisher"> - <? $pubPlace = $field->getPlace(); if (!empty($pubPlace)): ?> - <span itemprop="location"><?=$this->escapeHtml($pubPlace)?></span> - <? endif; ?> - <? $pubName = $field->getName(); if (!empty($pubName)): ?> - <span itemprop="name"><?=$this->escapeHtml($pubName)?></span> - <? endif; ?> - </span> - <? $pubDate = $field->getDate(); if (!empty($pubDate)): ?> - <span property="datePublished"><?=$this->escapeHtml($pubDate)?></span> - <? endif; ?> - <br/> - <? endforeach; ?> - </td> - <? /* finc: microdate/schema org improvements - END */?> - </tr> - <? endif; ?> - - <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> - <tr> - <th><?=$this->transEsc('Edition')?>: </th> - <td property="bookEdition"><?=$this->escapeHtml($edition)?></td> - </tr> - <? endif; ?> - - <? /* finc specific snippet 'getHierarchyParentTitle' - replaces getSeries, CK */ ?> - <? $hierarchyParentTitle = $this->driver->getHierarchyParentTitle(); if (!empty($hierarchyParentTitle) && empty($series)): ?> - <tr> - <th><?=$this->transEsc('Set Multipart')?>: </th> - <td> - <? $hierarchyParentId = $this->driver->getHierarchyParentID(); ?> - <? foreach ($hierarchyParentTitle as $key=>$hTitle): ?> - <? if(isset($hierarchyParentId[$key])): ?><a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key])?>"><? endif; ?><?=$this->escapeHtml($hTitle)?><? if(isset($hierarchyParentId[$key])): ?></a><? endif; ?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc specific snippet *getHierarchyParentTitle' - replaces getSeries - End */ ?> - - <? $subjects = $this->driver->getAllSubjectHeadings(); if (!empty($subjects)): ?> - <tr> - <th><?=$this->transEsc('Subjects')?>: </th> - <td> - <? foreach ($subjects as $field): ?> - <div class="subject-line" property="keywords"> - <? $subject = ''; ?> - <? if(count($field) == 1) $field = explode('--', $field[0]); ?> - <? $i = 0; foreach ($field as $subfield): ?> - <?=($i++ == 0) ? '' : ' > '?> - <? $subject = trim($subject . ' ' . $subfield); ?> - <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a> - <? endforeach; ?> - </div> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $childRecordCount = $this->driver->tryMethod('getChildRecordCount'); if ($childRecordCount): ?> - <tr> - <th><?=$this->transEsc('child_records')?>: </th> - <td> - <a href="<?=$this->recordLink()->getChildRecordSearchUrl($this->driver)?>"><?=$this->transEsc('child_record_count', array('%%count%%' => $childRecordCount))?></a> - </td> - </tr> - <? endif; ?> - - <? - $openUrl = $this->openUrl($this->driver, 'record'); - $openUrlActive = $openUrl->isActive(); - // Account for replace_other_urls setting - $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); - ?> - <? if (!empty($urls) || $openUrlActive): ?> - <tr> - <th><?=$this->transEsc('Online Access')?>: </th> - <td> - <? foreach ($urls as $current): ?> - <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> - <? endforeach; ?> - <? if ($openUrlActive): ?> - <?=$openUrl->renderTemplate()?><br/> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? $recordLinks = $this->driver->getAllRecordLinks(); ?> - <? if(!empty($recordLinks)): ?> - <tr> - <th><?=$this->transEsc('Related Items')?>:</th> - <td> - <? foreach ($recordLinks as $recordLink): ?> - <?=$this->transEsc($recordLink['title'])?>: - <a href="<?=$this->recordLink()->related($recordLink['link'])?>"><?=$this->escapeHtml($recordLink['value'])?></a><br /> - <? endforeach; ?> - <? /* if we have record links, display relevant explanatory notes */ - $related = $this->driver->getRelationshipNotes(); - if (!empty($related)): ?> - <? foreach ($related as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc-specific - getAdditionals, #7745 - removes additionals tab + adds additionals info to core template; - NOT in BS; Fixme: DO WE STILL NEED THIS? Was REMOVED from solrMarc core, #8918, CK */ ?> - <? $additionals = $this->driver->getAdditionals(); if (!empty($additionals) && is_array($additionals)): ?> - <? foreach($additionals as $additional) :?> - <? if (isset($additional['identifier'])): ?> - <tr> - <th><?=$this->escapeHtml($additional['identifier'])?>: </th> - <td> - <? if(isset($additional['id'])): ?><a href="<?=$this->recordLink()->getUrl($additional['id'])?>"><? endif; ?> - <?=$this->escapeHtml($additional['text'])?> - <? if(isset($additional['id'])): ?></a><? endif; ?> - </td> - </tr> - <? endif; ?> - <? endforeach; ?> - <? endif; ?> - <? /* finc-specific - getAdditionals, #7745 - END */ ?> - - <? if ($this->usertags()->getMode() !== 'disabled'): ?> - <? $tagList = $this->driver->getTags(null, null, 'count', $user_id); ?> - <tr> - <th><?=$this->transEsc('Tags')?>: </th> - <td> - <a class="tag-record btn btn-link pull-right flip hidden-print" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox> - <i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Add Tag')?> - </a> - <?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?> - </td> - </tr> - <? endif; ?> - - <? /* finc specific snippets - getHierarchyParentTitle, getMegaCollection, getOtherRelationshipEntry, getAdditionalNotes - NOT in BS - CK */ ?> - <? $hierarchyParentTitle = $this->driver->getHierarchyParentTitle(); if (!empty($hierarchyParentTitle) && empty($series)): ?> - <tr> - <th><?=$this->transEsc('Set Multipart')?>: </th> - <td> - <? $hierarchyParentId = $this->driver->getHierarchyParentID(); ?> - <? foreach ($hierarchyParentTitle as $key=>$hTitle): ?> - <? if(isset($hierarchyParentId[$key])): ?><a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key])?>"><? endif; ?><?=$this->escapeHtml($hTitle)?><? if(isset($hierarchyParentId[$key])): ?></a><? endif; ?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $megaCollection = (array) $this->driver->tryMethod('getMegaCollection'); if (!empty($megaCollection)): ?> - <tr> - <th><?=$this->transEsc('Source')?>: </th> - <td> - <? foreach ($megaCollection as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $otherRelationshipEntry = (array) $this->driver->tryMethod('getOtherRelationshipEntry'); if (!empty($otherRelationshipEntry)): ?> - <? foreach ($otherRelationshipEntry as $key => $values): ?> - <tr> - <th><?=$this->transEsc($key)?>: </th> - <td> - <? foreach ($values as $value): ?> - <? if (!empty($value['link']) && $recordLink = $this->RecordLink()->getRecordLink($value['link'], 'record_id')): ?> - <a href="<?=$recordLink?>"><?=$this->escapeHtml($value['text'])?></a><br/> - <? else: ?> - <?=$this->escapeHtml($value['text'])?><br/> - <? endif; ?> - <? endforeach; ?> - </td> - </tr> - <? endforeach; ?> - <? endif; ?> - - <? $additionalNotes = (array) $this->driver->tryMethod('getAdditionalNotes'); if (!empty($additionalNotes)): ?> - <tr> - <th><?=$this->transEsc('Notes')?>: </th> - <td> - <? foreach ($additionalNotes as $note): ?> - <?=$this->escapeHtml($note)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc specific snippets - getHierarchyParentTitle, getMegaCollection, getOtherRelationshipEntry, getAdditionalNotes - NOT in BS - END */ ?> - </table> + <? + $formatter = $this->recordDataFormatter(); + $coreFields = $formatter->getData($driver, $formatter->getDefaults('core')); + ?> + <? if (!empty($coreFields)): ?> + <table class="table table-striped"> + <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <? foreach ($coreFields as $key => $current): ?> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> + <? endforeach; ?> + </table> + <? endif; ?> <?/* End Main Details */?> </div> </div> -<!-- finc: recordDriver - solrDefault - CORE - END --> +<!-- finc: RecordDriver - solrDefault - core - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-addtitionals.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-addtitionals.phtml new file mode 100644 index 0000000000000000000000000000000000000000..8619aa16586ebb4d7af735626ef54503daa5a806 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-addtitionals.phtml @@ -0,0 +1,20 @@ +<!-- finc: RecordDriver - solrDefault - data-additionals --> +<? if (!empty($data) && is_array($data)): ?> + <? foreach($data as $additional) :?> + <? if (isset($additional['identifier'])): ?> + <tr> + <th> + <?=$this->escapeHtml($additional['identifier'])?>: + </th> + <td> + <? if(isset($additional['id'])): ?> + <a href="<?=$this->recordLink()->getUrl($additional['id'])?>"><?=$this->escapeHtml($additional['text'])?></a> + <? else: ?> + <?=$this->escapeHtml($additional['text'])?> + <? endif; ?> + </td> + </tr> + <? endif; ?> + <? endforeach; ?> +<? endif; ?> +<!-- finc: RecordDriver - solrDefault - data-additionals - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-authors.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-authors.phtml new file mode 100644 index 0000000000000000000000000000000000000000..3ecfd3cd37889a02a0d3982ddc9a8d5e74fbfac5 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-authors.phtml @@ -0,0 +1,55 @@ +<!-- finc: RecordDriver - solrDefault - data-authors --> +<? +$formatProperty = function ($datafield, $name, $label) { +if (count($datafield) == 0) { +return ''; +} +$that = $this; +$translate = function ($str) use ($that, $label) { +return $that->transEsc($label . $str); +}; +return '<span class="author-property-' . $name . '">(' . implode(', ', array_unique(array_map($translate, $datafield))) . ')</span>'; +}; +$formattedAuthors = []; +$types = [ + 'main' => 'author', + 'secondary' => 'contributor', + 'corporate' => 'creator', + 'corporate_secondary' => 'contributor' +]; +?> +<? foreach ($types as $type => $schemaLabel): ?> + <? if (!empty($data[$type])): ?> + <? foreach ($data[$type] as $author => $roles): ?> + <? ob_start(); ?> + <span class="author-data" property="<?=$this->escapeHtml($schemaLabel)?>"> + <a href="<?=$this->record($this->driver)->getLink('author', $author)?>"> + <?=$this->escapeHtml($author)?> + </a> + <? + // Display additional data using the appropriate translation prefix + // (for example, to render author roles correctly): + if (!empty($requiredDataFields)) { + foreach ($requiredDataFields as $field) { + $name = $field['name']; + $prefix = isset($field['prefix']) ? $field['prefix'] : ''; + // deprecated due to more flexible solution at core + // to-do: revision of indexing and finc specific treatment + // of roles in RecordDriver + if (count($roles) > 0 && $name == 'role') { + echo $formatProperty($roles, $name, $prefix); + } + } + } + ?> + </span> + <? + // Strip whitespace before close tags to avoid spaces in front of commas: + $formattedAuthors[] = trim(preg_replace('/\s+<\//', '</', ob_get_contents())); + ob_end_clean(); + ?> + <? endforeach; ?> + <? endif; ?> +<? endforeach; ?> +<?=implode(', ', $formattedAuthors)?> +<!-- finc: RecordDriver - solrDefault - data-authors - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-escapeHtml.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-escapeHtml.phtml new file mode 100644 index 0000000000000000000000000000000000000000..a92016aee7c71419e36da3aa492d3e9a1c94177b --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-escapeHtml.phtml @@ -0,0 +1,8 @@ +<? // Don't add START and END comments ?> +<?if (!empty($data)): ?> + <? if (is_array($data)): ?> + <?= implode('<br/>', array_map(array($this, 'escapeHtml'), $data)) ?> + <? else: ?> + <?= $this->escapeHtml($data) ?> + <? endif; ?> +<? endif; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-escapeHtmlCommaSep.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-escapeHtmlCommaSep.phtml new file mode 100644 index 0000000000000000000000000000000000000000..5015acbff85c15eebc2f578b7ca77ae4c0c28a3b --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-escapeHtmlCommaSep.phtml @@ -0,0 +1,9 @@ +<!-- finc: RecordDriver - solrDefault - data-escapeHtmlCommaSep --> +<? if (!empty($data)): ?> + <? if (is_array($data)): ?> + <?=implode(', ', array_map(array($this, 'escapeHtml'), $data)); ?> + <? else: ?> + <?= $this->escapeHtml($data) ?> + <? endif; ?> +<? endif; ?> +<!-- finc: RecordDriver - solrDefault - data-escapeHtmlCommaSep - END --> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-hierarchyParentTitle.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-hierarchyParentTitle.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d4da82d34b8ff8eb2d47f23987ae46224ba0395a --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-hierarchyParentTitle.phtml @@ -0,0 +1,13 @@ +<!-- finc: RecordDriver - solrDefault - data-hierarchyParentTitle --> +<? if (!empty($data)): ?> + <? $hierarchyParentId = $this->driver->tryMethod('getHierarchyParentID'); ?> + <? foreach ($data as $key => $title): ?> + <? if(isset($hierarchyParentId[$key])): ?> + <a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key]); ?>"><?=$this->escapeHtml($title)?></a> + <? else: ?> + <?=$this->escapeHtml($title)?> + <? endif; ?> + <br/> + <? endforeach; ?> +<? endif; ?> +<!-- finc: RecordDriver - solrDefault - data-hierarchyParentTitle - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-localSignature.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-localSignature.phtml new file mode 100644 index 0000000000000000000000000000000000000000..aecdb6d3c11bc3ef11908a62ac9dc43b30bf1950 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-localSignature.phtml @@ -0,0 +1,11 @@ +<!-- finc: RecordDriver - solrDefault - data-localSignature --> +<? if (!empty($data)): ?> + <? foreach ($data as $field): ?> + <? if (!empty($field)): ?> + <? foreach ($field as $subfield): ?> + <?=trim($this->escapeHtml($subfield))?> + <? endforeach; ?> + <? endif; ?> + <? endforeach; ?> +<? endif; ?> +<!-- finc: RecordDriver - solrDefault - data-localSignature - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-otherRelationshipEntry.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-otherRelationshipEntry.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d9a9c6f7714e1f6c69fb91b0229746af23fe1985 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-otherRelationshipEntry.phtml @@ -0,0 +1,19 @@ +<!-- finc: RecordDriver - solrDefault - data-otherRelationshipEntry --> +<? if (!empty($data)): ?> + <? foreach ($data as $subject => $values): ?> + <tr> + <th><?=$this->transEsc($subject)?>: </th> + <td> + <? foreach ($values as $value): ?> + <? if (!empty($value['link']) && $recordLink = $this->RecordLink()->getRecordLink($value['link'], 'record_id')): ?> + <a href="<?=$recordLink?>"><?=$this->escapeHtml($value['text'])?></a> + <? else: ?> + <?=$this->escapeHtml($value['text'])?> + <? endif; ?> + <br/> + <? endforeach; ?> + </td> + </tr> + <? endforeach; ?> +<? endif; ?> +<!-- finc: RecordDriver - solrDefault - data-otherRelationshipEntry - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-publicationDetails.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-publicationDetails.phtml new file mode 100644 index 0000000000000000000000000000000000000000..1992d50d9bcf1a349e4dc526fbf8f80bd91dfbe0 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-publicationDetails.phtml @@ -0,0 +1,24 @@ +<!-- finc: RecordDriver - solrDefault - data-publicationDetails --> +<? if (!empty($data)): ?> +<div itemscope itemtype="http://schema.org/publisher"> + <? foreach ($data as $field): ?> + <span property="publisher" typeof="Organization"> + <? $pubPlace = $field->getPlace(); if (!empty($pubPlace)): ?> + <span property="location"><?=$this->escapeHtml($pubPlace)?></span> + <? endif; ?> + <? $pubName = $field->getName(); if (!empty($pubName)): ?> + <span property="name"><?=$this->escapeHtml($pubName)?></span> + <? endif; ?> + </span> + <span property="datePublished"> + <? $pubDateSort = $this->driver->tryMethod('getPublishDateSort'); ?> + <? $pubDate = $field->getDate(); if (!empty($pubDateSort)): ?> + <?=$this->escapeHtml($pubDateSort)?> + <? else: ?> + <?=$this->escapeHtml($pubDate)?></span> + <? endif; ?> + </span><br/> + <? endforeach; ?> +</div> +<? endif ?> +<!-- finc: RecordDriver - solrDefault - data-publicationDetails - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-titleDetails.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-titleDetails.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f159ec0210700fd39f9febbcdd5524a0e317b24e --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-titleDetails.phtml @@ -0,0 +1,16 @@ +<!-- finc: RecordDriver - solrDefault - data-titleDetails --> +<span property="title"> +<? if (!empty($data)): ?> + <? $i = 0; foreach ($data as $title): ?> + <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> + <? endforeach; ?> +<? else: ?> + <?=$this->escapeHtml( + $this->driver->getShortTitle() . ' ' + . $this->driver->getSubtitle() . ' ' + . $this->driver->getTitleSection()) + . ($this->driver->getTitleStatement() ? ' / ' . $this->driver->getTitleStatement() : '')?><br /><?=($this->driver->tryMethod('getTitleOrig') && $this->driver->getTitleOrig() != '' ? $this->escapeHtml($this->driver->getTitleOrig()) : '') + ?> +<? endif; ?> +</span> +<!-- finc: RecordDriver - solrDefault - data-titleDetails - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-titleUniform.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-titleUniform.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b3e65ec21483e492d4799e1ad33b399e9594f631 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-titleUniform.phtml @@ -0,0 +1,14 @@ +<!-- finc: RecordDriver - solrDefault - data-titleUniform --> +<? if (!empty($data)): ?> + <tr> + <th> + <?=$this->driver->isRDA() + ? $this->transEsc('rda_original_title') + : $this->transEsc('non_rda_original_title')?>: + </th> + <td property="title"> + <a href="<?=$this->record($this->driver)->getLink('title', $data)?>"><?=$this->escapeHtml($data)?></a> + </td> + </tr> +<? endif; ?> +<!-- finc: RecordDriver - solrDefault - data-titleUniform - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/data-transEsc.phtml b/themes/finc/templates/RecordDriver/SolrDefault/data-transEsc.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e0a5c810ff41c3f28729c09cbfef268301b3fe29 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrDefault/data-transEsc.phtml @@ -0,0 +1,8 @@ +<? // Don't add START and END comments ?> +<?if (!empty($data)): ?> + <? if(is_array($data)): ?> + <?= implode('<br/>', array_map(array($this, 'transEsc'), $data)) ?> + <? else: ?> + <?=$this->transEsc($data)?> + <? endif; ?> +<? endif; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrDefault/link-subject.phtml b/themes/finc/templates/RecordDriver/SolrDefault/link-subject.phtml deleted file mode 100644 index a839e2967f54e3ced3b0d422858a12a3df0a821e..0000000000000000000000000000000000000000 --- a/themes/finc/templates/RecordDriver/SolrDefault/link-subject.phtml +++ /dev/null @@ -1 +0,0 @@ -<?=$this->url('search-results')?>?lookfor=<?=urlencode($this->lookfor)?>&type=Subject diff --git a/themes/finc/templates/RecordDriver/SolrDefault/list-entry.phtml b/themes/finc/templates/RecordDriver/SolrDefault/list-entry.phtml index 4a038c833273d1ea0d82f8312ec3240dd81774fb..a0a9d82f06ca58c66d78326b7637929a920a1355 100644 --- a/themes/finc/templates/RecordDriver/SolrDefault/list-entry.phtml +++ b/themes/finc/templates/RecordDriver/SolrDefault/list-entry.phtml @@ -1,3 +1,4 @@ +<!-- finc: RecordDriver - SolrDefault - mylist --> <? // Set up some convenience variables: $id = $this->driver->getUniqueId(); @@ -9,6 +10,7 @@ $list_id = null; $user_id = $this->user ? $this->user->id : null; } + // finc: next line finc-specific; required to display public favorites lists, #12052, see also below - CK $isEditable = $this->user && $this->user->id === $user_id; // Thumbnail $coverDetails = $this->record($this->driver)->getCoverDetails('list-entry', 'medium', $this->recordLink()->getUrl($this->driver)); @@ -26,16 +28,13 @@ <div class="result<? if($this->driver->supportsAjaxStatus()): ?> ajaxItem<? endif ?>"> <input type="hidden" value="<?=$this->escapeHtmlAttr($id) ?>" class="hiddenId"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($source) ?>" class="hiddenSource"/> - <div class="checkbox hidden-print"> - <label><?=$this->record($this->driver)->getCheckbox()?></label> - </div> + <?=$this->record($this->driver)->getCheckbox()?> <div class="media"> <? if ($thumbnail && $thumbnailAlignment == 'left'): ?> <?=$thumbnail ?> <? endif; ?> <div class="media-body"> - <div class="row short-view"> - <div class="col-sm-8"> + <div class="result-body"> <div class="resultItemLine1"> <? $missing = $this->driver instanceof \VuFind\RecordDriver\Missing; ?> <? if (!$missing): ?><a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="getFull" data-view="<?=$this->params->getOptions()->getListViewOption() ?>"><? endif; ?> @@ -170,7 +169,8 @@ </div> </div> - <div class="col-sm-4 right"> + <div class="result-links hidden-print"> + <? /* finc: next line finc-specific; required to display public favorites lists, #12052, see also above - CK */ ?> <? if ($isEditable): ?> <i class="fa fa-fw fa-edit" aria-hidden="true"></i> <a href="<?=$this->url('myresearch-edit')?>?id=<?=urlencode($id)?>&source=<?=urlencode($source)?><? if (!is_null($list_id)):?>&list_id=<?=urlencode($list_id)?><? endif; ?>" class="edit tool"><?=$this->transEsc('Edit')?></a><br/> <? /* Use a different delete URL if we're removing from a specific list or the overall favorites: */ @@ -182,7 +182,7 @@ $dLabel = 'delete-label-' . preg_replace('[\W]','-',$id); ?> <div class="dropdown"> - <i class="fa fa-fw fa-trash-o" aria-hidden="true"></i> <a class="dropdown-toggle" id="<?=$dLabel ?>" role="button" data-toggle="dropdown" data-target="#" href="<?=$deleteUrlGet ?>"> + <i class="fa fa-fw fa-trash-o" aria-hidden="true"></i> <a class="dropdown-toggle" id="<?=$dLabel ?>" role="button" data-toggle="dropdown" href="<?=$deleteUrlGet ?>"> <?=$this->transEsc('Delete') ?> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="<?=$dLabel ?>"> @@ -195,9 +195,10 @@ <? endif; ?> </div> </div> - </div> + <? if ($thumbnail && $thumbnailAlignment == 'right'): ?> <?=$thumbnail ?> <? endif; ?> </div> </div> +<!-- finc: RecordDriver - SolrDefault - mylist - END --> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrDefault/result-list.phtml b/themes/finc/templates/RecordDriver/SolrDefault/result-list.phtml index 2667771268b0ded4a069b8cab706c09dd698b8a3..90fdddb087eea0ef83731ae62fa57c54b52edad5 100644 --- a/themes/finc/templates/RecordDriver/SolrDefault/result-list.phtml +++ b/themes/finc/templates/RecordDriver/SolrDefault/result-list.phtml @@ -1,5 +1,5 @@ <!-- finc: recordDriver - solrDefault - result-list --> -<? /* compare solrAi - result-list with this one during upgrades! - CK */ ?> +<? /* finc: compare solrAi - result-list with this one during upgrades! - CK */ ?> <? $coverDetails = $this->record($this->driver)->getCoverDetails('result-list', 'medium', $this->recordLink()->getUrl($this->driver)); $cover = $coverDetails['html']; @@ -12,14 +12,14 @@ if ($cover): </div> <? $thumbnail = ob_get_contents(); ?> <? ob_end_clean(); ?> - <? /* Show finc style-based icons; FIXME: FRANK: BITTE PRUEFEN, ob ich das richtig gebastelt habe! */ ?> - <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> - <? ob_start(); ?> - <div class="media-<?=$thumbnailAlignment?> record-icon"> - <?=$this->record($this->driver)->getRecordIcon()?> - </div> - <? $thumbnail = ob_get_contents(); ?> - <? ob_end_clean(); ?> + <? /* Show finc style-based icons; */ ?> +<? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <? ob_start(); ?> + <div class="media-<?=$thumbnailAlignment?> record-icon"> + <?=$this->record($this->driver)->getRecordIcon()?> + </div> + <? $thumbnail = ob_get_contents(); ?> + <? ob_end_clean(); ?> <? /* Show finc style-based icons - END */ ?> <? endif; ?> @@ -30,69 +30,69 @@ if ($cover): <?=$thumbnail?> <? endif ?> <div class="media-body"> - <div class="row short-view"> - <? /* finc: use col-xs too for better mobile looks, CK*/ ?> - <div class="col-xs-10 col-sm-8 middle"> - <div> - <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>"> - <?=$this->record($this->driver)->getTitleHtml()?> - </a> - </div> + <div class="result-body"> + <div> + <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>"> + <?=$this->record($this->driver)->getTitleHtml()?> + </a> + </div> - <div> - <? if ($this->driver->isCollection()): ?> - <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary()));?> - <? else: ?> - <? $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting(); - if (!empty($summAuthors)): ?> - <?=$this->transEsc('by')?> - <? $authorCount = count($summAuthors); - foreach ($summAuthors as $i => $summAuthor): ?> - <a href="<?=$this->record($this->driver)->getLink('author', $this->highlight($summAuthor, null, true, false))?>"><?=$this->highlight($summAuthor)?></a><?=$i + 1 < $authorCount ? ',' : ''?> - <? endforeach; ?> - <? endif; ?> - <? /* finc-specific from here, #8639, #7345 - CK */ ?> + <div> + <? if ($this->driver->isCollection()): ?> + <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary()));?> + <? else: ?> + <? $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting(); + if (!empty($summAuthors)): ?> + <?=$this->transEsc('by')?> + <? $authorCount = count($summAuthors); + foreach ($summAuthors as $i => $summAuthor): ?> + <a href="<?=$this->record($this->driver)->getLink('author', $this->highlight($summAuthor, null, true, false))?>" + class="author"><?=$this->highlight($summAuthor)?></a><?=$i + 1 < $authorCount ? ',' : ''?> + <? endforeach; ?> + <? endif; ?> + <? /* finc-specific from here, #8639, #7345 - CK */ ?> + <? /* finc-specific: nxt line #8639 - CK */ ?> + <? $journalTitle = $this->driver->getContainerTitle(); + $summDate = $this->driver->getPublishDateSort(); ?> + <? if (!empty($journalTitle)): ?> + <?=!empty($summAuthor) ? '<br />' : ''?> + <?=$this->transEsc('Published in')?> + <? $containerSource = $this->driver->getSourceIdentifier(); ?> + <? $containerID = $this->driver->getContainerRecordID(); ?> + <? /* TODO: handle highlighting more elegantly here: */ ?> + <a + href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle)?></a> <? /* finc-specific: nxt line #8639 - CK */ ?> - <? $journalTitle = $this->driver->getContainerTitle(); - $summDate = $this->driver->getPublishDateSort(); ?> - <? if (!empty($journalTitle)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> - <?=$this->transEsc('Published in')?> - <? $containerSource = $this->driver->getSourceIdentifier(); ?> - <? $containerID = $this->driver->getContainerRecordID(); ?> - <? /* TODO: handle highlighting more elegantly here: */ ?> - <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle)?></a> - <? /* finc-specific: nxt line #8639 - CK */ ?> - <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?> - <? elseif (!empty($summDate)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> - <? /* finc-specific: nxt line #8639 - CK */ ?> - <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?> - <? endif; ?> - <? $summInCollection = $this->driver->getContainingCollections(); - if (!empty($summInCollection)): ?> - <? foreach ($summInCollection as $collId => $collText): ?> - <div> - <strong><?=$this->transEsc("in_collection_label")?></strong> - <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> - <?=$this->escapeHtml($collText)?> - </a> - </div> - <? endforeach; ?> - <? endif; ?> + <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?> + <? elseif (!empty($summDate)): ?> + <?=!empty($summAuthor) ? '<br />' : ''?> + <? /* finc-specific: nxt line #8639 - CK */ ?> + <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?> <? endif; ?> - </div> + <? $summInCollection = $this->driver->getContainingCollections(); + if (!empty($summInCollection)): ?> + <? foreach ($summInCollection as $collId => $collText): ?> + <div> + <strong><?=$this->transEsc("in_collection_label")?></strong> + <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">“</span>...<?=$this->highlight($snippet['snippet'])?>...<span class="quoteend">”</span><br/> - <? 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">“</span>...<?=$this->highlight($snippet['snippet'])?>...<span class="quoteend">”</span><br/> <? endif; ?> <? endif; ?> + <? endif; ?> <? /* Display information on duplicate records if available */ @@ -118,53 +118,53 @@ if ($cover): </div> <? endif; ?> - <div class="callnumAndLocation ajax-availability hidden"> - <? if ($this->driver->supportsAjaxStatus()): ?> - <strong class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</strong> - <span class="callnumber ajax-availability hidden"> + <div class="callnumAndLocation ajax-availability hidden"> + <? if ($this->driver->supportsAjaxStatus()): ?> + <strong class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</strong> + <span class="callnumber ajax-availability hidden"> <?=$this->transEsc('Loading')?> ...<br/> </span> - <strong><?=$this->transEsc('Located')?>:</strong> - <span class="location ajax-availability hidden"> + <strong><?=$this->transEsc('Located')?>:</strong> + <span class="location ajax-availability hidden"> <?=$this->transEsc('Loading')?> ... </span> - <div class="locationDetails"></div> - <? else: ?> - <? $summCallNo = $this->driver->getCallNumber(); - if (!empty($summCallNo)): ?> - <strong><?=$this->transEsc('Call Number')?>:</strong> <?=$this->escapeHtml($summCallNo)?> - <? endif; ?> + <div class="locationDetails"></div> + <? else: ?> + <? $summCallNo = $this->driver->getCallNumber(); + if (!empty($summCallNo)): ?> + <strong><?=$this->transEsc('Call Number')?>:</strong> <?=$this->escapeHtml($summCallNo)?> <? endif; ?> - </div> + <? endif; ?> + </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 = $this->record($this->driver)->getLinkDetails($openUrlActive); + $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): ?> + 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" aria-hidden="true"></i> + <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?> + </a> <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" aria-hidden="true"></i> - <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?> - </a> - <br/> - <? endforeach; ?> - <? endif; ?> + <? endforeach; ?> <? endif; ?> + <? endif; ?> - <? /* Replaced in BS 3.1 upgrade, FIXME CHECK, CK */?> - <?=$this->record($this->driver)->getFormatList() ?> + <div class="result-formats"> + <?=$this->record($this->driver)->getFormatList()?> <? /* nxt line finc-specific: #5737 removed '(!$openUrlActive && empty($urls) &&' - CK */ ?> <? if ($this->driver->supportsAjaxStatus()): ?> @@ -172,17 +172,20 @@ if ($cover): <span class="label label-default"><?=$this->transEsc('Loading')?> ...</span> </span> <? endif; ?> + </div> + + <div class="result-previews"> <?=$this->record($this->driver)->getPreviews()?> </div> - <? /* finc: use col-xs too for better mobile looks, CK*/ ?> - <div class="col-xs-2 col-sm-3 right hidden-print"> - <? /* 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')); - ?> - <span class="hidden-xs"> + </div> + <div class="result-links hidden-print"> + <? /* 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')); + ?> + <span class="hidden-xs"> <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> <div class="qrcode hidden"> <script type="text/template" class="qrCodeImgTag"> @@ -191,40 +194,47 @@ if ($cover): </div> <br/> </span> - <? endif; ?> + <? endif; ?> + + <? if ($this->cart()->isActiveInSearch() && $this->params->getOptions()->supportsCart() && $this->cart()->isActive()): ?> + <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]); ?><br/> + <? endif; ?> <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <? /* Add to favorites */ ?> - <? /* Keep Icon inside link - CK */ ?> - <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" title="<?=$this->transEsc('Add to favorites')?>"> + <? if ($this->permission()->allowDisplay('feature.Favorites')): ?> + <? /* Add to favorites; finc: keep Icon inside link - CK */ ?> + <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" title="<?=$this->transEsc('Add to favorites')?>"> <i class="fa fa-fw fa-star" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?=$this->transEsc('Add to favorites')?></span> </a><br/> + <? elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> + <?=$block?> + <? endif; ?> <? /* Saved lists */ ?> <div class="savedLists alert alert-info hidden"> <strong><?=$this->transEsc("Saved in")?>:</strong> </div> <? endif; ?> - <? /* Hierarchy tree link */ ?> - <? /* Keep Icon inside link - CK */ ?> - <? $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"/> - <a class="hierarchyTreeLinkText" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" data-lightbox-post="tab=hierarchytree"> - <i class="fa fa-fw fa-sitemap" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?=$this->transEsc('hierarchy_view_context')?></span><? if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><? endif; ?> - </a> - </div> - <? endforeach; ?> - <? endif; ?> + <? /* Hierarchy tree link; finc: keep Icon inside link - CK */ ?> + <? $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"/> + <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" + title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" + data-lightbox-post="tab=hierarchytree"> + <i class="result-link-icon fa fa-fw fa-sitemap" aria-hidden="true"></i> <span><?=$this->transEsc('hierarchy_view_context')?></span><? if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><? endif; ?> + </a> + </div> + <? endforeach; ?> + <? endif; ?> - <?=$this->driver->supportsCoinsOpenUrl() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()) . '"></span>' : ''?> - </div> + <?=$this->driver->supportsCoinsOpenUrl() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()) . '"></span>' : ''?> </div> </div> <? if ($thumbnail && $thumbnailAlignment == 'right'): ?> - <?=$thumbnail ?> + <?=$thumbnail?> <? endif ?> </div> - <!-- finc: recordDriver - solrDefault - result-list - END --> +<!-- finc: recordDriver - solrDefault - result-list - END --> diff --git a/themes/finc/templates/RecordDriver/SolrDefault/toolbar.phtml b/themes/finc/templates/RecordDriver/SolrDefault/toolbar.phtml index 3bf7da5f5af2823b6c48488c6688c58e83817704..2b7c8f1383429432f4e52feafe485d62c3f84ce2 100644 --- a/themes/finc/templates/RecordDriver/SolrDefault/toolbar.phtml +++ b/themes/finc/templates/RecordDriver/SolrDefault/toolbar.phtml @@ -1,73 +1,69 @@ <!-- finc: recordDriver - solrDefault - toolbar --> <? -$addThis = $this->addThis(); -if (!empty($addThis)) { - $this->headScript()->appendFile('https://s7.addthis.com/js/250/addthis_widget.js?pub=' . urlencode($addThis)); -} + $addThis = $this->addThis(); + if (!empty($addThis)) { + $this->headScript()->appendFile('https://s7.addthis.com/js/250/addthis_widget.js?pub=' . urlencode($addThis)); + } // Set up some variables for convenience: $cart = $this->cart(); $cartId = $this->driver->getSourceIdentifier() . '|' . $this->driver->getUniqueId(); ?> + <? /* finc: we use nav-stacked to display in sidebar, CK */ ?> -<ul class="nav nav-pills nav-stacked hidden-print"> +<ul class="record-nav nav nav-pills nav-stacked hidden-print"> <? /* finc: we use the sr-only description, CK */ ?> <li class="sr-only"><?=$this->transEsc('Toolbar')?></li> - <? if (count($this->driver->getCitationFormats()) > 0): ?> + <? if (count($this->driver->getCitationFormats()) > 0): ?> <li> <a class="cite-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Cite')?>" rel="nofollow"><i class="fa fa-asterisk" aria-hidden="true"></i> <?=$this->transEsc('Cite this')?></a> </li> - <? endif; ?> + <? endif; ?> <? /* finc: we don't use sms, CK */ ?> <? /* + <? if ($this->accountCapabilities()->getSmsSetting() !== 'disabled'): ?> <li><a class="sms-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'SMS')?>" rel="nofollow"><i class="fa fa-mobile" aria-hidden="true"></i> <?=$this->transEsc('Text this')?></a></li> + <? endif; ?> */ ?> <li> - <a class="mail-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" rel="nofollow"><i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this')?></a> + <a class="mail-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" rel="nofollow"><i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this')?></a> </li> - <? $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?> - <? if (count($exportFormats) > 0): ?> + <? $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?> + <? if (count($exportFormats) > 0): ?> <li class="dropdown"> - <a class="export-toggle dropdown-toggle" data-toggle="dropdown" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>" rel="nofollow"><i class="fa fa-list-alt" aria-hidden="true"></i> <?=$this->transEsc('Export Record') ?></a> + <a class="export-toggle dropdown-toggle" data-toggle="dropdown" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>" rel="nofollow"><i class="fa fa-list-alt" aria-hidden="true"></i> <?=$this->transEsc('Export Record')?> + </a> <ul class="dropdown-menu" role="menu"> - <? foreach ($exportFormats as $exportFormat): ?> - <li> - <a <? if ($this->export()->needsRedirect($exportFormat)): ?>target="<?= $this->escapeHtmlAttr($exportFormat) ?>Main" <? endif; ?>href="<?= $this->recordLink()->getActionUrl($this->driver, 'Export') ?>?style=<?= $this->escapeHtmlAttr($exportFormat) ?>" rel="nofollow"><?= $this->transEsc('Export to') ?><?= $this->transEsc($this->export()->getLabelForFormat($exportFormat)) ?></a> - </li> - <? endforeach; ?> - </ul> + <? foreach ($exportFormats as $exportFormat): ?> + <li> + <a <? if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" + <? endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>" + rel="nofollow"><?=$this->transEsc('Export to')?><?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a> + </li> + <? endforeach; ?> + </ul> </li> - <? endif; ?> + <? endif; ?> - <? if ($this->userlist()->getMode() !== 'disabled'): ?> + <? if ($this->userlist()->getMode() !== 'disabled'): ?> <? /* finc: we use title, CK */ ?> <li> - <a class="save-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" title="<?=$this->transEsc('Add to favorites')?>" rel="nofollow"><i class="fa fa-star" aria-hidden="true"></i> <?=$this->transEsc('Add to favorites')?></a> + <?if ($this->permission()->allowDisplay('feature.Favorites')): ?> + <a class="save-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" title="<?=$this->transEsc('Add to favorites')?>" rel="nofollow"><i class="fa fa-star" aria-hidden="true"></i> <?=$this->transEsc('Add to favorites')?> + </a> + <? elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> + <?=$block?> + <? endif; ?> </li> - <? endif; ?> - <? if (!empty($addThis)): ?> + <? endif; ?> + <? if (!empty($addThis)): ?> <li> - <a class="addThis addthis_button" href="https://www.addthis.com/bookmark.php?v=250&pub=<?=urlencode($addThis)?>"><i class="fa fa-bookmark" aria-hidden="true"></i> <?=$this->transEsc('Bookmark')?></a> - </li> - <? endif; ?> - <? if ($cart->isActive()): ?> - <li class="bookbag-menu"> - <input class="cartId" type="hidden" name="ids[]" value="<?= $this->escapeHtmlAttr($cartId) ?>" /> - <? /* finc: we use title, CK */ ?> - <a class="cart-add hidden <? if (!$cart->contains($cartId)): ?>correct <? endif ?>" href="#" title="<?=$this->transEsc('Add to Book Bag') ?>"><i class="fa fa-plus" aria-hidden="true"></i> <?= $this->transEsc('Add to Book Bag') ?></a> - <a class="cart-remove hidden <? if ($cart->contains($cartId)): ?>correct <? endif ?>" href="#" title="<?=$this->transEsc('Remove from Book Bag') ?>"><i class="fa fa-minus-circle" aria-hidden="true"></i> <?= $this->transEsc('Remove from Book Bag') ?></a> - <noscript> - <form method="post" name="addForm" action="<?=$this->url('cart-processor')?>"> - <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($cartId)?>" /> - <? if ($cart->contains($cartId)): ?> - <input class="btn btn-primary" type="submit" name="delete" value="<?=$this->transEsc('Remove from Book Bag')?>"/> - <? else: ?> - <input class="btn btn-primary" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/> - <? endif; ?> - </form> - </noscript> + <a class="addThis addthis_button" href="https://www.addthis.com/bookmark.php?v=250&pub=<?=urlencode($addThis)?>"><i class="fa fa-bookmark" aria-hidden="true"></i> <?=$this->transEsc('Bookmark')?></a> </li> <? endif; ?> + <li class="bookbag-menu"> + <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]); ?> + </li> </ul> <!-- finc: recordDriver - solrDefault - toolbar - END --> diff --git a/themes/finc/templates/RecordDriver/SolrLido/core.phtml b/themes/finc/templates/RecordDriver/SolrLido/core.phtml index 13272182649f51921f22ff168574d677f8b04d30..849e57b11047938aee10496479cdb95584429095 100644 --- a/themes/finc/templates/RecordDriver/SolrLido/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrLido/core.phtml @@ -1,446 +1,84 @@ -<!-- finc: recordDriver - solrLido - CORE --> -<? /* created in #8713, based on solrDefault, compare with SolrDefault - core during updates! */ ?> -<? -if($loggedin = $this->auth()->isLoggedIn()) { - $user_id = $loggedin->id; - $loggedin = true; -} else { - $user_id = false; -} - - $formatRoles = function ($roles) { - if (count($roles) == 0) { - return ''; +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> + <? + if ($loggedin = $this->auth()->isLoggedIn()) { + $user_id = $loggedin->id; + $loggedin = true; + } else { + $user_id = false; } - $that = $this; - $translate = function ($str) use ($that) { - return $that->transEsc('CreatorRoles::' . $str); - }; - return ' (' . implode(', ', array_unique(array_map($translate, $roles))) . ')'; - }; -?> -<div class="row" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> - <? $QRCode = $this->record($this->driver)->getQRCode("core"); - $cover = $this->record($this->driver)->getCover('core', 'medium', $this->record($this->driver)->getThumbnail('large')); - $preview = $this->record($this->driver)->getPreviews(); ?> + + $QRCode = $this->record($this->driver)->getQRCode("core"); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; + $preview = $this->record($this->driver)->getPreviews(); + ?> <? if ($QRCode || $cover || $preview): ?> - <div class="col-sm-3 img-col"> - <div class="gutter-l"> + <div class="col-sm-3 img-col"> + <div class="gutter-l"> <? /* Display thumbnail if appropriate: */ ?> - <? if($cover): ?> - <?=$cover?> - <? /* BOF - finc-specific StyleBasedIcons */ ?> - <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> - <?=$this->record($this->driver)->getFormatIcon()?> - <? /* EOF - finc-specific StyleBasedIcons */ ?> - <? endif; ?> + <? if($cover): ?> + <?=$cover?> + <? endif; ?> <? /* Display qrcode if appropriate: */ ?> <? if($QRCode): ?> - <span class="hidden-xs"> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> - </span> + <span class="hidden-xs"> + <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + </span> <? endif; ?> - <? /* finc: SolrLido-specific: Image rights - CK */ ?> - <? $rights = $this->driver->getImageRights($this->layout()->userLang); ?> - <div class="access-rights"> - <div class="image-rights"> - <? $hasLink = isset($rights['link']); ?> - <strong><?= $this->translate("Image Rights") ?>: - </strong> <? if (isset($rights['copyright'])) : ?><? if ($hasLink): ?><a target="_blank" href="<?= $rights['link'] ?>"><? endif; ?><?= $this->transEsc($rights['copyright']) ?><? if ($hasLink): ?></a><? endif ?><? endif ?> - </div> - <div class="copyright truncate-field"> - <? if (isset($rights['description'])): ?> - <? foreach ($rights['description'] as $item): ?> - <p><?= $this->transEsc($item) ?></p> - <? endforeach ?> - <? endif ?> - <? if (!isset($rights['copyright']) && !isset($rights['description'])): ?> - <?= $this->translate('Image Rights Default') ?> - <!--<p><a href="< ?= $this->url('content-page', array('page' => 'terms_conditions')) . '#image_rights' ?>"><i class="fa fa-arrow-right"></i>< ?= $this->translate('See also terms and conditions') ?></a>--> - <? endif; ?> - </div> - </div> - <? /* finc: SolrLido-specific: Image rights - END */ ?> </div> - <? // if you have a preview tab but want to move or remove the preview link - // from this area of the record view, this can be split into - // getPreviewData() (should stay here) and - // getPreviewLink() (can go in your desired tab) ?> - <? if ($preview): ?><?=$preview?><? endif; ?> - </div> + <? // if you have a preview tab but want to move or remove the preview link + // from this area of the record view, this can be split into + // getPreviewData() (should stay here) and + // getPreviewLink() (can go in your desired tab) ?> + <? if ($preview): ?> + <?=$preview?> + <? endif; ?> + </div> - <div class="col-sm-9 info-col"> + <div class="col-sm-9 info-col"> <? else: ?> - <div class="col-sm-12"> + <div class="col-sm-12"> <? endif; ?> - <? /* finc, SolrLido-specific, next line; CK */ ?> - <h3 property="name"><?=$this->escapeHtml($this->driver->getTitle())?></h3> + + <? /* For all finc-records; We want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> <? if ($summary): ?> <p><?=$this->truncate($summary, 300)?></p> <? if(strlen($summary) > 300): ?> - <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>'><?=$this->transEsc('Full description')?></a></p> + <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> <? endif; ?> <? endif; ?> <? if ($this->userlist()->getMode() !== 'disabled'): ?> <? /* Display the lists that this record is saved to */ ?> - <div class="savedLists hidden alert alert-info"> + <div class="savedLists"> <strong><?=$this->transEsc("Saved in")?>:</strong> </div> <? endif; ?> <?/* Display Main Details */?> - <table class="table table-striped"> - <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> - <? $journalTitle = $this->driver->getContainerTitle(); if (!empty($journalTitle)): ?> - <tr> - <? /* finc, SolrLido-specific, next line; CK */ ?> - <th><?=$this->transEsc('Journal Title')?>:</th> - <td> - <? - $containerSource = $this->driver->getSourceIdentifier(); - $containerID = $this->driver->getContainerRecordID(); - ?> - <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', $journalTitle))?>"><?=$this->escapeHtml($journalTitle)?></a> - <? $ref = $this->driver->getContainerReference(); if (!empty($ref)) { echo $this->escapeHtml($ref); } ?> - </td> - </tr> - <? endif; ?> - - <? $nextTitles = $this->driver->getNewerTitles(); $prevTitles = $this->driver->getPreviousTitles(); ?> - <? if (!empty($nextTitles)): ?> - <tr> - <th><?=$this->transEsc('New Title')?>: </th> - <td> - <? foreach($nextTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (!empty($prevTitles)): ?> - <tr> - <th><?=$this->transEsc('Previous Title')?>: </th> - <td> - <? foreach($prevTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* Creator / Originator */ ?> - <? /* finc, SolrLido-specific snippet; Compare with BS solrDefault - core CK */ ?> - <? $authors = $this->driver->getDeduplicatedAuthors(); ?> - <? if (isset($authors['main']) && !empty($authors['main'])): ?> - <tr> - <th><?= $this->transEsc(count($authors['main']) > 1 ? 'Originators' : 'Originator') ?>: </th> - <td> - <? $i = 0; foreach ($authors['main'] as $author => $roles): ?><?= ($i++ == 0) ? '' : ', ' ?><span property="author"><a href="<?= $this->record($this->driver)->getLink('author', $author) ?>"><?= $this->escapeHtml($author) ?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?= ($j++ == 0) ? '' : ', ' ?><?= $this->transEsc("CreatorRoles::" . $role) ?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (isset($authors['corporate']) && !empty($authors['corporate'])): ?> - <tr> - <th><?= $this->transEsc(count($authors['corporate']) > 1 ? 'Corporate Originator' : 'Corporate Originators') ?>:</th> - <td> - <? $i = 0; foreach ($authors['corporate'] as $corporate => $roles): ?><?= ($i++ == 0) ? '' : ', ' ?><span property="creator"><a href="<?= $this->record($this->driver)->getLink('author', $corporate) ?>"><?= $this->escapeHtml($corporate) ?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?= ($j++ == 0) ? '' : ', ' ?><?= $this->transEsc("CreatorRoles::" . $role) ?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (isset($authors['secondary']) && !empty($authors['secondary'])): ?> - <tr> - <th><?= $this->transEsc('Other Originators') ?>:</th> - <td> - <? $i = 0; foreach ($authors['secondary'] as $author => $roles): ?><?= ($i++ == 0) ? '' : ', ' ?><span property="contributor"><a href="<?= $this->record($this->driver)->getLink('author', $author) ?>"><?= $this->escapeHtml($author) ?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?= ($j++ == 0) ? '' : ', ' ?><?= $this->transEsc("CreatorRoles::" . $role) ?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* Creator / Originator - END */ ?> - - <? /* finc, SolrLido-specific snippet: getSubjectDetails - CK */ ?> - <? if ($results = $this->driver->getSubjectDetails()): ?> - <tr class="recordSubjects"> - <th><?= $this->transEsc('Subject Detail') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getSubjectPlaces - CK */ ?> - <? if ($results = $this->driver->getSubjectPlaces()): ?> - <tr class="recordSubjects"> - <th><?= $this->transEsc('Subject Place') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getSubjectDates - CK */ ?> - <? if ($results = $this->driver->getSubjectDates()): ?> - <tr class="recordSubjects"> - <th><?= $this->transEsc('Subject Date') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getSubjectActors - CK */ ?> - <? if ($results = $this->driver->getSubjectActors()): ?> - <tr class="recordSubjects"> - <th><?= $this->transEsc('Subject Actor') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getInstitutions - CK */ ?> - <? if ($results = $this->driver->getInstitutions()): ?> - <tr class="recordInstitution"> - <th><?= $this->transEsc('Institution') ?>:</th> - <td> - <? foreach ($results as $index => $institution): ?> - <?= ($index > 0 ? '<br/>' : '') ?><?= $this->transEsc("source_$institution", array(), $this->translate($institution)) ?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getIdentifier - CK */ ?> - <? if ($results = $this->driver->getIdentifier()): ?> - <tr class="recordIdentifier"> - <th><?= $this->transEsc('Inventory ID') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getMeasurements - CK */ ?> - <? if ($results = $this->driver->getMeasurements()): ?> - <tr class="recordMeasurements"> - <th><?= $this->transEsc('Measurements') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getMeasurementsDescription - CK */ ?> - <? if ($results = $this->driver->getMeasurementsDescription()): ?> - <tr class="recordMeasurementsDescription"> - <th><?= $this->transEsc('Measurements') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* finc, SolrLido-specific snippet: getCollections - CK */ ?> - <? if ($results = $this->driver->getCollections()): ?> - <tr class="recordCollection"> - <th><?= $this->transEsc('Collection') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? /* Format Finc; compare with solrDefault - core */ ?> - <? if (count($this->driver->getFormats()) > 0): ?> - <tr> - <th><?= $this->transEsc('Object type') ?>:</th> - <td><?= $this->record($this->driver)->getFormatList() ?></td> - </tr> - <? endif; ?> - - <? /* Format Lido */ ?> - <? if ($results = $this->driver->getFormatClassifications()): ?> - <tr class="recordClassifications"> - <th><?= $this->transEsc('Other Classification') ?>:</th> - <td> - <div class="truncate-field"><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></div> - </td> - </tr> - <? endif; ?> - - <? if ($results = $this->driver->getLocalIdentifiers()): ?> - <tr class="recordIdentifiers"> - <th><?= $this->transEsc('Other ID') ?>:</th> - <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> - </tr> - <? endif; ?> - - <? $publicationIsSet = false; ?> - <? $mainFormat = $this->driver->getMainFormat(); ?> <? foreach ($this->driver->getEvents() as $eventType => $events): ?> - <tr class="recordEvents"> - <!--<th>< ?=$this->transEsc("lido_event_type_{$mainFormat}_$eventType")?>:</th>--> - <th> - <? if ($eventType == 'production'): ?> - <?= $this->transEsc('expression creation') ?>: - <? elseif ($eventType == 'publication'): ?> - <?= $this->transEsc('Time of origin') ?>: - <? $publicationIsSet = true; ?> - <? else: ?> - <?= $this->transEsc($eventType) ?>: - <? endif; ?> - </th> - <td> - <div class="truncate-field"> - <? foreach ($events as $event): ?> - <? if ($event != $events[0]): ?><br/><? endif; ?> - <? if (!empty($event['name'])): ?><?= $this->escapeHtml($event['name']) ?><br/><? endif; ?> - <? if (!empty($event['date'])): ?><?= $this->escapeHtml($event['date']) ?><br/><? elseif ($event['type'] != 'käyttö' && $event['type'] != 'näyttely'): ?> <?= $this->transEsc('undated') ?><? endif; ?> - <? if (!empty($event['method'])): ?><?= $this->escapeHtml($event['method']) ?><br/><? endif; ?> - <? if (!empty($event['materials'])): ?><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $event['materials'])) ?><br/><? endif; ?> - <? if (!empty($event['places'])): ?><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $event['places'])) ?><br/><? endif; ?> - <? if (!empty($event['culture'])): ?><?= $this->escapeHtml($event['culture']) ?><br/><? endif; ?> - <? if (!empty($event['actors'])): ?> - <? foreach ($event['actors'] as $actor): ?> - <?= $this->escapeHtml($actor['name']) ?><? if (!empty($actor['role'])): ?>, <?= $this->escapeHtml($actor['role']) ?><? endif; ?> - <? endforeach; ?> - <br/> - <? endif; ?> - <? if (!empty($event['description'])): ?><?= $this->escapeHtml($event['description']) ?><br/><? endif; ?> - <? endforeach; ?> - </div> - </td> - </tr> - <? endforeach; ?> - <? /* Format Lico - END */ ?> - - <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?> - <tr> - <th><?= $this->transEsc('Language') ?>:</th> - <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang) ?><br/><? endforeach; ?></td> - </tr> - <? endif; ?> - - <? /* finc, solrLido-specific: getDateSpan, */ ?> - <? $dateSpan = $this->driver->getDateSpan(); if (!empty($dateSpan) && !$publicationIsSet): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?= $this->transEsc('Time of origin') ?>:</th> - <td> - <?= $this->record($this->driver)->mapDateListToRangeView($dateSpan); ?> - </td> - </tr> - <? endif; ?> - - <? /* getEdition: compare with solrDefault - core; CK */ ?> - <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> - <tr> - <th><?=$this->transEsc('Edition')?>: </th> - <td property="bookEdition"><?=$this->escapeHtml($edition)?></td> - </tr> - <? endif; ?> - - <?/* Display series section if at least one series exists. */?> - <?/* compare with solrAi - core, as series section doesn't exist in solrDefault - core; CK */?> - <? $series = $this->driver->getSeries(); if (!empty($series)): ?> - <tr> - <th><?=$this->transEsc('Series')?>: </th> - <td> - <? foreach ($series as $field): ?> - <?/* Depending on the record driver, $field may either be an array with - "name" and "number" keys or a flat string containing only the series - name. We should account for both cases to maximize compatibility. */?> - <? if (is_array($field)): ?> - <? if (!empty($field['name'])): ?> - <a href="<?=$this->record($this->driver)->getLink('series', $field['name'])?>"><?=$this->escapeHtml($field['name'])?></a> - <? if (!empty($field['number'])): ?> - <?=$this->escapeHtml($field['number'])?> - <? endif; ?> - <br/> - <? endif; ?> + <? + $formatter = $this->recordDataFormatter(); + $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-lido')); + ?> + <? if (!empty($coreFields)): ?> + <table class="table table-striped"> + <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <? foreach ($coreFields as $key => $current): ?> + <? if ($key == null): ?> + <?=$current['value']?> <? else: ?> - <a href="<?=$this->record($this->driver)->getLink('series', $field)?>"><?=$this->escapeHtml($field)?></a><br/> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> <? endif; ?> <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* getSeries - End */ ?> - - <? $subjects = $this->driver->getAllSubjectHeadings(); if (!empty($subjects)): ?> - <tr> - <th><?=$this->transEsc('Subjects')?>: </th> - <td> - <? foreach ($subjects as $field): ?> - <div class="subject-line" property="keywords"> - <? $subject = ''; ?> - <? if(count($field) == 1) $field = explode('--', $field[0]); ?> - <? $i = 0; foreach ($field as $subfield): ?> - <?=($i++ == 0) ? '' : ' > '?> - <? $subject = trim($subject . ' ' . $subfield); ?> - <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a> - <? endforeach; ?> - </div> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $childRecordCount = $this->driver->tryMethod('getChildRecordCount'); if ($childRecordCount): ?> - <tr> - <th><?=$this->transEsc('child_records')?>: </th> - <td> - <a href="<?=$this->recordLink()->getChildRecordSearchUrl($this->driver)?>"><?=$this->transEsc('child_record_count', array('%%count%%' => $childRecordCount))?></a> - </td> - </tr> - <? endif; ?> - - <? - $openUrl = $this->openUrl($this->driver, 'record'); - $openUrlActive = $openUrl->isActive(); - // Account for replace_other_urls setting - $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); - ?> - <? if (!empty($urls) || $openUrlActive): ?> - <tr> - <th><?=$this->transEsc('Online Access')?>: </th> - <td> - <? foreach ($urls as $current): ?> - <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> - <? endforeach; ?> - <? if ($openUrlActive): ?> - <?=$openUrl->renderTemplate()?><br/> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? $recordLinks = $this->driver->getAllRecordLinks(); ?> - <? if(!empty($recordLinks)): ?> - <tr> - <th><?=$this->transEsc('Related Items')?>:</th> - <td> - <? foreach ($recordLinks as $recordLink): ?> - <?=$this->transEsc($recordLink['title'])?>: - <a href="<?=$this->recordLink()->related($recordLink['link'])?>"><?=$this->escapeHtml($recordLink['value'])?></a><br /> - <? endforeach; ?> - <? /* if we have record links, display relevant explanatory notes */ - $related = $this->driver->getRelationshipNotes(); - if (!empty($related)): ?> - <? foreach ($related as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? if ($this->usertags()->getMode() !== 'disabled'): ?> - <? $tagList = $this->driver->getTags(null, null, 'count', $user_id); ?> - <tr> - <th><?=$this->transEsc('Tags')?>: </th> - <td> - <a class="tag-record btn btn-link pull-right flip hidden-print" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox> - <i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Add Tag')?> - </a> - <?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?> - </td> - </tr> - <? endif; ?> - </table> + </table> + <? endif; ?> <?/* End Main Details */?> </div> -</div> -<!-- finc: recordDriver - solrLido - CORE - END --> +</div> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrLido/data-accessNote.phtml b/themes/finc/templates/RecordDriver/SolrLido/data-accessNote.phtml new file mode 100644 index 0000000000000000000000000000000000000000..6f7af7a7dfb7b58fc88cd5c4360a492616bea31a --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrLido/data-accessNote.phtml @@ -0,0 +1,4 @@ +<? foreach ($data as $field): ?> + <? if (!empty($field['uri'])): ?><a href="<?= $this->escapeHtmlAttr($field['uri']) ?>"><?= $this->escapeHtml($field['term']) ?><? endif; ?><? if (!empty($field['uri'])): ?></a><? endif; ?> + <br/> +<? endforeach; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrLido/data-authors.phtml b/themes/finc/templates/RecordDriver/SolrLido/data-authors.phtml new file mode 100644 index 0000000000000000000000000000000000000000..40edc71cce875eb34a2079f648dada99cee2e32d --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrLido/data-authors.phtml @@ -0,0 +1,45 @@ +<? +$formatProperty = function ($datafield, $name, $label) { + if (count($datafield) == 0) { + return ''; + } + $that = $this; + $translate = function ($str) use ($that, $label) { + return $that->transEsc($label . $str); + }; + return '<span class="author-property-' . $name . '">(' . implode(', ', array_unique(array_map($translate, $datafield))) . ')</span>'; +}; +$formattedAuthors = []; +?> +<? if (!empty($data[$type])): ?> + <? foreach ($data[$type] as $author => $roles): ?> + <? ob_start(); ?> + <span class="author-data" property="<?=$this->escapeHtml($schemaLabel)?>"> + <a href="<?=$this->record($this->driver)->getLink('author', $author)?>"> + <?=$this->escapeHtml($author)?> + </a> + <? + // Display additional data using the appropriate translation prefix + // (for example, to render author roles correctly): + if (!empty($requiredDataFields)) { + foreach ($requiredDataFields as $field) { + $name = $field['name']; + $prefix = isset($field['prefix']) ? $field['prefix'] : ''; + // deprecated due to more flexible solution at core + // to-do: revision of indexing and finc specific treatment + // of roles in RecordDriver + if (count($roles) > 0 && $name == 'roles') { + echo $formatProperty($roles, $name, $prefix); + } + } + } + ?> + </span> + <? + // Strip whitespace before close tags to avoid spaces in front of commas: + $formattedAuthors[] = trim(preg_replace('/\s+<\//', '</', ob_get_contents())); + ob_end_clean(); + ?> + <? endforeach; ?> +<? endif; ?> +<?=implode(', ', $formattedAuthors)?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrLido/data-dateSpan.phtml b/themes/finc/templates/RecordDriver/SolrLido/data-dateSpan.phtml new file mode 100644 index 0000000000000000000000000000000000000000..59a1191eb973159ce53acf6468a904e5f4d63b5e --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrLido/data-dateSpan.phtml @@ -0,0 +1 @@ +<?= $this->record($this->driver)->mapDateListToRangeView($data); ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrLido/data-events.phtml b/themes/finc/templates/RecordDriver/SolrLido/data-events.phtml new file mode 100644 index 0000000000000000000000000000000000000000..c11f1fcafbf98b5c83efd22a4d4dd4a2e13219d1 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrLido/data-events.phtml @@ -0,0 +1,42 @@ +<? $publicationIsSet = false; ?> +<? if (count($event = $this->driver->getEvents()) > 0): ?> + <? foreach ($event as $eventType => $events): ?> + <tr class="recordEvents"> + <th> + <? if ($eventType == 'production'): ?> + <?= $this->transEsc('expression creation') ?>: + <? elseif ($eventType == 'publication'): ?> + <?= $this->transEsc('Time of origin') ?>: + <? $publicationIsSet = true; ?> + <? else: ?> + <?= $this->transEsc($eventType) ?>: + <? endif; ?> + </th> + <td> + <div class="truncate-field"> + <? foreach ($events as $event): ?> + <? if ($event != $events[0]): ?><br/><? endif; ?> + <? if (!empty($event['name'])): ?><?= $this->escapeHtml($event['name']) ?><br/><? endif; ?> + <? if (!empty($event['actors'])): ?> + <? foreach ($event['actors'] as $actor): ?> + <?= $this->escapeHtml($actor['name']) ?><? if (!empty($actor['role'])): ?> (<?= $this->escapeHtml($actor['role']) ?>)<? endif; ?> + <? endforeach; ?> + <br/> + <? endif; ?> + <? if (!empty($event['date'])): ?> + <?= $this->escapeHtml($event['date']) ?><br/> + <? else: ?> + <?= $this->transEsc('undated') ?><br/> + <? endif; ?> + <? if (!empty($event['method'])): ?><?= $this->escapeHtml($event['method']) ?><br/><? endif; ?> + <? if (!empty($event['materials'])): ?><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $event['materials'])) ?><br/><? endif; ?> + <? if (!empty($event['places'])): ?><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $event['places'])) ?><br/><? endif; ?> + <? if (!empty($event['culture'])): ?><?= $this->escapeHtml($event['culture']) ?><br/><? endif; ?> + + <? if (!empty($event['description'])): ?><?= $this->escapeHtml($event['description']) ?><br/><? endif; ?> + <? endforeach; ?> + </div> + </td> + </tr> + <? endforeach; ?> +<? endif; ?> diff --git a/themes/finc/templates/RecordDriver/SolrLido/data-institutions.phtml b/themes/finc/templates/RecordDriver/SolrLido/data-institutions.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f2c1b0cd57c3816ba0ec83d94f45e73d4e3693b0 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrLido/data-institutions.phtml @@ -0,0 +1,3 @@ +<? foreach ($data as $index => $institution): ?> + <?= ($index > 0 ? '<br/>' : '') ?><?= $this->transEsc("source_$institution", array(), $this->translate($institution)) ?> +<? endforeach; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml index 122b0aa3670926aad8a984e73a8ac9ff44dddf75..f163eb1e15cc3afa959efce2d7b5ed248013cf1c 100644 --- a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml @@ -1,38 +1,21 @@ -<!-- finc: recordDriver - solrMarc - CORE --> -<? /* created in #7159, based on solrDefault, compare with SolrDefault - core during updates! */ ?> -<? -if($loggedin = $this->auth()->isLoggedIn()) { - $user_id = $loggedin->id; - $loggedin = true; -} else { - $user_id = false; -} - - $formatRoles = function ($roles) { - if (count($roles) == 0) { - return ''; - } - $that = $this; - $translate = function ($str) use ($that) { - return $that->transEsc('CreatorRoles::' . $str); - }; - return ' (' . implode(', ', array_unique(array_map($translate, $roles))) . ')'; - }; -?> +<!-- finc: RecordDriver - solrMarc - core --> <div class="row" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> - <? $QRCode = $this->record($this->driver)->getQRCode("core"); - $cover = $this->record($this->driver)->getCover('core', 'medium', $this->record($this->driver)->getThumbnail('large')); - $preview = $this->record($this->driver)->getPreviews(); ?> + <? + $QRCode = $this->record($this->driver)->getQRCode("core"); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; + $preview = $this->record($this->driver)->getPreviews(); + ?> <? if ($QRCode || $cover || $preview): ?> <div class="col-sm-3 img-col"> <div class="gutter-l"> - <? /* Display thumbnail if appropriate: */ ?> + <? /* Display thumbnail if appropriate: */ ?> <? if($cover): ?> <?=$cover?> - <? /* BOF - finc-specific StyleBasedIcons */ ?> + <? /* BOF - finc-specific StyleBasedIcons */ ?> <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> <?=$this->record($this->driver)->getFormatIcon()?> - <? /* EOF - finc-specific StyleBasedIcons */ ?> + <? /* EOF - finc-specific StyleBasedIcons */ ?> <? endif; ?> <? /* Display qrcode if appropriate: */ ?> @@ -47,381 +30,54 @@ if($loggedin = $this->auth()->isLoggedIn()) { // from this area of the record view, this can be split into // getPreviewData() (should stay here) and // getPreviewLink() (can go in your desired tab) ?> - <? if ($preview): ?><?=$preview?><? endif; ?> - </div> - - <div class="col-sm-9 info-col"> - <? else: ?> - <div class="col-sm-12"> - <? endif; ?> - - <? /* For all finc-records; We want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> - <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> - - <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> - <? if ($summary): ?> - <p><?=$this->truncate($summary, 300)?></p> - - <? if(strlen($summary) > 300): ?> - <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>'><?=$this->transEsc('Full description')?></a></p> - <? endif; ?> - <? endif; ?> - - <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <? /* Display the lists that this record is saved to */ ?> - <div class="savedLists hidden alert alert-info"> - <strong><?=$this->transEsc("Saved in")?>:</strong> + <? if ($preview): ?> + <div class="record-previews"> + <?=$preview?> </div> <? endif; ?> + </div> - <?/* Display Main Details */?> - <table class="table table-striped"> - <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> - <? $journalTitle = $this->driver->getContainerTitle(); if (!empty($journalTitle)): ?> - <tr> - <th><?=$this->transEsc('Published in')?>:</th> - <td> - <? - $containerSource = $this->driver->getSourceIdentifier(); - $containerID = $this->driver->getContainerRecordID(); - ?> - <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', $journalTitle))?>"><?=$this->escapeHtml($journalTitle)?></a> - <? $ref = $this->driver->getContainerReference(); if (!empty($ref)) { echo $this->escapeHtml($ref); } ?> - </td> - </tr> - <? endif; ?> - - <? $nextTitles = $this->driver->getNewerTitles(); $prevTitles = $this->driver->getPreviousTitles(); ?> - <? if (!empty($nextTitles)): ?> - <tr> - <th><?=$this->transEsc('New Title')?>: </th> - <td> - <? foreach($nextTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? if (!empty($prevTitles)): ?> - <tr> - <th><?=$this->transEsc('Previous Title')?>: </th> - <td> - <? foreach($prevTitles as $field): ?> - <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc specific rows - Start; same in recordDriver - solrDefault - collection-info, and other core.phtml files */ ?> - <? /* finc spec. authors dedupe, CK */ ?> - <? $authors = $this->driver->getDeduplicatedAuthors(); if ((isset($authors['main']) && count($authors['main'])) || (isset($authors['secondary']) && count($authors['secondary'])) || (isset($authors['corporate']) && count($authors['corporate'])) || (isset($authors['corporate_secondary']) && count($authors['corporate_secondary']))): ?> - <? /* finc spec. authors dedupe - END */ ?> - <tr> - <th> - <? /* BS version with '1. Verfasser ..., 2. Verfasser ... etc.' -- there is a larger block from 2016, dubbed 'Improved author indexing', see git hostroy of bootstrap/RecordDriver/SolrDefault/collection-info.phtml */ - /* <?=$this->transEsc(count($authors['main']) > 1 ? 'Main Authors' : 'Main Author')?>: - */ ?> - <? /* finc version: 'Personen und Koerperschaften' */ ?> - <?=$this->transEsc('Authors/Corporations')?>: - </th> - <td> - <? if (isset($authors['main']) && count($authors['main'])): ?> - <? $i = 0; foreach ($authors['main'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="author"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['main_orig'][$author])?" / ".array_pop($authors['main_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['secondary']) && count($authors['secondary'])): ?> - <?=count($authors['main'])?'; ':''?> - <? $i = 0; foreach ($authors['secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['secondary_orig'][$author])?" / ".array_pop($authors['secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate']) && count($authors['corporate'])): ?> - <?=count($authors['main'])||count($authors['secondary'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="creator"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_orig'][$author])?" / ".array_pop($authors['corporate_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate_secondary']) && count($authors['corporate_secondary'])): ?> - <?=count($authors['main'])||count($authors['secondary'])||count($authors['corporate'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate_secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_secondary_orig'][$author])?" / ".array_pop($authors['corporate_secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - </td> - </tr> - <? endif; ?> - <? /* finc version: 'Personen und Koerperschaften' - END */ ?> - - <? /* finc: NO corporate authors here but title details, CK */ ?> - <? $titleDetails = $this->driver->getTitleDetails(); if (!empty($titleDetails)): ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"> - <? $i = 0; foreach ($titleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? else: ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection()) . ($this->driver->getTitleStatement() ? ' / ' . $this->driver->getTitleStatement() : '')?><br /><?=($this->driver->tryMethod('getTitleOrig') && $this->driver->getTitleOrig() != '' ? $this->escapeHtml($this->driver->getTitleOrig()) : '')?></td> - </tr> - <? endif; ?> - <? /* finc: NO corporate authors here but title details - END */ ?> - <? /* finc only SolrMarc core specific changes - Start */ ?> - <? $workPartTitleDetails = $this->driver->tryMethod('getWorkPartTitleDetails'); if (!empty($workPartTitleDetails)): ?> - <tr> - <th><?=$this->transEsc('Work Part Title')?>: </th> - <td property="work part title"> - <? $i = 0; foreach ($workPartTitleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $workTitleDetails = $this->driver->tryMethod('getWorkTitleDetails'); if (!empty($workTitleDetails)): ?> - <tr> - <th><?=$this->transEsc('Work Title')?>: </th> - <td property="work title"> - <? $i = 0; foreach ($workTitleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc only SolrMarc core specific changes - End */ ?> - <? /* finc: NO authors secondary here, but getTitleUniform, CK */ ?> - <? $titleUniform = $this->driver->getTitleUniform(); ?> - <? if (!empty($titleUniform)): ?> - <tr> - <th><?=$this->driver->isRDA()?$this->transEsc('rda_original_title'):$this->transEsc('non_rda_original_title')?>: </th> - <td><a href="<?=$this->record($this->driver)->getLink('title', $titleUniform)?>"><?=$this->escapeHtml($titleUniform)?></a></td> - </tr> - <? endif; ?> - <? /* finc: NO authors secondary here, but getTitleUniform - END */ ?> - <? /* finc: NO getFormats here, but getEdition, CK */ ?> - <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> - <tr> - <th><?=$this->transEsc('Edition')?>: </th> - <td property="bookEdition"><?=$this->escapeHtml($edition)?><? $editionOrig = $this->driver->getEditionOrig(); if (!empty($editionOrig)): ?><br /><?=$this->escapeHtml($editionOrig)?><? endif; ?></td> - </tr> - <? endif; ?> - <? /* finc: NO getFormats here, but getEdition - END */ ?> - <? /* finc: getDissertationNote, CK */ ?> - <? $dissertationNote = $this->driver->getDissertationNote(); if (!empty($dissertationNote)): ?> - <? $first = true; $dissertation = ''; foreach ($dissertationNote as $val): $dissertation .= (false === $first) ? ', ' . $val : $val ; $first = false; endforeach; ?> - <tr> - <th><?=$this->transEsc('Dissertation Note')?>: </th> - <td><?=$this->transEsc($dissertation)?></td> - </tr> - <? endif; ?> - <? /* finc: getDissertationNote, CK */ ?> - <? /* finc specific snippets - END */ ?> - - <? /* solrMarc-specific: Compare getFormats section with BS solrDefault - core; this section is not in finc solrDefault! - CK */ ?> - <? if (count($this->driver->getFormats()) > 0): ?> - <tr> - <th><?=$this->transEsc('Format')?>: </th> - <td><?=$this->record($this->driver)->getFormatList()?></td> - </tr> - <? endif; ?> - - <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?> - <tr> - <th><?=$this->transEsc('Language')?>: </th> - <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang)?><br/><? endforeach; ?></td> - </tr> - <? endif; ?> - - <? /* finc: #8639; also use publishDateSort, below; CK */ ?> - <? - $publications = $this->driver->getPublicationDetails(); - $pubDateSort = $this->driver->getPublishDateSort(); - if (!empty($publications)): ?> - <tr> - <th><?=$this->transEsc('Published')?>: </th> - <? /* finc: microdate/schema org improvements - CK */?> - <td itemscope itemtype="http://schema.org/publisher"> - <? foreach ($publications as $field): ?> - <span property="publisher"> - <? $pubPlace = $field->getPlace(); if (!empty($pubPlace)): ?> - <span itemprop="location"><?=$this->escapeHtml($pubPlace)?></span> - <? endif; ?> - <? $pubName = $field->getName(); if (!empty($pubName)): ?> - <span itemprop="name"><?=$this->escapeHtml($pubName)?></span> - <? endif; ?> - </span> - <? /* finc solrMarc: #8639; use publishDateSort instead of pubDate, next two lines; CK */ ?> - <? $pubDate = $field->getDate(); if (!empty($pubDateSort)): ?> - <span property="datePublished"><?=$this->escapeHtml($pubDateSort)?></span> - <? elseif (!empty($pubDate)): ?> - <span property="datePublished"><?=$this->escapeHtml($pubDate)?></span> - <? endif; ?> - <br/> - <? endforeach; ?> - </td> - <? /* microdate/schema org improvements - END */?> - </tr> - <? endif; ?> - - <? /* SolrMarc + finc-specific - #9557 - CK */ ?> - <? $germanPrintsIndexNumber = $this->driver->getIndexOfGermanPrints(); if (!empty($germanPrintsIndexNumber)): ?> - <tr> - <th><?=$this->transEsc('German Prints Index Number')?>: </th> - <td property="germanPrintsIndexNumber"><?=$this->escapeHtml($germanPrintsIndexNumber[0])?></td> - </tr> + <div class="col-sm-9 info-col"> + <? else: ?> + <div class="col-sm-12"> <? endif; ?> - <? /* SolrMarc + finc-specific - END */ ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> - <? /* finc specific snippet 'getHierarchyParentTitle' - replaces getSeries, CK */ ?> - <? $hierarchyParentTitle = $this->driver->getHierarchyParentTitle(); if (!empty($hierarchyParentTitle) && empty($series)): ?> - <tr> - <th><?=$this->transEsc('Set Multipart')?>: </th> - <td> - <? $hierarchyParentId = $this->driver->getHierarchyParentID(); ?> - <? foreach ($hierarchyParentTitle as $key=>$hTitle): ?> - <? if(isset($hierarchyParentId[$key])): ?><a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key])?>"><? endif; ?><?=$this->escapeHtml($hTitle)?><? if(isset($hierarchyParentId[$key])): ?></a><? endif; ?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc specific snippet *getHierarchyParentTitle' - replaces getSeries - End */ ?> + <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> + <? if ($summary): ?> + <p><?=$this->truncate($summary, 300)?></p> - <? $subjects = $this->driver->getAllSubjectHeadings(); if (!empty($subjects)): ?> - <tr> - <th><?=$this->transEsc('Subjects')?>: </th> - <td> - <? foreach ($subjects as $field): ?> - <div class="subject-line" property="keywords"> - <? $subject = ''; ?> - <? if(count($field) == 1) $field = explode('--', $field[0]); ?> - <? $i = 0; foreach ($field as $subfield): ?> - <?=($i++ == 0) ? '' : ' > '?> - <? $subject = trim($subject . ' ' . $subfield); ?> - <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a> - <? endforeach; ?> - </div> - <? endforeach; ?> - </td> - </tr> + <? if(strlen($summary) > 300): ?> + <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> + <? endif; ?> <? endif; ?> - <? $childRecordCount = $this->driver->tryMethod('getChildRecordCount'); if ($childRecordCount): ?> - <tr> - <th><?=$this->transEsc('child_records')?>: </th> - <td> - <a href="<?=$this->recordLink()->getChildRecordSearchUrl($this->driver)?>"><?=$this->transEsc('child_record_count', array('%%count%%' => $childRecordCount))?></a> - </td> - </tr> + <? if ($this->userlist()->getMode() !== 'disabled'): ?> + <? /* Display the lists that this record is saved to */ ?> + <div class="savedLists"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> <? endif; ?> + <?/* Display Main Details */?> <? - $openUrl = $this->openUrl($this->driver, 'record'); - $openUrlActive = $openUrl->isActive(); - // Account for replace_other_urls setting - $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); + $formatter = $this->recordDataFormatter(); + $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-marc')); ?> - <? if (!empty($urls) || $openUrlActive): ?> - <tr> - <th><?=$this->transEsc('Online Access')?>: </th> - <td> - <? foreach ($urls as $current): ?> - <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> - <? endforeach; ?> - <? if ($openUrlActive): ?> - <?=$openUrl->renderTemplate()?><br/> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? $recordLinks = $this->driver->getAllRecordLinks(); ?> - <? if(!empty($recordLinks)): ?> - <tr> - <th><?=$this->transEsc('Related Items')?>:</th> - <td> - <? foreach ($recordLinks as $recordLink): ?> - <?=$this->transEsc($recordLink['title'])?>: - <a href="<?=$this->recordLink()->related($recordLink['link'])?>"><?=$this->escapeHtml($recordLink['value'])?></a><br /> - <? endforeach; ?> - <? /* if we have record links, display relevant explanatory notes */ - $related = $this->driver->getRelationshipNotes(); - if (!empty($related)): ?> - <? foreach ($related as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> + <? if (!empty($coreFields)): ?> + <table class="table table-striped"> + <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <? foreach ($coreFields as $key => $current): ?> + <? if ($key == null): ?> + <?=$current['value']?> + <? else: ?> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc: NO getAdditionals here, #7745 - removes additionals tab + adds additionals info to core template; NOT in BS, CK */ ?> - - <? if ($this->usertags()->getMode() !== 'disabled'): ?> - <? $tagList = $this->driver->getTags(null, null, 'count', $user_id); ?> - <tr> - <th><?=$this->transEsc('Tags')?>: </th> - <td> - <a class="tag-record btn btn-link pull-right flip hidden-print" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox> - <i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Add Tag')?> - </a> - <?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?> - </td> - </tr> - <? endif; ?> - - <? /* finc specific snippets, getLocalSubject, getMegaCollection, getOtherRelationshipEntry,getAdditionalNotes - NOT in BS - CK */ ?> - <? $subjects = $this->driver->getLocalSubject(); if (!empty($subjects)): ?> - <tr> - <th><?=$this->transEsc('Subjects')?>: </th> - <td> - <? $i = 0; foreach ($subjects as $field): ?> - <?=($i++ == 0) ? '' : ', '?> - <a title="<?=$this->escapeHtmlAttr($field)?>" href="<?=$this->record($this->driver)->getLink('subject', $field)?>" rel="nofollow"><?=trim($this->escapeHtml($field))?></a> <? endforeach; ?> - </td> - </tr> + </table> <? endif; ?> - - <? $megaCollection = (array) $this->driver->tryMethod('getMegaCollection'); if (!empty($megaCollection)): ?> - <tr> - <th><?=$this->transEsc('Source')?>: </th> - <td> - <? foreach ($megaCollection as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $otherRelationshipEntry = (array) $this->driver->tryMethod('getOtherRelationshipEntry'); if (!empty($otherRelationshipEntry)): ?> - <? foreach ($otherRelationshipEntry as $key => $values): ?> - <tr> - <th><?=$this->transEsc($key)?>: </th> - <td> - <? foreach ($values as $value): ?> - <? if (!empty($value['link']) && $recordLink = $this->RecordLink()->getRecordLink($value['link'], 'record_id')): ?> - <a href="<?=$recordLink?>"><?=$this->escapeHtml($value['text'])?></a><br/> - <? else: ?> - <?=$this->escapeHtml($value['text'])?><br/> - <? endif; ?> - <? endforeach; ?> - </td> - </tr> - <? endforeach; ?> - <? endif; ?> - - <? $additionalNotes = (array) $this->driver->tryMethod('getAdditionalNotes'); if (!empty($additionalNotes)): ?> - <tr> - <th><?=$this->transEsc('Notes')?>: </th> - <td> - <? foreach ($additionalNotes as $note): ?> - <?=$this->escapeHtml($note)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc specific snippets - getHierarchyParentTitle, getMegaCollection, getOtherRelationshipEntry, getAdditionalNotes - End */ ?> - </table> - <?/* End Main Details */?> + <?/* End Main Details */?> + </div> </div> -</div> -<!-- finc: recordDriver - solrMarc - CORE - END --> +<!-- finc: RecordDriver - solrMarc - core - END --> diff --git a/themes/finc/templates/RecordDriver/SolrMarc/data-indexOfGermanPrints.phtml b/themes/finc/templates/RecordDriver/SolrMarc/data-indexOfGermanPrints.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b12529e11094ccbd4db551e7bc4320341bde3dee --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrMarc/data-indexOfGermanPrints.phtml @@ -0,0 +1,8 @@ +<!-- finc: RecordDriver - solrMarc data-indexOfGermanPrints --> +<? /* Originally introduced in #9557 - CK */ ?> +<? if (!empty($data)): ?> + <span property="germanPrintsIndexNumber"> + <?=$this->escapeHtml($data[0])?> + </span> +<? endif; ?> +<!-- finc: RecordDriver - solrMarc data-indexOfGermanPrints - END --> diff --git a/themes/finc/templates/RecordDriver/SolrMarc/data-localSubjects.phtml b/themes/finc/templates/RecordDriver/SolrMarc/data-localSubjects.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9844fee84e8f9bbdca9a354254547eb40fa0283c --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrMarc/data-localSubjects.phtml @@ -0,0 +1,10 @@ +<!-- finc: RecordDriver - solrMarc - data-localSubjects --> +<? if (!(empty($data))): ?> +<? $i = 0; foreach ($data as $subject): ?> + <?= ($i++ == 0) ? '' : ', '; ?> + <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"> + <?=trim($this->escapeHtml($subject))?> + </a> +<? endforeach; ?> +<? endif; ?> +<!-- finc: RecordDriver - solrMarc - data-localSubjects - END --> diff --git a/themes/finc/templates/RecordTab/acquisitionpda.phtml b/themes/finc/templates/RecordTab/acquisitionpda.phtml index f87fd51ccf7b5823a4a03f7f3c7e21c33afa876b..19138a3d9cf1bfc83776796a1063076f127d62cd 100644 --- a/themes/finc/templates/RecordTab/acquisitionpda.phtml +++ b/themes/finc/templates/RecordTab/acquisitionpda.phtml @@ -7,11 +7,9 @@ $this->headTitle( ); // Get some variables $id = $this->driver->getUniqueId(); - //$controllerClass = 'controller:' . $this->record($this->driver)->getController(); + // $controllerClass = 'controller:' . $this->record($this->driver)->getController(); $controllerClass = 'controller:SolrMarcFincPDA'; ?> - <div class="row"> - <div class="col-xs-12"> <h2><?= $this->transEsc('PDA::Acquisition') ?></h2> <p><?= $this->transEsc('PDA::pda_initial_text') ?></p> <p class="alert alert-danger"><?= $this->transEsc('PDA::pda_restriction_text') ?></p> @@ -23,8 +21,5 @@ $this->headTitle( <a class="btn btn-primary pda-button <?= $controllerClass ?>" data-lightbox href="<?= $this->url('record-pda', array('id' => $id)) ?>" rel="nofollow"> <?= $this->transEsc('PDA::pda_tab_order_button') ?> </a> - </div> - </div> - </div> <!-- finc - recordtab - acquistionpda - END --> diff --git a/themes/finc/templates/RecordTab/description.phtml b/themes/finc/templates/RecordTab/description.phtml index e8be71e33fbd731a4ca0283f79b3c2677b8ccac5..3e35a167776ddcd3940766cea9eea378a76f11c2 100644 --- a/themes/finc/templates/RecordTab/description.phtml +++ b/themes/finc/templates/RecordTab/description.phtml @@ -1,289 +1,20 @@ -<!-- finc: recordtab - description.phtml --> +<!-- finc: recordtab - description --> <? - // Set page title. - $this->headTitle($this->translate('Description') . ': ' . $this->driver->getBreadcrumb()); +// Set page title. +$this->headTitle($this->translate('Description') . ': ' . $this->driver->getBreadcrumb()); - // Grab clean ISBN for convenience: - $isbn = $this->driver->getCleanISBN(); +$formatter = $this->recordDataFormatter(); +$mainFields = $formatter->getData($driver, $formatter->getDefaults('description')); ?> -<? /* summary is deprecated - we use caption - CK */ ?> <table class="table table-striped"> - <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> + <? /* finc: table summary not supported in html 5, finc-specific solution, CK */ ?> <caption class="sr-only"><?=$this->transEsc('Description')?></caption> - <? $summ = $this->driver->getSummary(); if (!empty($summ)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Summary')?>: </th> - <td> - <? foreach ($summ as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $dateSpan = $this->driver->getDateSpan(); if (!empty($dateSpan)): ?> - <? $contentDisplayed = true; ?> - <? /* finc: we use Dates of publication - CK */ ?> - <tr> - <th><?=$this->transEsc('Dates of publication')?>: </th> - <td> - <? foreach ($dateSpan as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $notes = $this->driver->getGeneralNotes(); if (!empty($notes)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Item Description')?>: </th> - <td> - <? foreach ($notes as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $physical = $this->driver->getPhysicalDescriptions(); if (!empty($physical)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Physical Description')?>: </th> - <td> - <? foreach ($physical as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $freq = $this->driver->getPublicationFrequency(); if (!empty($freq)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Publication Frequency')?>: </th> - <td> - <? foreach ($freq as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $playTime = $this->driver->getPlayingTimes(); if (!empty($playTime)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Playing Time')?>: </th> - <td> - <? foreach ($playTime as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $system = $this->driver->getSystemDetails(); if (!empty($system)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Format')?>: </th> - <td> - <? foreach ($system as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $audience = $this->driver->getTargetAudienceNotes(); if (!empty($audience)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Audience')?>: </th> - <td> - <? foreach ($audience as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $awards = $this->driver->getAwards(); if (!empty($awards)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Awards')?>: </th> - <td> - <? foreach ($awards as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $credits = $this->driver->getProductionCredits(); if (!empty($credits)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Production Credits')?>: </th> - <td> - <? foreach ($credits as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $bib = $this->driver->getBibliographyNotes(); if (!empty($bib)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Bibliography')?>: </th> - <td> - <? foreach ($bib as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $isbns = $this->driver->getISBNs(); if (!empty($isbns)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('ISBN')?>: </th> - <td> - <? foreach ($isbns as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $issns = $this->driver->getISSNs(); if (!empty($issns)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('ISSN')?>: </th> - <td> - <? foreach ($issns as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $doi = $this->driver->tryMethod('getCleanDOI'); if (!empty($doi)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('DOI')?>: </th> - <td><?=$this->escapeHtml($doi)?></td> - </tr> - <? endif; ?> - - <? /* Finc-specific eissns - CK */ ?> - <? $eissns = $this->driver->getEISSNs(); if (!empty($eissns)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('EISSN')?>: </th> - <td> - <? foreach ($eissns as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* Finc-specific eissns - END */ ?> - <? $related = $this->driver->getRelationshipNotes(); if (!empty($related)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Related Items')?>: </th> - <td> - <? foreach ($related as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $access = $this->driver->getAccessRestrictions(); if (!empty($access)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Access')?>: </th> - <td> - <? foreach ($access as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $findingAids = $this->driver->getFindingAids(); if (!empty($findingAids)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Finding Aid')?>: </th> - <td> - <? foreach ($findingAids as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $publicationPlaces = $this->driver->getHierarchicalPlaceNames(); if (!empty($publicationPlaces)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Publication_Place')?>: </th> - <td> - <? foreach ($publicationPlaces as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $authorNotes = empty($isbn) ? array() : $this->authorNotes($isbn); if (!empty($authorNotes)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Author Notes')?>: </th> - <td> - <? foreach ($authorNotes as $provider => $list): ?> - <? foreach ($list as $field): ?> - <?=$field['Content']?><br/> - <? endforeach; ?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? /* finc-specific - callnumbers, additionals - CK */ ?> - <? /* getLocalSignature works only for Marc-Records, so try this method */ ?> - <? $callnumbers = $this->driver->tryMethod('getLocalSignature'); if (!empty($callnumbers)): ?> - <? $contentDisplayed = true; ?> - <tr> - <th><?=$this->transEsc('Call Number')?>: </th> - <td> - <? foreach ($callnumbers as $field): ?> - <? foreach ($field as $subfield): ?> - <?=trim($this->escapeHtml($subfield))?> - <? endforeach; ?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $additionals = $this->driver->getAdditionals(); if (!empty($additionals) && is_array($additionals)): ?> - <? foreach($additionals as $additional) :?> - <? if (isset($additional['identifier'])): ?> - <tr> - <th><?=$this->escapeHtml($additional['identifier'])?>: </th> - <td> - <? if(isset($additional['id'])): ?><a href="<?=$this->recordLink()->getUrl($additional['id'])?>"><? endif; ?> - <?=$this->escapeHtml($additional['text'])?> - <? if(isset($additional['id'])): ?></a><? endif; ?> - </td> - </tr> - <? endif; ?> + <? if (!empty($mainFields)): ?> + <? foreach ($mainFields as $key => $current): ?> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> <? endforeach; ?> - <? endif; ?> - <? /* finc-specific - callnumbers, additionals - END */ ?> - - <? if (!isset($contentDisplayed) || !$contentDisplayed): // Avoid errors if there were no rows above ?> + <? else: ?> <tr><td><?=$this->transEsc('no_description')?></td></tr> <? endif; ?> </table> -<!-- finc: recordtab - description.phtml - END --> +<!-- finc: recordtab - description - END --> diff --git a/themes/finc/templates/RecordTab/descriptionlido.phtml b/themes/finc/templates/RecordTab/descriptionlido.phtml index a27a67ddc7f693ea2174aedf4557be9ac61bc77e..118ef5b803522844e05453fbd09a0b7a4b42cd9d 100644 --- a/themes/finc/templates/RecordTab/descriptionlido.phtml +++ b/themes/finc/templates/RecordTab/descriptionlido.phtml @@ -3,31 +3,18 @@ // Set page title. $this->headTitle($this->translate('Description') . ': ' . $this->driver->getBreadcrumb()); -// Grab clean ISBN for convenience: -$isbn = $this->driver->getCleanISBN(); +$formatter = $this->recordDataFormatter(); +$mainFields = $formatter->getData($driver, $formatter->getDefaults('description-lido')); ?> -<table class="table table-striped"> +<table class="table table-striped" summary="<?=$this->transEsc('Description')?>"> <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> <caption class="sr-only"><?= $this->transEsc('Description') ?></caption> - <? $dateSpan = $this->driver->getDateSpan(); if (!empty($dateSpan)): ?> - <tr> - <th><?= $this->transEsc('Time of origin') ?>:</th> - <td> - <?= $this->record($this->driver)->mapDateListToRangeView($dateSpan); ?> - </td> - </tr> - <? endif; ?> - - <? $notes = $this->driver->getAccessNote(); if (!empty($notes)): ?> - <tr> - <th><?= $this->transEsc('Access') ?>:</th> - <td> - <? foreach ($notes as $field): ?> - <? if (!empty($field['uri'])): ?><a href="<?= $this->escapeHtmlAttr($field['uri']) ?>"><?= $this->escapeHtml($field['term']) ?><? endif; ?><? if (!empty($field['uri'])): ?></a><? endif; ?> - <br/> - <? endforeach; ?> - </td> - </tr> + <? if (!empty($mainFields)): ?> + <? foreach ($mainFields as $key => $current): ?> + <tr><th><?=$this->transEsc($key)?>:</th><td><?=$current['value']?></td></tr> + <? endforeach; ?> + <? else: ?> + <tr><td><?=$this->transEsc('no_description')?></td></tr> <? endif; ?> </table> -<!-- finc: recordtab - descriptionlido - END --> +<!-- finc: recordtab - descriptionlido - END --> \ No newline at end of file diff --git a/themes/finc/templates/RecordTab/hierarchytree.phtml b/themes/finc/templates/RecordTab/hierarchytree.phtml index 4a9da084eeada94e7dcc132b0d584acaeb85eedd..29e71d067ecc562cad2dbe08254691dcf7012be4 100644 --- a/themes/finc/templates/RecordTab/hierarchytree.phtml +++ b/themes/finc/templates/RecordTab/hierarchytree.phtml @@ -14,7 +14,7 @@ 'SET' ); $this->jsTranslations()->addStrings( - array('showTree' => 'hierarchy_show_tree', 'hideTree' => 'hierarchy_hide_tree') + ['showTree' => 'hierarchy_show_tree', 'hideTree' => 'hierarchy_hide_tree'] ); $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'vendor/jsTree/jstree.min.js'); $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'hierarchyTree.js'); @@ -44,9 +44,9 @@ <i id="treeSearchLoadingImg" class="fa fa-spinner fa-spin hidden" aria-hidden="true"></i> </div> <div id="treeSearchNoResults" class="alert alert-danger hidden"><?=$this->translate('nohit_heading')?></div> - <div id="treeSearchLimitReached" class="alert alert-danger hidden"><?=$this->translate('tree_search_limit_reached_html', array('%%url%%' => $this->url('search-results'), '%%limit%%' => $this->tab->getSearchLimit()))?></div> + <div id="treeSearchLimitReached" class="alert alert-danger hidden"><?=$this->translate('tree_search_limit_reached_html', ['%%url%%' => $this->url('search-results'), '%%limit%%' => $this->tab->getSearchLimit()])?></div> <? endif; ?> - <div id="hierarchyLoading" class="hidden"><i class="fa fa-spinner fa-spin" aria-hidden="true"></i> <?=$this->transEsc("Loading")?>...</div> + <div id="hierarchyLoading" class="hide"><i class="fa fa-spinner fa-spin" aria-hidden="true"></i> <?=$this->transEsc("Loading")?>...</div> <div id="hierarchyTree" class="hierarchy-tree"> <input type="hidden" value="<?=$this->escapeHtml($this->driver->getUniqueId())?>" class="hiddenRecordId" /> <input type="hidden" value="<?=$this->escapeHtml($activeTree)?>" class="hiddenHierarchyId" /> diff --git a/themes/finc/templates/RecordTab/holdingsils.phtml b/themes/finc/templates/RecordTab/holdingsils.phtml index cf3de883f55268619850a9911f0139b904522247..25a1f989cdf50c82b2e7fe282ae660e4b8ceaaa9 100644 --- a/themes/finc/templates/RecordTab/holdingsils.phtml +++ b/themes/finc/templates/RecordTab/holdingsils.phtml @@ -1,45 +1,53 @@ -<!-- finc: recordTab - HOLDINGSILS --> +<!-- finc: recordTab - holdingsils --> <? - // Set up convenience variables: - $account = $this->auth()->getManager(); - $user = $account->isLoggedIn(); - $openUrl = $this->openUrl($this->driver, 'holdings'); - $openUrlActive = $openUrl->isActive(); - // Account for replace_other_urls setting - $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); -$extUrls = $this->externalCatalogueLink($this->driver)->getLinks(); + // Set up convenience variables: + $account = $this->auth()->getManager(); + $user = $account->isLoggedIn(); + $openUrl = $this->openUrl($this->driver, 'holdings'); + $openUrlActive = $openUrl->isActive(); + // Account for replace_other_urls setting + $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); + // finc-specific: externalCatalogueLink + $extUrls = $this->externalCatalogueLink($this->driver)->getLinks(); -$offlineMode = $this->ils()->getOfflineMode(); -// finc-specific: $holdings here, #9844, #7187 - CK -$holdings = []; -// finc-specific snippet, #9844, #7187 - CK -// if we already know that the ils is offline we do not need to query the realtimeholdings -if (!$offlineMode) { - try { - $holdings = $this->driver->getRealTimeHoldings(); - } catch (\VuFind\Exception\ILS $e) { - $offlineMode = 'ils-offline'; + $offlineMode = $this->ils()->getOfflineMode(); + // finc-specific: $holdings here, #9844, #7187 - CK + $holdings = []; + // finc-specific snippet, #9844, #7187 - CK + // if we already know that the ils is offline we do not need to query the realtimeholdings + if (!$offlineMode) { + try { + $holdings = $this->driver->getRealTimeHoldings(); + } catch (\VuFind\Exception\ILS $e) { + $holdings = ['holdings' => []]; + $offlineMode = 'ils-offline'; + } } -} -// Set page title. -$this->headTitle($this->translate('Holdings') . ': ' . $this->driver->getBreadcrumb()); + // Set page title. + $this->headTitle($this->translate('Holdings') . ': ' . $this->driver->getBreadcrumb()); ?> <? /* finc-specific: nxt line - #7841@56988450 - CK */ ?> <? $holdingsEmpty = true; ?> -<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', array('user' => $this->auth()->isLoggedIn()));?> +<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $this->auth()->isLoggedIn()]); ?> + +<? if (!empty($holdings['blocks'])):?> + <div id="account-block-msg" class="alert alert-danger"> + <?=$this->transEsc('account_block_options_missing', ['%%details%%' => implode('; ', $holdings['blocks'])]) ?> + </div> +<? endif; ?> <?=($offlineMode == "ils-offline") ? $this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_holdings_message']) : ''?> -<? if (($this->ils()->getHoldsMode() == 'driver' && !empty($holdings)) || $this->ils()->getTitleHoldsMode() == 'driver'): ?> +<? if (($this->ils()->getHoldsMode() == 'driver' && !empty($holdings['holdings'])) || $this->ils()->getTitleHoldsMode() == 'driver'): ?> <? if ($account->loginEnabled() && $offlineMode != 'ils-offline'): ?> <? if (!$user): ?> <div class="alert alert-info"> - <a href="<?=$this->recordLink()->getTabUrl($this->driver, 'Holdings')?>?login=true&catalogLogin=true" data-lightbox><?=$this->transEsc("Login")?></a> <?=$this->transEsc("hold_login")?> + <a href="<?=$this->recordLink()->getTabUrl($this->driver, 'Holdings')?>?login=true&catalogLogin=true" data-lightbox><?=$this->transEsc("hold_login")?></a> </div> <? elseif (!$user->cat_username): ?> <div class="alert alert-info"> - <?=$this->translate("hold_profile_html", array('%%url%%' => $this->recordLink()->getTabUrl($this->driver, 'Holdings') . '?catalogLogin=true'))?> + <?=$this->translate("hold_profile_html", ['%%url%%' => $this->recordLink()->getTabUrl($this->driver, 'Holdings') . '?catalogLogin=true'])?> </div> <? endif; ?> <? endif; ?> @@ -56,7 +64,7 @@ if (!empty($holdingTitleHold)): ?> <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> <? endforeach; ?> <? endif; ?> - <? /* finc-specific snippet - #9274 - replace if ($openUrlActive): - CK */ ?> + <? /* finc-specific snippet - #9274 - replaces if ($openUrlActive): - CK */ ?> <? if ($openUrlActive): ?> <? if (empty($urls)): ?> <? $fallbackUrls = $this->driver->tryMethod('getURLs'); @@ -77,7 +85,7 @@ if (!empty($holdingTitleHold)): ?> <? $holdingsEmpty = false; ?> <? /* this next line produces an empty h3 heading in some cases - should be solved more elegantly - Fixme - CK*/ ?> <h3> - <? $locationText = $this->transEsc('location_' . $holding['location'], array(), $holding['location']); ?> + <? $locationText = $this->transEsc('location_' . $holding['location'], [], $holding['location']); ?> <? if (isset($holding['locationhref']) && $holding['locationhref']): ?> <a href="<?=$holding['locationhref']?>" target="_blank"><?=$locationText?></a> <? else: ?> @@ -85,12 +93,12 @@ if (!empty($holdingTitleHold)): ?> <? endif; ?> </h3> - <? /* this next section produces an empty table in some cases - the table borders collapse, producing a thick line - should be solved more elegantly - Fixme - CK*/ ?> + <? /* finc: this next section produces an empty table in some cases - the table borders collapse, producing a thick line - should be solved more elegantly - Fixme - CK*/ ?> <? /* nxt line = finc-specific - branch info - CK */ ?> <?=$this->branchInfo($this->driver)->getBranchInfo($holding['locationid']);?> <table class="table table-striped"> <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> - <caption class="sr-only"><?=$this->transEsc('Holdings details from')?> <?=$this->transEsc($holding['location'])?></caption> + <caption class="sr-only"><?=$this->transEsc('holdings_details_from', ['%%location%%' => $this->transEsc($holding['location'])]) ?></caption> <? $callNos = $this->tab->getUniqueCallNumbers($holding['items']); if (!empty($callNos)): ?> <tr> @@ -120,10 +128,7 @@ if (!empty($holdingTitleHold)): ?> $check = isset($row['check']) && $row['check']; $checkStorageRetrievalRequest = isset($row['checkStorageRetrievalRequest']) && $row['checkStorageRetrievalRequest']; $checkILLRequest = isset($row['checkILLRequest']) && $row['checkILLRequest']; - // AJAX block record? - $block = !$check && isset($row['addLink']) && $row['addLink'] === 'block'; - $blockStorageRetrievalRequest = !$checkStorageRetrievalRequest && isset($row['addStorageRetrievalRequestLink']) && $row['addStorageRetrievalRequestLink'] === 'block'; - $blockILLRequest = !$checkILLRequest && isset($row['addILLRequestLink']) && $row['addILLRequestLink'] === 'block'; + // finc: nxt line - emailholds #6096 - CK $checkEmailHold = (isset($row['checkEmailHold']) && $row['checkEmailHold']); ?> @@ -142,47 +147,33 @@ if (!empty($holdingTitleHold)): ?> <? /* Begin Available Items (Holds) */ ?> <span class="text-success"><?=$this->transEsc("Available")?> <link property="availability" href="http://schema.org/InStock"/></span> - <? if (!$block && isset($row['link']) && $row['link']): ?> - <? /* finc: hidden-print + title, CK */ ?> - <a class="<?=$check ? 'checkRequest ' : ''?>placehold hidden-print" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['link'])?>" - title="<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?>"> - <i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?> - </a> - <? endif; ?> - <? if (!$blockStorageRetrievalRequest && isset($row['storageRetrievalRequestLink']) && $row['storageRetrievalRequestLink']): ?> - <a class="<?=$checkStorageRetrievalRequest ? 'checkStorageRetrievalRequest ' : ''?> placeStorageRetrievalRequest" data-lightbox 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" - aria-hidden="true"></i> <?=$this->transEsc($checkStorageRetrievalRequest ? "storage_retrieval_request_check_text" : "storage_retrieval_request_place_text")?> - </a> + <? if (isset($row['link']) && $row['link']): ?> + <? /* finc: add class .hidden-print + add title, CK */ ?> + <a class="<?=$check ? 'checkRequest ' : ''?>placehold hidden-print" <? if (!empty($row['linkLightbox'])): ?>data-lightbox <? endif; ?>href="<?=$this->recordLink()->getRequestUrl($row['link'])?>" title="<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?></a> <? endif; ?> - <? if (!$blockILLRequest && isset($row['ILLRequestLink']) && $row['ILLRequestLink']): ?> - <a class="<?=$checkILLRequest ? 'checkILLRequest ' : ''?>placeILLRequest" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['ILLRequestLink'])?>" - title="<?=$this->transEsc($checkILLRequest ? "ill_request_check_text" : "ill_request_place_text")?>"> - <i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($checkILLRequest ? "ill_request_check_text" : "ill_request_place_text")?> - </a> + <? if (isset($row['storageRetrievalRequestLink']) && $row['storageRetrievalRequestLink']): ?> + <a class="<?=$checkStorageRetrievalRequest ? 'checkStorageRetrievalRequest ' : ''?> placeStorageRetrievalRequest" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['storageRetrievalRequestLink'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($checkStorageRetrievalRequest ? "storage_retrieval_request_check_text" : "storage_retrieval_request_place_text")?></a> <? endif; ?> - <? /* finc-specific snippet - #6096 - CK */ ?> + <? /* finc-specific additional insert - #6096 - CK */ ?> <? if (isset($row['emailHoldLink']) && $row['emailHoldLink']): ?> - <a class="<?=$checkEmailHold ? 'checkEmailHold ' : ''?>modal-link placeEmailHold " data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['emailHoldLink'])?>" title="<?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?>"><i - class="fa fa-flag"></i> <?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?></a> + <a class="<?=$checkEmailHold ? 'checkEmailHold ' : ''?>placeEmailHold " data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['emailHoldLink'])?>" title="<?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?>"><i class="fa fa-flag"></i> <?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?></a> <? endif; ?> - <? /* finc-specific change - #6096 - END */ ?> + <? /* finc-specific insert - #6096 - END */ ?> <? else: ?> <? /* Begin Unavailable Items (Recalls) */ ?> - <? /* finc: use empty row status and trans unavailable, CK */ ?> + <? /* finc: use empty row status and transEsc 'Unavailable', CK */ ?> <span class="text-danger"><?=empty($row['status']) ? $this->transEsc("Unavailable") : $this->transEsc($row['status'])?> <link property="availability" href="http://schema.org/OutOfStock"/></span> - <? if (isset($row['returnDate']) && $row['returnDate']): ?>– <span class="small"><?=$this->escapeHtml($row['returnDate'])?></span><? endif; ?> + <? if (isset($row['returnDate']) && $row['returnDate']): ?>– <span><?=$this->escapeHtml($row['returnDate'])?></span><? endif; ?> <? if (isset($row['duedate']) && $row['duedate']): ?> - – <span class="small"><?=$this->transEsc("Due")?>: <?=$this->escapeHtml($row['duedate'])?></span> + <? /* finc: keep nbsp + ndash or due date text will bump into alert, CK */ ?> + – <span><?=$this->transEsc("Due")?>: <?=$this->escapeHtml($row['duedate'])?></span> <? endif; ?> <? if (isset($row['requests_placed']) && $row['requests_placed'] > 0): ?> <span><?=$this->transEsc("Requests")?>: <?=$this->escapeHtml($row['requests_placed'])?></span> <? endif; ?> - <? if (!$block && isset($row['link']) && $row['link']): ?> - <a class="<?=$check ? 'checkRequest' : ''?> placehold hidden-print" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['link'])?>"> - <i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Recall" : "Recall This")?> - </a> + <? if (isset($row['link']) && $row['link']): ?> + <a class="<?=$check ? 'checkRequest' : ''?> placehold" <? if (!empty($row['linkLightbox'])): ?>data-lightbox <? endif; ?>href="<?=$this->recordLink()->getRequestUrl($row['link'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Recall" : "Recall This")?></a> <? endif; ?> <? endif; ?> <? /* finc: use && empty row item notes - CK */ ?> @@ -255,4 +246,4 @@ if (!empty($holdingTitleHold)): ?> <? endforeach; ?> </table> <? endif; ?> -<!-- finc: recordTab - HOLDINGSILS - END --> +<!-- finc: recordTab - holdingsils - END --> diff --git a/themes/finc/templates/ajax/resolverLinks.phtml b/themes/finc/templates/ajax/resolverLinks.phtml index 2f18cf732af8d49aa645fe83af582e3efe61d77b..8c82f05cd26c4763d70d97d954902c4462cffff8 100644 --- a/themes/finc/templates/ajax/resolverLinks.phtml +++ b/themes/finc/templates/ajax/resolverLinks.phtml @@ -6,7 +6,9 @@ <? $noResolverContent = false; ?> <? /* finc-specific change #8447 - END */ ?> <div class="openurls"> - <? /*<strong><?=$this->transEsc('Electronic')?></strong>*/ ?> + <? /* + <strong><?=$this->transEsc('Electronic')?></strong> + */ ?> <ul> <? foreach ($this->electronic as $link): ?> <li> @@ -30,10 +32,9 @@ </ul> </div> <? endif; ?> - - <? /* finc-specific change - commented out in #7643 - CK */ ?> + <? /* finc-specific change - commented out in #7643 - hide info on print issues - CK */ ?> <? /* - <? if (!empty($this->print)): ?> + <? if (!empty($this->print)): ?> <? $noResolverContent = false; ?> <div class="openurls"> <strong><?=$this->transEsc('Holdings')?></strong> @@ -51,7 +52,7 @@ </div> <? endif; ?> <div class="openurls"> - <strong><a href="<?=$this->escapeHtmlAttr($this->openUrlBase)?>?<?=$this->escapeHtmlAttr($this->openUrl)?>"><?=$this->transEsc('More options')?></a></strong> + <? if (!empty($this->moreOptionsLink)): ?><strong><a href="<?=$this->escapeHtmlAttr($this->moreOptionsLink)?>"><?=$this->transEsc('More options')?></a></strong><?endif; ?> <? if (!empty($this->services)): ?> <ul> <? foreach ($this->services as $link): ?> @@ -69,7 +70,7 @@ <? /* finc-specific change #9274 - CK */ ?> <? if ($noResolverContent): // no content to show, so tell the user ?> - <span id="noResolverContentMessage" style="display: none"><?=$this->resolver . ': ' . $this->translate('no_resolver_links')?></span> + <span id="noResolverContentMessage" class="hidden"><?=$this->resolver . ': ' . $this->translate('no_resolver_links')?></span> <script>if ($('#urlsHideable').length) { $('#urlsHideable').show(); } else { $('#noResolverContentMessage').show(); }</script> <? endif; ?> <? /* finc-specific change #9274 - END */ ?> diff --git a/themes/finc/templates/cart/cart.phtml b/themes/finc/templates/cart/cart.phtml index e39216b46c69519c8a592f5b6b28778a942775c5..89d8847254b36cd25890b495d75edb0a672e196e 100644 --- a/themes/finc/templates/cart/cart.phtml +++ b/themes/finc/templates/cart/cart.phtml @@ -8,11 +8,12 @@ ?> <h2><?=$this->transEsc('Book Bag') ?></h2> <?=$this->flashmessages()?> -<form class="form-inline" action="<?=$this->url('cart-processor')?>" method="post" name="cartForm" data-lightbox-onsubmit="cartFormHandler"> +<? /* finc: use .cart class to style content below */ ?> +<form class="form-inline cart" action="<?=$this->url('cart-processor')?>" method="post" name="cartForm" data-lightbox-onsubmit="cartFormHandler"> <input type="hidden" id="dropdown_value"/> <? if (!$this->cart()->isEmpty()): ?> <div class="cart-controls clearfix"> - <div class="checkbox pull-left flip"> + <div class="checkbox pull-left flip w-100"> <label> <input type="checkbox" name="selectAll" class="checkbox-select-all"/> <?=$this->transEsc('select_page')?> diff --git a/themes/finc/templates/cart/contents.phtml b/themes/finc/templates/cart/contents.phtml index 6830358b126387690e9626e397a2921bc96c1ce0..8087e8d57773599838e1a758c6492408933aefc2 100644 --- a/themes/finc/templates/cart/contents.phtml +++ b/themes/finc/templates/cart/contents.phtml @@ -1,10 +1,10 @@ -<? $records = $this->cart()->getRecordDetails(); if (!empty($records)): ?> +<? $records = $this->cart()->getRecordDetails(); +if (!empty($records)): ?> <hr/> <ul class="list-unstyled"> - <? foreach ($records as $i => $record): ?> - <li> - <div class="checkbox"> - <label> + <? foreach ($records as $i => $record): ?> + <li> + <div class="checkbox"> <?=$this->record($record)->getCheckbox('cart')?> <a title="<?=$this->transEsc('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore> <? @@ -13,15 +13,15 @@ $recordtype = $record->getRecordType(); ?> <? if ($recordtype == 'ai'): ?> - <?=$helper->getCitation('APAAI')?> + <?=$helper->getCitation('APAAI')?> <? else: ?> - <?=$helper->getCitation('APA')?> + <?=$helper->getCitation('APA')?> <? endif; ?> </a> - </label> - </div> - </li> - <? endforeach; ?> + + </div> + </li> + <? endforeach; ?> </ul> <? else: ?> <p class="alert alert-info"><?=$this->transEsc('bookbag_is_empty')?>.</p> diff --git a/themes/finc/templates/collection/view.phtml b/themes/finc/templates/collection/view.phtml index d1b2dce4227a3ecb41d3aaf05b0a39359b102582..1cc948abcd590993346a6389498c4a1f49a64142 100644 --- a/themes/finc/templates/collection/view.phtml +++ b/themes/finc/templates/collection/view.phtml @@ -45,7 +45,10 @@ $this->layout()->breadcrumbs .= '<li><a href="' . $this->url('collections-home') <? endif; ?> <? /* finc-specific: li + hidden-xs, and li right below CK */ ?> <li class="hidden-xs"> - #<?=$this->localizedNumber($this->scrollData['currentPosition']) . ' ' . $this->transEsc('of') . ' ' . $this->localizedNumber($this->scrollData['resultTotal']) . ' ' . $this->transEsc('results')?> + <?=$this->transEsc('of_num_results', [ + '%%position%%' => $this->localizedNumber($this->scrollData['currentPosition']), + '%%total%%' => $this->localizedNumber($this->scrollData['resultTotal']) + ]) ?> </li> <? if ($this->scrollData['nextRecord']): ?> <li class="right"> @@ -67,8 +70,8 @@ $this->layout()->breadcrumbs .= '<li><a href="' . $this->url('collections-home') <? /* DON'T pull the toolbar in here but below, finc-specific, CK */ ?> -<div class="record row"> - <div class="<?=$tree ? 'col-sm-12' : $this->layoutClass('mainbody')?>"> +<div class="record"> + <div<? if (!$tree): /* in tree mode, do not constrain width with a class */ ?> class="<?=$this->layoutClass('mainbody') ?>"<? endif; ?>> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId" id="record_id"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/> <?=$this->flashmessages()?> @@ -82,7 +85,7 @@ $this->layout()->breadcrumbs .= '<li><a href="' . $this->url('collections-home') <? foreach ($this->tabs as $tab => $obj): ?> <? // add current tab to breadcrumbs if applicable: $desc = $obj->getDescription(); - $tab_classes = array(); + $tab_classes = []; if (0 === strcasecmp($this->activeTab, $tab)) { if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) { $tab_classes[] = 'active'; @@ -117,7 +120,7 @@ $this->layout()->breadcrumbs .= '<li><a href="' . $this->url('collections-home') <?=$this->driver->supportsCoinsOpenURL() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>' : ''?> </div> - <? if (isset($activeTabObj) && is_callable(array($activeTabObj, 'getSideRecommendations'))): ?> + <? if (isset($activeTabObj) && is_callable([$activeTabObj, 'getSideRecommendations'])): ?> <div class="<?=$this->layoutClass('sidebar')?>"> <? /* Get the toolbar here, finc-specific, CK */ ?> diff --git a/themes/finc/templates/documentdeliveryservice/form.phtml b/themes/finc/templates/documentdeliveryservice/form.phtml index f6efd887dc2a6f3c441db128ef371ea14f7c4ed7..31c6f8bde322db8e7b3345926b88106fc09bf3eb 100644 --- a/themes/finc/templates/documentdeliveryservice/form.phtml +++ b/themes/finc/templates/documentdeliveryservice/form.phtml @@ -1,9 +1,9 @@ -<!-- finc - documentdeliveryservice -- form --> +<!-- finc - documentdeliveryservice - form --> <div class="row"> <div class="<?=$this->layoutClass('mainbody')?>"> <h2><?=$this->transEsc('DDS::dds_form_headline')?></h2> <?=$this->flashmessages()?> - <form method="post" action="<?=$this->url('dds-email')?>" name="docdelisForm" class="form-horizontal"> + <form method="post" action="<?=$this->url('dds-email')?>" name="docdelisForm"> <? if ($this->department): ?> <input type="hidden" name="subito[hdepartment]" value="<?=$this->department?>"/> <? endif; ?> @@ -11,7 +11,7 @@ <legend><?=$this->transEsc("DDS::dds_form_delivery_data")?>:</legend> <!-- name --> <div class="form-group"> - <label for="sname" class="control-label col-sm-3"><?=$this->transEsc("Name")?>:*</label> + <label for="sname" class="control-label"><?=$this->transEsc("Name")?>:*</label> <? if (isset($this->error->username)): ?> <div class="error-field"> <?=$this->error->username;?> @@ -23,7 +23,7 @@ </div> <!-- phone --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="sphone"><?=$this->transEsc("DDS::form_field_phone")?>:</label> + <label class="inline control-label" for="sphone"><?=$this->transEsc("DDS::form_field_phone")?>:</label> <? if (isset($this->error->phone)): ?> <div class="error-field"> <?=$this->error->phone;?> @@ -33,7 +33,7 @@ </div> <!-- email --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="semail"><?=$this->transEsc("DDS::form_field_email")?>:*</label> + <label class="inline control-label" for="semail"><?=$this->transEsc("DDS::form_field_email")?>:*</label> <? if (isset($this->error->email)): ?> <div class="error-field"> <?=$this->error->email;?> @@ -43,7 +43,7 @@ </div> <!-- user id --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="suserid"><?=$this->transEsc("DDS::form_field_library_id")?>:*</label> + <label class="inline control-label" for="suserid"><?=$this->transEsc("DDS::form_field_library_id")?>:*</label> <? if (isset($this->error->userid)): ?> <div class="error-field"> <?=$this->error->userid;?> @@ -53,7 +53,7 @@ </div> <!-- division --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="sdivision"><?=$this->transEsc("DDS::form_field_division")?>:*</label> + <label class="inline control-label" for="sdivision"><?=$this->transEsc("DDS::form_field_division")?>:*</label> <? if (isset($this->error->division)): ?> <div class="error-field"> <?=$this->error->division;?> @@ -68,7 +68,7 @@ </div> <!-- department --> <div class="form-group input-sdepartment"> - <label class="inline control-label col-sm-3" for="sdepartment"><?=$this->transEsc("DDS::form_field_department")?>:*</label> + <label class="inline control-label" for="sdepartment"><?=$this->transEsc("DDS::form_field_department")?>:*</label> <? if (isset($this->error->department)): ?> <div class="error-field"> <?=$this->error->department;?> @@ -80,7 +80,7 @@ </div> <!-- department medicine --> <div class="form-group input-department"> - <label class="inline control-label col-sm-3" for="smdepartment"><?=$this->transEsc("DDS::form_field_department")?>:*</label> + <label class="inline control-label" for="smdepartment"><?=$this->transEsc("DDS::form_field_department")?>:*</label> <input type="text" id="smdepartment" name="subito[inputdepartment]" class="form-control" <?=(!empty($this->inputdepartment) ? 'value="' . $this->inputdepartment . '"' : '')?>/> </div> </fieldset> @@ -89,7 +89,7 @@ <legend><?=$this->transEsc("DDS::dds_form_details_ordered_title")?>:</legend> <!-- author --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="sauthor"><?=$this->transEsc("DDS::form_field_author")?>:*</label> + <label class="inline control-label" for="sauthor"><?=$this->transEsc("DDS::form_field_author")?>:*</label> <? if (isset($this->error->author)): ?> <div class="error-field"> <?=$this->error->author;?> @@ -99,7 +99,7 @@ </div> <!-- title of issue --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="sarticle"><?=$this->transEsc("DDS::form_field_title")?>:</label> + <label class="inline control-label" for="sarticle"><?=$this->transEsc("DDS::form_field_title")?>:</label> <? if (isset($this->error->article)): ?> <div class="error-field"> <?=$this->error->article;?> @@ -109,7 +109,7 @@ </div> <!-- title of journal --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="sjournal"><?=$this->transEsc("DDS::form_field_journal")?>:*</label> + <label class="inline control-label" for="sjournal"><?=$this->transEsc("DDS::form_field_journal")?>:*</label> <? if (isset($this->error->journal)): ?> <div class="error-field"> <?=$this->error->journal;?> @@ -119,7 +119,7 @@ </div> <!-- issn --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="sjournal"><?=$this->transEsc("ISSN")?>:</label> + <label class="inline control-label" for="sjournal"><?=$this->transEsc("ISSN")?>:</label> <? if (isset($this->error->issn)): ?> <div class="error-field"> <?=$this->error->issn;?> @@ -129,7 +129,7 @@ </div> <!-- publish date --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="spublishdate"><?=$this->transEsc("DDS::form_field_publishing_date")?>:*</label> + <label class="inline control-label" for="spublishdate"><?=$this->transEsc("DDS::form_field_publishing_date")?>:*</label> <? if (isset($this->error->publishdate)): ?> <div class="error-field"> <?=$this->error->publishdate;?> @@ -139,7 +139,7 @@ </div> <!-- journal number --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="snumber"><?=$this->transEsc("DDS::form_field_volume")?>:*</label> + <label class="inline control-label" for="snumber"><?=$this->transEsc("DDS::form_field_volume")?>:*</label> <? if (isset($this->error->number)): ?> <div class="error-field"> <?=$this->error->number;?> @@ -149,7 +149,7 @@ </div> <!-- pages --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="spages"><?=$this->transEsc("DDS::form_field_pages")?>:*</label> + <label class="inline control-label" for="spages"><?=$this->transEsc("DDS::form_field_pages")?>:*</label> <? if (isset($this->error->pages)): ?> <div class="error-field"> <?=$this->error->pages;?> @@ -159,7 +159,7 @@ </div> <!-- remarks --> <div class="form-group"> - <label class="inline control-label col-sm-3" for="sremarks"><?=$this->transEsc("DDS::form_fields_remarks")?>:</label> + <label class="inline control-label" for="sremarks"><?=$this->transEsc("DDS::form_fields_remarks")?>:</label> <? if (isset($this->error->remarks)): ?> <div class="error-field"> <?=$this->error->remarks;?> diff --git a/themes/finc/templates/footer.phtml b/themes/finc/templates/footer.phtml index 5f4f75e33064f54a90d6a9a16374d4f406ad3693..84f5889dedc9eb21d4cbde5d569ade948cc4e20b 100644 --- a/themes/finc/templates/footer.phtml +++ b/themes/finc/templates/footer.phtml @@ -1,41 +1,45 @@ -<!-- finc FOOTER --> -<div class="row"> - <div class="col-xs-4"> - <p><strong><?=$this->transEsc('Search Options')?></strong></p> - <ul> - <li><a href="<?=$this->url('search-history')?>"><?=$this->transEsc('Search History')?></a></li> - <li><a href="<?=$this->url('search-advanced')?>"><?=$this->transEsc('Advanced Search')?></a></li> - </ul> - </div> +<!-- finc: footer --> +<footer class="hidden-print"> + <div class="footer-container"> + <div class="footer-column"> + <p><strong><?=$this->transEsc('Search Options')?></strong></p> + <ul> + <li><a href="<?=$this->url('search-history')?>"><?=$this->transEsc('Search History')?></a></li> + <li><a href="<?=$this->url('search-advanced')?>"><?=$this->transEsc('Advanced Search')?></a></li> + </ul> + </div> - <div class="col-xs-4"> - <p><strong><?=$this->transEsc('Find More')?></strong></p> - <ul> - <li><a href="<?=$this->url('browse-home')?>"><?=$this->transEsc('Browse the Catalog')?></a></li> - <li><a href="<?=$this->url('alphabrowse-home')?>"><?=$this->transEsc('Browse Alphabetically')?></a></li> - <li><a href="<?=$this->url('search-reserves')?>"><?=$this->transEsc('Course Reserves')?></a></li> - <li><a href="<?=$this->url('search-newitem')?>"><?=$this->transEsc('New Items')?></a></li> - <? /* Custom finc - CK */ ?> - <li><a href="<?=$this->url('myresearch-acquisition')?>"><?=$this->transEsc('Suggestions for acquisition')?></a></li> - </ul> - </div> - <div class="col-xs-4"> - <p><strong><?=$this->transEsc('Need Help?')?></strong></p> - <ul> - <li><a href="<?=$this->url('help-home')?>?topic=search" data-lightbox class="help-link"><?=$this->transEsc('Search Tips')?></a></li> - <li><a href="#"><?=$this->transEsc('Ask a Librarian')?></a></li> - <li><a href="#"><?=$this->transEsc('FAQs')?></a></li> - </ul> + <div class="footer-column"> + <p><strong><?=$this->transEsc('Find More')?></strong></p> + <ul> + <li><a href="<?=$this->url('browse-home')?>"><?=$this->transEsc('Browse the Catalog')?></a></li> + <li><a href="<?=$this->url('alphabrowse-home')?>"><?=$this->transEsc('Browse Alphabetically')?></a></li> + <li><a href="<?=$this->url('channels-home')?>"><?=$this->transEsc('channel_explore')?></a></li> + <li><a href="<?=$this->url('search-reserves')?>"><?=$this->transEsc('Course Reserves')?></a></li> + <li><a href="<?=$this->url('search-newitem')?>"><?=$this->transEsc('New Items')?></a></li> + <? /* Custom finc - CK */ ?> + <li><a href="<?=$this->url('myresearch-acquisition')?>"><?=$this->transEsc('Suggestions for acquisition')?></a></li> + </ul> + </div> + <div class="footer-column"> + <p><strong><?=$this->transEsc('Need Help?')?></strong></p> + <ul> + <li><a href="<?=$this->url('help-home')?>?topic=search&_=<?=time()?>" data-lightbox class="help-link"><?=$this->transEsc('Search Tips')?></a></li> + <li><a href="<?=$this->url('content-page', ['page' => 'asklibrary'])?>"><?=$this->transEsc('Ask a Librarian')?></a></li> + <li><a href="<?=$this->url('content-page', ['page' => 'faq'])?>"><?=$this->transEsc('FAQs')?></a></li> + </ul> + </div> </div> -<? /* finc branding footer */ ?> -<hr> -<div class="row powered-by"> - <div class="col-xs-12"> - <span>Powered by</span> - <a href="https://www.vufind.org" title="vufind.org" target="_blank"><img src="<?=$this->imageLink('vufind_logo.png')?>" alt="powered by VuFind - VuFind Logo" /></a> - <a href="http://blog.finc.info" title="Blog FinC-Team" target="_blank"><img src="<?=$this->imageLink('finc_logo.png')?>" alt="powered by finc - finc Logo" /></a> - </div> - </div> -</div> -<!-- finc FOOTER - END --> + <? /* finc branding footer */ ?> + <hr> + <div class="footer-container powered-by"> + <div class="footer-column"> + <?=$this->layout()->poweredBy?> + <span>Powered by</span> + <a href="https://www.vufind.org" title="vufind.org" target="_blank"><img src="<?=$this->imageLink('vufind_logo.png')?>" alt="powered by VuFind - VuFind Logo"/></a> + <a href="http://blog.finc.info" title="Blog FinC-Team" target="_blank"><img src="<?=$this->imageLink('finc_logo.png')?>" alt="powered by finc - finc Logo"/></a> + </div> + </div> +</footer> +<!-- finc: Footer - END --> diff --git a/themes/finc/templates/header.phtml b/themes/finc/templates/header.phtml index eb6c14042b0f45a10b6240217b0e5a884df92a20..e7553bf02fb721e5e9cc91082d60d100265bc3bf 100644 --- a/themes/finc/templates/header.phtml +++ b/themes/finc/templates/header.phtml @@ -1,135 +1,133 @@ -<!-- finc HEADER --> +<!-- finc: header --> <? $account = $this->auth()->getManager(); ?> - -<? /* This nav element is the sticky element in the header - CK; - you can use 'Affix' as an alternative to 'navbar-fixed-top' like so: +<? /* This navbar is the sticky element in the header - CK; you can use 'affix' as an alternative to 'navbar-fixed-top' like so: <div data-spy="affix" data-offset-top="1" class="navbar"> - Do not use 'navbar-fixed-top' and 'affix* at the same time. - When using 'affix', set the variables for '$navbar-height', '$navbar-height-xs' and '$navbar-height-sm' in _customVariables.scss to '=0' + Do not use 'navbar-fixed-top' and 'affix' at the same time. When using 'affix', set the variables for + '$navbar-height', '$navbar-height-xs' and '$navbar-height-sm' in _customVariables.scss to '=0' or set the paddings-top under 'body' in compiled.scss to '=0' */ ?> -<nav class="navbar navbar-fixed-top"> - <div class="container-fluid"> - - <? /* This element ONLY holds toggler and navbar-brand - CK */ ?> - <div class="navbar-header"> - <? /* mobile navigation toggler - CK */ ?> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-collapse"> - <span class="sr-only">Toggle navigation</span> - <i class="fa fa-bars" aria-hidden="true"></i> - </button> +<div class="banner container navbar navbar-fixed-top"> + <? /* This element only holds the mobile toggler and the navbar-brand/library name - CK */ ?> + <div class="navbar-header"> + <? /* mobile navigation toggler - CK */ ?> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-collapse"> + <span class="sr-only">Toggle navigation</span> + <i class="fa fa-bars" aria-hidden="true"></i> + </button> - <h1> - <a class="navbar-brand lang-<?=$this->layout()->userLang?>" href="<?=$this->url('home')?>"> - <? /* Custom finc header - CK */ ?> + <h1> + <a class="navbar-brand lang-<?=$this->layout()->userLang?>" href="<?=$this->url('home')?>"> + <? /* Custom finc header - CK*/ ?> <span class="hidden-sm hidden-md hidden-lg"><?=$this->transEsc("LibraryName")?></span> <img src="<?=$this->imageLink('headerlogo.png')?>" class="hidden-xs" alt="Logo <?=$this->transEsc("LibraryName")?>" title="<?=$this->transEsc("LibraryName")?>"> - <? /* Custom finc header - END */ ?> - </a> - </h1> - </div> + <? /* Custom finc header - END */ ?> + </a> + </h1> + </div> - <? if ($this->layout()->searchbox !== false): ?> - <? /* remove visible-lg to show on small etc, CK */ ?> - <section id="searchslots" class="left"> - <ul class="navbar-left list-unstyled margin-l-xs"> - <li> - <?=$this->layout()->searchbox?> - </li> - </ul> - </section> - <? endif; ?> - <? if (!isset($this->layout()->renderingError)): ?> - <div class="collapse navbar-collapse right" id="header-collapse"> - <? /* Right-hand Nav Section */ ?> - <nav> - <ul class="nav navbar-nav navbar-right flip"> + <div class="flex-container"> + <? if (!isset($this->layout()->renderingError)): ?> + <div class="collapse navbar-collapse right" id="header-collapse"> + <? /* finc: right-hand navbar section - see flex-container in SCSS: + we need this order on XS: navbar-right searchbox + but reverse it on anything but mobile */ ?> + <nav> + <ul class="nav navbar-nav navbar-right flip"> + <? if ($this->feedback()->tabEnabled()): ?> + <li> + <a id="feedbackLink" data-lightbox class="btn" href="<?=$this->url('feedback-home')?>"> <i class="fa fa-envelope" aria-hidden="true"></i> + <span class="hidden-sm"><?=$this->transEsc("Feedback")?></span> + </a> + </li> + <? endif; ?> + <? $cart = $this->cart(); + if ($cart->isActive()): ?> + <li id="cartSummary"> + <a id="cartItems" class="btn" data-lightbox title="<?=$this->transEsc('View Book Bag')?>" href="<?=$this->url('cart-home')?>"> + <i class="fa fa-clipboard" aria-hidden="true"></i> <strong><?=count($cart->getItems())?></strong> <span class="cart-label"><?=$this->transEsc('items')?></span> + <span class="hidden-sm full<?=!$cart->isFull() ? ' hidden' : ''?>">(<?=$this->transEsc('bookbag_full')?>)</span> + </a> + </li> + <? endif; ?> + <? if (is_object($account) && $account->loginEnabled()): // hide login/logout if unavailable ?> + <li class="logoutOptions<? if (!$account->isLoggedIn()): ?> hidden<? endif ?>"> + <a class="btn" href="<?=$this->url('myresearch-home', array(), array('query' => array('redirect' => 0)))?>"> + <i class="fa fa-home" aria-hidden="true"></i> + <span class="hidden-sm"><?=$this->transEsc("Your Account")?></span> + </a> + </li> - <? if ($this->feedback()->tabEnabled()): ?> - <li> - <a id="feedbackLink" class="btn" data-lightbox href="<?=$this->url('feedback-home')?>"> - <i class="fa fa-envelope" aria-hidden="true"></i> - <span class="hidden-sm"><?=$this->transEsc("Feedback")?></span> - </a> - </li> - <? endif; ?> - <? $cart = $this->cart(); - if ($cart->isActive()): ?> - <li id="cartSummary"> - <a id="cartItems" class="btn" data-lightbox title="<?=$this->transEsc('View Book Bag')?>" href="<?=$this->url('cart-home')?>"> - <i class="fa fa-clipboard" aria-hidden="true"></i> <strong><?=count($cart->getItems())?></strong> - <span class="hidden-sm"><?=$this->transEsc('items')?><?=$cart->isFull() ? ' (' . $this->transEsc('bookbag_full') . ')' : ''?></span> - </a> - </li> - <? endif; ?> - <? if (is_object($account) && $account->loginEnabled()): // hide login/logout if unavailable ?> - <li class="logoutOptions<? if (!$account->isLoggedIn()): ?> hidden<? endif ?>"> - <a class="btn" href="<?=$this->url('myresearch-home', array(), array('query' => array('redirect' => 0)))?>"> - <i class="fa fa-home" aria-hidden="true"></i> - <span class="hidden-sm"><?=$this->transEsc("Your Account")?></span> - </a> - </li> + <li class="logoutOptions<? if (!$account->isLoggedIn()): ?> hidden<? endif ?>"> + <a href="<?=$this->url('myresearch-logout')?>" class="logout btn" title="<?=$this->transEsc("Log Out")?>"> + <i class="fa fa-sign-out" aria-hidden="true"></i> + <span class="hidden-sm"><?=$this->transEsc("Log Out")?></span> + </a> + </li> - <li class="logoutOptions<? if (!$account->isLoggedIn()): ?> hidden<? endif ?>"> - <a class="logout btn" href="<?=$this->url('myresearch-logout')?>" title="<?=$this->transEsc("Log Out")?>"> - <i class="fa fa-sign-out" aria-hidden="true"></i> - <span class="hidden-sm"><?=$this->transEsc("Log Out")?></span> + <li id="loginOptions"<? if ($account->isLoggedIn()): ?> class="hidden"<? endif ?>> + <? if ($account->getSessionInitiator($this->serverUrl($this->url('myresearch-home')))): ?> + <a class="btn" href="<?=$this->url('myresearch-userlogin')?>"> + <i class="fa fa-sign-in" aria-hidden="true"></i> + <span class="hidden-sm"><?=$this->transEsc("Institutional Login")?></span> </a> - </li> - - <li id="loginOptions"<? if ($account->isLoggedIn()): ?> class="hidden"<? endif ?>> - <? if ($account->getSessionInitiator($this->serverUrl($this->url('myresearch-home')))): ?> - <a class="btn" href="<?=$this->url('myresearch-userlogin')?>"> - <i class="fa fa-sign-in" aria-hidden="true"></i> - <span class="hidden-sm"><?=$this->transEsc("Institutional Login")?></span> - </a> - <? else: ?> - <a class="btn" href="<?=$this->url('myresearch-userlogin')?>" data-lightbox> - <i class="fa fa-sign-in" aria-hidden="true"></i> - <span class="hidden-sm"><?=$this->transEsc("Login")?></span> - </a> - <? endif; ?> - </li> - <? endif; ?> - - <? if (isset($this->layout()->themeOptions) && count($this->layout()->themeOptions) > 1): ?> - <li class="theme dropdown"> - <form method="post" name="themeForm" id="themeForm"> - <input type="hidden" name="ui"/> - </form> - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?=$this->transEsc("Theme")?> <strong class="caret"></strong></a> + <? else: ?> + <a class="btn" href="<?=$this->url('myresearch-userlogin')?>" data-lightbox> + <i class="fa fa-sign-in" aria-hidden="true"></i> + <span class="hidden-sm"><?=$this->transEsc("Login")?></span> + </a> + <? endif; ?> + </li> + <? endif; ?> - <ul class="dropdown-menu"> - <? foreach ($this->layout()->themeOptions as $current): ?> - <li<?=$current['selected'] ? ' class="active"' : ''?>> - <a href="#" onClick="document.themeForm.ui.value='<?=$this->escapeHtmlAttr($current['name'])?>';document.themeForm.submit()"><?=$this->transEsc($current['desc'])?></a> - </li> - <? endforeach; ?> - </ul> - </li> - <? endif; ?> + <? if (isset($this->layout()->themeOptions) && count($this->layout()->themeOptions) > 1): ?> + <li class="theme dropdown"> + <form method="post" name="themeForm" id="themeForm"> + <input type="hidden" name="ui"/> + </form> + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?=$this->transEsc("Theme")?> <strong class="caret"></strong></a> - <? if (isset($this->layout()->allLangs) && count($this->layout()->allLangs) > 1): ?> - <li class="language dropdown"> - <form method="post" name="langForm" id="langForm"> - <input type="hidden" name="mylang"/> - </form> - <a class="btn dropdown-toggle hidden-xs hidden-sm" data-toggle="dropdown" href="#" aria-controls="langmenu" aria-expanded="false"><?=$this->transEsc("Language")?> <strong - class="caret"></strong></a> + <ul class="dropdown-menu"> + <? foreach ($this->layout()->themeOptions as $current): ?> + <li<?=$current['selected'] ? ' class="active"' : ''?>> + <a href="#" onClick="document.themeForm.ui.value='<?=$this->escapeHtmlAttr($current['name'])?>';document.themeForm.submit()"><?=$this->transEsc($current['desc'])?></a> + </li> + <? endforeach; ?> + </ul> + </li> + <? endif; ?> - <ul id="langmenu" class="dropdown-menu"> - <? foreach ($this->layout()->allLangs as $langCode => $langName): ?> - <li<?=$this->layout()->userLang == $langCode ? ' class="active"' : ''?>> - <a class="btn" href="#" onClick="document.langForm.mylang.value='<?=$langCode?>';document.langForm.submit()"><?=$this->displayLanguageOption($langName)?></a> - </li> - <? endforeach; ?> - </ul> - </li> - <? endif; ?> - </ul> + <? if (isset($this->layout()->allLangs) && count($this->layout()->allLangs) > 1): ?> + <li class="language dropdown"> + <form method="post" name="langForm" id="langForm"> + <input type="hidden" name="mylang"/> + </form> + <a href="#" class="btn dropdown-toggle hidden-xs hidden-sm" data-toggle="dropdown" aria-controls="langmenu" aria-expanded="false"> + <?=$this->transEsc("Language")?> <strong class="caret"></strong> + </a> + <ul id="langmenu" class="dropdown-menu"> + <? foreach ($this->layout()->allLangs as $langCode => $langName): ?> + <li<?=$this->layout()->userLang == $langCode ? ' class="active"' : ''?>> + <a class="btn" href="#" onClick="document.langForm.mylang.value='<?=$langCode?>';document.langForm.submit()"><?=$this->displayLanguageOption($langName)?></a> + </li> + <? endforeach; ?> + </ul> + </li> + <? endif; ?> + </ul> + </nav> + </div> + <? endif; ?> + <? /* finc searchbox: we use searchbox here so it becomes part of the sticky header, + we need to place this after the navbar-right for anything but mobile - see flex-container in SCSS:*/ ?> + <? if ($this->layout()->searchbox !== false): ?> + <div class="search container left"> + <nav class="nav searchbox hidden-print"> + <?=$this->layout()->searchbox?> </nav> </div> <? endif; ?> + <? /* finc searchbox - END */ ?> </div> -</nav> -<!-- finc HEADER - END --> +</div> +<? /* If you want to use searchbox in a separate row, insert it here as in bootstrap theme - CK */ ?> +<!-- finc: header - END --> diff --git a/themes/finc/templates/layout/layout.phtml b/themes/finc/templates/layout/layout.phtml index 02d3c6129c76fb6a7360a15f6be3adf21c25d8f4..e82dffac90501867b0a83f46393821950bb6df01 100644 --- a/themes/finc/templates/layout/layout.phtml +++ b/themes/finc/templates/layout/layout.phtml @@ -3,7 +3,7 @@ <head> <? $this->headThemeResources() ?> <? /* remove meta because of W3C Validator error - CK */ - /* <meta charset="utf-8"> */ + /* <meta charset="utf-8"> */ ?> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta name="viewport" content="width=device-width,initial-scale=1.0"/> @@ -12,12 +12,12 @@ <? // Set up OpenSearch link: $this->headLink( - array( + [ 'href' => $this->url('search-opensearch') . '?method=describe', 'type' => 'application/opensearchdescription+xml', 'title' => $this->transEsc('Library Catalog Search'), 'rel' => 'search' - ) + ] ); ?> <!-- RTL styling --> @@ -31,7 +31,7 @@ // Add translation strings // PDA (BELOW) is a custom finc string - CK $this->jsTranslations()->addStrings( - array( + [ 'pda_send_success' => 'PDA::pda_send_success', 'add_tag_success' => 'add_tag_success', 'bulk_email_success' => 'bulk_email_success', @@ -51,14 +51,14 @@ 'loading' => 'Loading', 'more' => 'more', 'number_thousands_separator' => [ - 'number_thousands_separator', null, ',' + 'number_thousands_separator', null, ',' ], 'sms_success' => 'sms_success' - ) + ] ); // Add libphonenumber.js strings $this->jsTranslations()->addStrings( - array( + [ "Phone number invalid" => 'libphonenumber_invalid', "Invalid country calling code" => 'libphonenumber_invalidcountry', "Invalid region code" => 'libphonenumber_invalidregion', @@ -66,7 +66,7 @@ "The string supplied is too long to be a phone number" => 'libphonenumber_toolong', "The string supplied is too short to be a phone number" => 'libphonenumber_tooshort', "Phone number too short after IDD" => 'libphonenumber_tooshortidd' - ) + ] ); // Deal with cart stuff: $cart = $this->cart(); @@ -74,19 +74,19 @@ $this->headScript()->appendFile("vendor/cookies.js"); $this->headScript()->appendFile("cart.js"); $domain = $cart->getCookieDomain(); - if (!empty($domain)) { - $this->headScript()->appendScript( - 'VuFind.cart.setDomain("' . $domain . '");' - ); - } - $cookiePath = $cart->getCookiePath(); - if (!empty($cookiePath)) { - $this->headScript()->appendScript( - 'VuFind.cart.setCookiePath("' . $cookiePath . '");' - ); - } + if (!empty($domain)) { + $this->headScript()->appendScript( + 'VuFind.cart.setDomain("' . $domain . '");' + ); + } + $cookiePath = $cart->getCookiePath(); + if (!empty($cookiePath)) { + $this->headScript()->appendScript( + 'VuFind.cart.setCookiePath("' . $cookiePath . '");' + ); + } $this->jsTranslations()->addStrings( - array( + [ 'addBookBag' => 'Add to Book Bag', 'bookbagFull' => 'bookbag_full_msg', 'bookbagMax' => $cart->getMaxSize(), @@ -97,7 +97,7 @@ 'itemsInBag' => 'items_already_in_bookbag', 'removeBookBag' => 'Remove from Book Bag', 'viewBookBag' => 'View Book Bag' - ) + ] ); } $this->headScript()->appendScript( @@ -125,7 +125,7 @@ JS; ?> <?=$this->headScript()?> </head> -<body class="<?=$this->layoutClass('offcanvas-row')?><? if ($this->layout()->rtl): ?> rtl<? endif; ?>"> +<body class="template-dir-<?=$this->templateDir?> template-name-<?=$this->templateName?> <?=$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 @@ -137,58 +137,49 @@ if (!isset($this->layout()->searchbox)) { } ?> <? if (isset($this->layout()->srmessage)): // message for benefit of screen-reader users ?> - <span class="sr-only"><?=$this->layout()->srmessage ?></span> + <span class="sr-only"><?=$this->layout()->srmessage?></span> <? endif; ?> <a class="sr-only" href="#searchslots"><?=$this->transEsc('Skip to search')?></a> <a class="sr-only" href="#content"><?=$this->transEsc('Skip to content')?></a> <? /* Start header here, not above, custom finc, CK */ ?> <header class="hidden-print"> - <div class="container"> - <?=$this->render('header.phtml')?> - </div> - - <? /* Call searchbox in header.phtml, CK */ ?> - + <?=$this->render('header.phtml')?> +</header> +<nav class="breadcrumbs"> + <? /* finc: Don't use .container here or the breadcrumbs will get a left+right padding - CK */ ?> <? if ((!isset($this->layout()->showBreadcrumbs) || $this->layout()->showBreadcrumbs == true) && !empty($this->layout()->breadcrumbs) && $this->layout()->breadcrumbs !== false ): ?> - <ul class="breadcrumb col-lg-12 large-centered hidden-xs hidden-print"> + <ul class="breadcrumb large-centered hidden-xs hidden-print"> <? if (is_array($this->layout()->breadcrumbs)): ?> <? if (count($this->layout()->breadcrumbs) > 1): ?> - <?=$this->render('breadcrumbs/multi.phtml', array( + <?=$this->render('breadcrumbs/multi.phtml', [ 'parents' => $this->layout()->breadcrumbs, 'title' => $this->layout()->title, 'from' => $this->layout()->from - ))?> + ])?> <? else: ?> - <?=$this->render('breadcrumbs/default.phtml', array( + <?=$this->render('breadcrumbs/default.phtml', [ 'parents' => $this->layout()->breadcrumbs, 'title' => $this->layout()->title - ))?> + ])?> <? endif; ?> <? else: ?> <?=$this->layout()->breadcrumbs?> <? endif; ?> </ul> <? endif; ?> - -</header> - - -<div role="main" class="main template-dir-<?=$this->templateDir?> template-name-<?=$this->templateName?>"> +</nav> +<div role="main" class="main"> <div id="content" class="container"> <?=$this->layout()->content?> </div> </div> -<footer class="hidden-print"> - <div class="container"> - <?=$this->render('footer.phtml')?> - <?=$this->layout()->poweredBy?> - </div> -</footer> +<?=$this->render('footer.phtml')?> + <!-- MODAL IN CASE WE NEED ONE --> <div id="modal" class="modal fade hidden-print" tabindex="-1" role="dialog" aria-labelledby="modalTitle" aria-hidden="true"> diff --git a/themes/finc/templates/librarycards/home.phtml b/themes/finc/templates/librarycards/home.phtml index d96ae48ec61d44f9a8c0c652fe077d18bffac1ba..7e91e653ec6593d1f230297a8986120847ab933a 100644 --- a/themes/finc/templates/librarycards/home.phtml +++ b/themes/finc/templates/librarycards/home.phtml @@ -6,7 +6,6 @@ // Set up breadcrumbs: $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Library Cards') . '</li>'; ?> -<div class="row"> <div class="<?=$this->layoutClass('mainbody')?>"> <?=$this->flashmessages()?> @@ -62,8 +61,6 @@ </div> <div class="<?=$this->layoutClass('sidebar')?>"> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", array('active' => 'librarycards'))?> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'librarycards'])?> </div> - -</div> <!-- find: librarycards - home - END --> diff --git a/themes/finc/templates/myresearch/acquisition.phtml b/themes/finc/templates/myresearch/acquisition.phtml index 2c10d54539acc019330a752ce3d856ddb242847d..6a2d15c3ea80c3942286145a84a7783fc1d9860b 100644 --- a/themes/finc/templates/myresearch/acquisition.phtml +++ b/themes/finc/templates/myresearch/acquisition.phtml @@ -7,51 +7,51 @@ $this->headTitle($this->translate('PDA::pda_form_title')); $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('PDA::pda_form_title') . '</li>'; ?> -<div class="row"> - <div class="<?=$this->layoutClass('mainbody')?>"> - <h2><?=$this->transEsc('PDA::pda_form_subtitle') ?></h2> - <?=$this->flashmessages() ?> - <form class="form-horizontal" method="post" action="" name="acquisitionForm"> - <h6><?=$this->transEsc('PDA::pda_form_suggestions_limit') ?></h6> - <div class="form-group row"> - <label class="col-sm-3 control-label" for="subject"><?=$this->transEsc('PDA::pda_form_field_of_study_label')?><span class="required">*</span></label> - <div class="col-sm-9"> - <select name="field_of_study" class="form-control auto"> - <option value="-1"><?=$this->transEsc('PDA::pda_form_field_of_study_text') ?></option> - <? if (isset($fieldOfStudyList) && is_array($fieldOfStudyList)): ?> - <? foreach ($fieldOfStudyList as $fieldOfStudy): ?> - <option value="<?=$fieldOfStudy?>" <? if (isset($acquisitionFieldOfStudy) && ($acquisitionFieldOfStudy != '-1') && ($acquisitionFieldOfStudy == $fieldOfStudy)): ?> selected="selected"<? endif; ?>><?= $this->transEsc('PDA::fos_' . $fieldOfStudy) ?></option> - <? endforeach; ?> - <? endif; ?> - </select> - </div> - </div> - <div class="form-group row"> - <label class="col-sm-3 control-label" for="acquistion_reasons"><?=$this->transEsc('PDA::pda_form_statement_label')?><span class="required">*</span></label> - <div class="col-sm-9"> - <textarea id="acquisition_reasons" type="text" cols="50" rows="5" name="reasons"><?=(isset($acquisitionStatement) && !empty($acquisitionStatement)) ? $acquisitionStatement : ''?></textarea> - </div> - </div> - <div class="form-group row"> - <label class="col-sm-3 control-label" for="acquistion_proposal"><?=$this->transEsc('PDA::pda_form_proposal_label')?><span class="required">*</span></label> - <div class="col-sm-9"> - <textarea id="acquisition_proposal" type="text" cols="50" rows="5" name="proposal"><?=(isset($acquisitionProposal) && !empty($acquisitionProposal)) ? $acquisitionProposal : ''?></textarea> - </div> - </div> - <div class="form-group row"> - <div class="col-sm-9 offset-sm-23"> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Submit')?>"/> - </div> - </div> - <div class="form-group row"> - <div class="col-sm-9 offset-sm-23"> - <?=$this->transEsc('PDA::note_mandatory_fields') ?> - </div> - </div> - </form> +<div class="<?=$this->layoutClass('mainbody')?>"> + <h2><?=$this->transEsc('PDA::pda_form_subtitle')?></h2> + <?=$this->flashmessages()?> + <form method="post" action="" name="acquisitionForm"> + <h6><?=$this->transEsc('PDA::pda_form_suggestions_limit')?></h6> + <div class="form-group row"> + <label class="col-sm-3 control-label" for="subject"><?=$this->transEsc('PDA::pda_form_field_of_study_label')?><span class="required">*</span></label> + <div class="col-sm-9"> + <select name="field_of_study" class="form-control auto"> + <option value="-1"><?=$this->transEsc('PDA::pda_form_field_of_study_text')?></option> + <? if (isset($fieldOfStudyList) && is_array($fieldOfStudyList)): ?> + <? foreach ($fieldOfStudyList as $fieldOfStudy): ?> + <option + value="<?=$fieldOfStudy?>" <? if (isset($acquisitionFieldOfStudy) && ($acquisitionFieldOfStudy != '-1') && ($acquisitionFieldOfStudy == $fieldOfStudy)): ?> selected="selected"<? endif; ?>><?=$this->transEsc('PDA::fos_' . $fieldOfStudy)?></option> + <? endforeach; ?> + <? endif; ?> + </select> + </div> </div> - <div class="<?=$this->layoutClass('sidebar')?>"> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", array('active' => 'aquisition'))?> + <div class="form-group row"> + <label class="col-sm-3 control-label" for="acquistion_reasons"><?=$this->transEsc('PDA::pda_form_statement_label')?><span class="required">*</span></label> + <div class="col-sm-9"> + <textarea id="acquisition_reasons" type="text" cols="50" rows="5" name="reasons"><?=(isset($acquisitionStatement) && !empty($acquisitionStatement)) ? $acquisitionStatement : ''?></textarea> + </div> </div> + <div class="form-group row"> + <label class="col-sm-3 control-label" for="acquistion_proposal"><?=$this->transEsc('PDA::pda_form_proposal_label')?><span class="required">*</span></label> + <div class="col-sm-9"> + <textarea id="acquisition_proposal" type="text" cols="50" rows="5" name="proposal"><?=(isset($acquisitionProposal) && !empty($acquisitionProposal)) ? $acquisitionProposal : ''?></textarea> + </div> + </div> + <div class="form-group row"> + <div class="col-sm-9 offset-sm-23"> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Submit')?>"/> + </div> + </div> + <div class="form-group row"> + <div class="col-sm-9 offset-sm-23"> + <?=$this->transEsc('PDA::note_mandatory_fields')?> + </div> + </div> + </form> </div> +<div class="<?=$this->layoutClass('sidebar')?>"> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", array('active' => 'aquisition'))?> +</div> + <!-- finc: myresearch - acquisition - END --> diff --git a/themes/finc/templates/myresearch/bulk-action-buttons.phtml b/themes/finc/templates/myresearch/bulk-action-buttons.phtml index 1199fd72912230ac2fd6272fdcfb7945d7bfa7c4..4a93b70dac51f20089f3c3e9fc40ae54113ee380 100644 --- a/themes/finc/templates/myresearch/bulk-action-buttons.phtml +++ b/themes/finc/templates/myresearch/bulk-action-buttons.phtml @@ -1,27 +1,29 @@ <!-- finc: myresearch - bulkactionbuttons --> <? if (isset($list)): ?> - <input type="hidden" name="listID" value="<?=$this->escapeHtmlAttr($list->id)?>" /> - <input type="hidden" name="listName" value="<?=$this->escapeHtmlAttr($list->title)?>" /> + <input type="hidden" name="listID" value="<?=$this->escapeHtmlAttr($list->id)?>"/> + <input type="hidden" name="listName" value="<?=$this->escapeHtmlAttr($list->title)?>"/> <? endif; ?> <? $user = $this->auth()->isLoggedIn(); ?> -<div class="checkbox hidden-print"> - <label> - <input type="checkbox" name="selectAll" class="checkbox-select-all"/> - <?=$this->transEsc('select_page')?> | <?=$this->transEsc('with_selected')?>: - </label> -</div> -<? /* Keep bulk-action-buttons class, finc-specific SCSS, CK */ ?> -<div class="btn-group bulk-action-buttons hidden-print"> - <input class="btn btn-transparent" type="submit" name="email" value="<?=$this->transEsc('Email')?>" title="<?=$this->transEsc('email_selected')?>"/> - <? if ((!is_null($this->list) && $this->list->editAllowed($user)) || is_null($this->list) && $user): ?> - <input class="btn btn-transparent" id="<?=$this->idPrefix?>delete_list_items_<?=!is_null($this->list) ? $this->escapeHtmlAttr($this->list->id) : ''?>" type="submit" name="delete" value="<?=$this->transEsc('Delete')?>" title="<?=$this->transEsc('delete_selected')?>"/> - <? endif; ?> - <? $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?> - <input class="btn btn-transparent" type="submit" name="export" value="<?=$this->transEsc('Export')?>" title="<?=$this->transEsc('export_selected')?>"/> - <? endif; ?> - <input class="btn btn-transparent" type="submit" name="print" value="<?=$this->transEsc('Print')?>" title="<?=$this->transEsc('print_selected')?>" data-lightbox-ignore/> - <? if ($this->cart()->isActive()): ?> - <input class="btn btn-transparent" id="<?=$this->idPrefix?>updateCart" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/> - <? endif; ?> +<div class="bulkActionButtons hidden-print"> + <div class="bulk-checkbox"> + <input type="checkbox" name="selectAll" class="checkbox-select-all" id="myresearchCheckAll"/> + <label for="myresearchCheckAll"><?=$this->transEsc('select_page')?> | <?=$this->transEsc('with_selected')?>:</label> + </div> + + <? /* Keep bulk-action-buttons class, finc-specific SCSS, CK */ ?> + <div class="btn-group bulk-action-buttons hidden-print"> + <input class="btn btn-transparent" type="submit" name="email" value="<?=$this->transEsc('Email')?>" title="<?=$this->transEsc('email_selected')?>"/> + <? if ((!is_null($this->list) && $this->list->editAllowed($user)) || is_null($this->list) && $user): ?> + <input class="btn btn-transparent" id="<?=$this->idPrefix?>delete_list_items_<?=!is_null($this->list) ? $this->escapeHtmlAttr($this->list->id) : ''?>" type="submit" name="delete" value="<?=$this->transEsc('Delete')?>" title="<?=$this->transEsc('delete_selected')?>"/> + <? endif; ?> + <? $exportOptions = $this->export()->getActiveFormats('bulk'); + if (count($exportOptions) > 0): ?> + <input class="btn btn-transparent" type="submit" name="export" value="<?=$this->transEsc('Export')?>" title="<?=$this->transEsc('export_selected')?>"/> + <? endif; ?> + <input class="btn btn-transparent" type="submit" name="print" value="<?=$this->transEsc('Print')?>" title="<?=$this->transEsc('print_selected')?>" data-lightbox-ignore/> + <? if ($this->cart()->isActive()): ?> + <input class="btn btn-transparent" id="<?=$this->idPrefix?>updateCart" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/> + <? endif; ?> + </div> </div> <!-- finc: myresearch - bulkactionbuttons - END --> diff --git a/themes/finc/templates/myresearch/fines.phtml b/themes/finc/templates/myresearch/fines.phtml index 22ab11c79727c4981861912fc116ceebfc5be60f..d400c1d69e47e2defbaf0c8c68d7728f7d998aa6 100644 --- a/themes/finc/templates/myresearch/fines.phtml +++ b/themes/finc/templates/myresearch/fines.phtml @@ -10,7 +10,7 @@ <h2><?=$this->transEsc('Your Fines')?></h2> <?=$this->flashmessages()?> - <?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', array('user' => $this->auth()->isLoggedIn())); ?> + <?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $this->auth()->isLoggedIn()]); ?> <? if (empty($this->fines)): ?> <?=$this->transEsc('You do not have any fines')?> @@ -54,6 +54,6 @@ </div> <div class="<?=$this->layoutClass('sidebar')?>"> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", array('active' => 'fines'))?> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'fines'])?> </div> <!-- finc: myresearch - fines - END --> diff --git a/themes/finc/templates/myresearch/login.phtml b/themes/finc/templates/myresearch/login.phtml deleted file mode 100644 index 8880a3ce5e9d1fc44ce319db745cbbfb47c2022a..0000000000000000000000000000000000000000 --- a/themes/finc/templates/myresearch/login.phtml +++ /dev/null @@ -1,31 +0,0 @@ -<!-- finc: myresearch - login --> -<? -// Set up page title: -$this->headTitle($this->translate('Login')); - -// Set up breadcrumbs: -$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Login') . '</li>'; - -// Convenience variables: -$account = $this->auth()->getManager(); -$hideLogin = !(is_object($account) && $account->loginEnabled()); -$offlineMode = $this->ils()->getOfflineMode(); -?> - -<? if ($offlineMode == "ils-offline"): ?> - <div class="alert alert-warning"> - <?=$this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_login_message'])?> - </div> -<? else: ?> - <h2 class="lightbox-header"><?=$this->transEsc('Login')?></h2> - <?=$this->flashmessages()?> - - - <? if ($hideLogin): ?> - <div class="alert alert-danger"><?=$this->transEsc('login_disabled')?></div> - <? else: ?> - <?=$this->auth()->getLogin()?> - <? endif; ?> - -<? endif; ?> -<!-- finc: myresearch - login - END --> diff --git a/themes/finc/templates/myresearch/menu.phtml b/themes/finc/templates/myresearch/menu.phtml index 775e96fed132b88f599540cff1952af235618207..5834d440699950351f210403205992d26f0b9407 100644 --- a/themes/finc/templates/myresearch/menu.phtml +++ b/themes/finc/templates/myresearch/menu.phtml @@ -1,95 +1,120 @@ <!-- finc: myresearch - menu --> -<h4><?= $this->transEsc('Your Account') ?></h4> -<div class="list-group"> - <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <a href="<?=$this->url('myresearch-favorites')?>" class="list-group-item<?=$this->active == 'favorites' ? ' active' : ''?>"> - <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Favorites')?> - </a> - <? endif; ?> - <? if ('ils-none' !== $this->ils()->getOfflineMode()): ?> - <? if ($this->ils()->checkCapability('getMyTransactions')): ?> - <a href="<?=$this->url('myresearch-checkedout')?>" class="list-group-item<?=$this->active == 'checkedout' ? ' active' : ''?>"> - <i class="fa fa-fw fa-book" aria-hidden="true"></i> <?=$this->transEsc('Checked Out Items')?> - <? /* nxt line finc specific - CK */ ?> - <span id="getMyTransactions" class="itemCount pull-right no-padding"></span> +<h4><?=$this->transEsc('Your Account')?></h4> +<? /* finc needs to add .facet-group class and classes on sub items for borders - CK */ ?> +<div class="myresearch-menu facet-group"> + <? if ($this->userlist()->getMode() !== 'disabled'): ?> + + <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Favorites')?> </a> + <? endif; ?> - <? if ($this->ils()->checkCapability('getMyHolds')): ?> - <a href="<?=$this->url('myresearch-holds')?>" class="list-group-item<?=$this->active == 'holds' ? ' active' : ''?>"> - <i class="fa fa-fw fa-flag" aria-hidden="true"></i> <?=$this->transEsc('Holds and Recalls')?> - <? /* nxt line finc specific - CK */ ?> + <? if ('ils-none' !== $this->ils()->getOfflineMode()): ?> + <? if ($this->ils()->checkCapability('getMyTransactions')): ?> + + <a href="<?=$this->url('myresearch-checkedout')?>"<?=$this->active == 'checkedout' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-book" aria-hidden="true"></i> <?=$this->transEsc('Checked Out Items')?> + <? /* nxt line finc specific - CK */ ?> + <span id="getMyTransactions" class="itemCount pull-right no-padding"></span> + </a> + <? endif; ?> + <? if ($this->ils()->checkCapability('getMyHolds')): ?> + + <a href="<?=$this->url('myresearch-holds')?>"<?=$this->active == 'holds' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-flag" aria-hidden="true"></i> <?=$this->transEsc('Holds and Recalls')?> + <? /* nxt line finc specific - CK */ ?> <span id="getMyHolds" class="itemCount pull-right no-padding"></span> </a> - <? endif; ?> - <? if ($this->ils()->checkFunction('StorageRetrievalRequests')): ?> - <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="list-group-item<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>"> - <i class="fa fa-fw fa-archive" aria-hidden="true"></i> <?=$this->transEsc('Storage Retrieval Requests')?> - <? /* nxt line finc specific - CK */ ?> + + <? endif; ?> + <? if ($this->ils()->checkFunction('StorageRetrievalRequests')): ?> + + <a href="<?=$this->url('myresearch-storageretrievalrequests')?>"<?=$this->active == 'storageRetrievalRequests' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-archive" aria-hidden="true"></i> <?=$this->transEsc('Storage Retrieval Requests')?> + <? /* nxt line finc specific - CK */ ?> <span id="getMyStorageRetrievalRequests" class="itemCount pull-right no-padding"></span> </a> - <? endif; ?> - <? if ($this->ils()->checkFunction('ILLRequests')): ?> - <a href="<?=$this->url('myresearch-illrequests')?>" class="list-group-item<?=$this->active == 'ILLRequests' ? ' active' : ''?>"> - <i class="fa fa-fw fa-exchange" aria-hidden="true"></i> <?=$this->transEsc('Interlibrary Loan Requests')?> - <? /* nxt line finc specific - CK */ ?> + + <? endif; ?> + <? if ($this->ils()->checkFunction('ILLRequests')): ?> + + <a href="<?=$this->url('myresearch-illrequests')?>"<?=$this->active == 'ILLRequests' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-exchange" aria-hidden="true"></i> <?=$this->transEsc('Interlibrary Loan Requests')?> + <? /* nxt line finc specific - CK */ ?> <span id="getMyILLRequests" class="itemCount pull-right no-padding"></span> </a> - <? endif; ?> - <? if ($this->ils()->checkCapability('getMyFines')): ?> - <a href="<?=$this->url('myresearch-fines')?>" class="list-group-item<?=$this->active == 'fines' ? ' active' : ''?>"> - <i class="fa fa-fw fa-euro" aria-hidden="true"></i> <?=$this->transEsc('Fines')?> + + <? endif; ?> + <? if ($this->ils()->checkCapability('getMyFines')): ?> + + <a href="<?=$this->url('myresearch-fines')?>"<?=$this->active == 'fines' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-usd" aria-hidden="true"></i> <?=$this->transEsc('Fines')?> </a> - <? endif; ?> - <? if ($this->ils()->checkCapability('getMyProfile')): ?> - <a href="<?=$this->url('myresearch-profile')?>" class="list-group-item<?=$this->active == 'profile' ? ' active' : ''?>"> - <i class="fa fa-fw fa-user" aria-hidden="true"></i> <?=$this->transEsc('Profile')?> + + <? endif; ?> + <? if ($this->ils()->checkCapability('getMyProfile')): ?> + + <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-user" aria-hidden="true"></i> <?=$this->transEsc('Profile')?> </a> - <? endif; ?> - <? $user = $this->auth()->isLoggedIn(); - if ($user && $user->libraryCardsEnabled()): ?> - <a href="<?=$this->url('librarycards-home')?>" class="list-group-item<?=$this->active == 'librarycards' ? ' active' : ''?>"> - <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?> + + <? endif; ?> + <? $user = $this->auth()->isLoggedIn(); + if ($user && $user->libraryCardsEnabled()): ?> + + <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?> </a> + + <? endif; ?> <? endif; ?> - <? endif; ?> - <? if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> - <a href="<?=$this->url('search-history')?>?require_login" class="list-group-item<?=$this->active == 'history' ? ' active' : ''?>"> - <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?> + <? if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> + + <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?> </a> - <? endif; ?> - <? if ($user = $this->auth()->isLoggedIn()): ?> - <a href="<?=$this->url('myresearch-logout')?>" class="list-group-item"> + + <? endif; ?> + <? if ($user = $this->auth()->isLoggedIn()): ?> + <a href="<?=$this->url('myresearch-logout')?>"> <i class="fa fa-fw fa-sign-out" aria-hidden="true"></i> <?=$this->transEsc("Log Out")?> - </a> - <? endif; ?> + </a> + <? endif; ?> </div> <? if ($this->auth()->isLoggedIn() && $this->auth()->getManager()->supportsPasswordChange()): ?> - <h4><?= $this->transEsc('Preferences') ?></h4> - <div class="list-group"> - <a href="<?=$this->url('myresearch-changepassword') ?>" class="list-group-item<?=$this->active == 'newpassword' ? ' active' : ''?>"> - <i class="fa fa-fw fa-lock" aria-hidden="true"></i> <?=$this->transEsc('Change Password') ?> - </a> + <h4><?=$this->transEsc('Preferences')?></h4> + <div class="myresearch-menu facet-group"> + + <a href="<?=$this->url('myresearch-changepassword')?>"<?=$this->active == 'newpassword' ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-lock" aria-hidden="true"></i> <?=$this->transEsc('Change Password')?> + </a> + </div> <? endif; ?> <? if ($this->userlist()->getMode() !== 'disabled' && $user = $this->auth()->isLoggedIn()): ?> - <h4><?= $this->transEsc('Your Lists') ?></h4> - <div class="list-group"> - <a href="<?=$this->url('myresearch-favorites')?>" class="list-group-item<?=$this->active == 'favorites' ? ' active' : ''?>"> + <h4><?=$this->transEsc('Your Lists')?></h4> + <div class="myresearch-menu facet-group"> + + <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>> <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Your Favorites')?> - </a> + </a> + <? $lists = $user->getLists() ?> <? foreach ($lists as $list): ?> - <a href="<?=$this->url('userList', array('id' => $list['id']))?>" class="list-group-item<?=$this->active == 'list' . $list['id'] ? ' active' : ''?>"> - <?= $this->escapeHtml($list['title']) ?> - <span class="badge"><?=$list->cnt?></span> - </a> - <? endforeach; ?> - <a href="<?=$this->url('editList', array('id'=>'NEW'))?>" class="list-group-item" title="<?= $this->transEsc('Create a List') ?>"> - <i class="fa fa-fw fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Create a List') ?> + <? /* finc: keep icon inside + keep braces in badge!; CK*/ ?> + <a href="<?=$this->url('userList', ['id' => $list['id']])?>"<?=$this->active == 'list' . $list['id'] ? ' class="active"' : ''?>> + <i class="fa fa-fw fa-star-o" aria-hidden="true"></i> <?=$this->escapeHtml($list['title'])?> + <span class="badge">(<?=$list->cnt?>)</span> </a> + + <? endforeach; ?> + <a href="<?=$this->url('editList', ['id' => 'NEW'])?>"> + <i class="fa fa-fw fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Create a List')?> + </a> + </div> <? endif ?> -<? /* This script is finc specific - CK */ ?> +<? /* finc: This script is finc-specific - CK */ ?> <? $script = <<<JS $(document).ready(function () { countables = new Array; @@ -113,5 +138,5 @@ $(document).ready(function () { }); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> +<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET');?> <!-- finc: myresearch - menu - END --> diff --git a/themes/finc/templates/myresearch/mylist.phtml b/themes/finc/templates/myresearch/mylist.phtml index 82eca59191604a7797ab0662f147709303767a87..e6b0196374561eea865038fa427ca26a535709f3 100644 --- a/themes/finc/templates/myresearch/mylist.phtml +++ b/themes/finc/templates/myresearch/mylist.phtml @@ -1,85 +1,93 @@ +<!-- finc: myresearch - mylist --> <? - // Grab list object from search results (if applicable): - $list = $this->results->getListObject(); +// Grab list object from search results (if applicable): +$list = $this->results->getListObject(); - // Set up page title: - $this->headTitle(isset($list) ? $list->title : $this->translate('Favorites')); +// Set up page title: +$this->headTitle(isset($list) ? $list->title : $this->translate('Favorites')); - // Set up breadcrumbs: - $currPage = isset($list) ? 'List' : 'Favorites'; - $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc($currPage) . '</li>'; +// Set up breadcrumbs: +$currPage = isset($list) ? 'List' : 'Favorites'; +$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc($currPage) . '</li>'; - // Load Javascript dependencies into header: - $this->headScript()->appendFile("check_item_statuses.js"); +// Load Javascript dependencies into header: +$this->headScript()->appendFile("check_item_statuses.js"); - // Load Javascript only if list view parameter is NOT full: - if ($this->params->getOptions()->getListViewOption()!="full") { - $this->headScript()->appendFile("record.js"); - $this->headScript()->appendFile("embedded_record.js"); - } +// Load Javascript only if list view parameter is NOT full: +if ($this->params->getOptions()->getListViewOption() != "full") { + $this->headScript()->appendFile("record.js"); + $this->headScript()->appendFile("embedded_record.js"); +} - $recordTotal = $this->results->getResultTotal(); +$recordTotal = $this->results->getResultTotal(); - // Convenience variable: - $account = $this->auth()->getManager(); - $user = $this->auth()->isLoggedIn(); +// Convenience variable: +$account = $this->auth()->getManager(); +$user = $this->auth()->isLoggedIn(); ?> <?=$this->flashmessages()?> -<div class="row"> - <div class="<?=$this->layoutClass('mainbody')?>"> - <div class="clearfix hidden-print"> - <h2 class="pull-left flip"><?=$list ? $this->escapeHtml($list->title) : $this->transEsc("Your Favorites")?></h2> - <div class="pull-right flip"> - <? if (isset($list)): ?> - <? if ($list->editAllowed($account->isLoggedIn())): ?> - <a href="<?=$this->url('editList', array('id' => $list->id)) ?>" class="btn btn-link"><i class="fa fa-edit" aria-hidden="true"></i> <?=$this->transEsc("edit_list")?></a> - <div class="btn-group"> - <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="<?=$this->url('myresearch-deletelist') ?>?listID=<?=urlencode($list->id)?>"> - <i class="fa fa-trash-o" aria-hidden="true"></i> <?=$this->transEsc("delete_list")?> - </a> - <ul class="dropdown-menu"> - <li><a href="<?=$this->url('myresearch-deletelist') ?>?listID=<?=urlencode($list->id)?>&confirm=1"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> - <li><a href="#"><?=$this->transEsc('confirm_dialog_no')?></a></li> - </ul> - </div> - <? endif; ?> - <? elseif ($recordTotal > 0): ?> - <?=$this->transEsc("Showing")?> - <strong><?=$this->localizedNumber($this->results->getStartRecord())?></strong> - <strong><?=$this->localizedNumber($this->results->getEndRecord())?></strong> - <?=$this->transEsc('of')?> <strong><?=$this->localizedNumber($recordTotal)?></strong> +<div class="<?=$this->layoutClass('mainbody')?>"> + <h2><?=$list ? $this->escapeHtml($list->title) : $this->transEsc("Your Favorites")?></h2> + <nav class="search-header hidden-print"> + <div class="search-stats"> + <? if ($recordTotal > 0): ?> + <? + $transParams = [ + '%%start%%' => $this->localizedNumber($this->results->getStartRecord()), + '%%end%%' => $this->localizedNumber($this->results->getEndRecord()), + '%%total%%' => $this->localizedNumber($recordTotal) + ]; + ?> + <?=$this->translate('showing_items_of_html', $transParams);?> + <? endif; ?> + </div> + <div class="search-controls"> + <? if (isset($list)): ?> + <? if ($list->editAllowed($account->isLoggedIn())): ?> + <a href="<?=$this->url('editList', ['id' => $list->id])?>" class="btn btn-link"><i class="fa fa-edit" aria-hidden="true"></i> <?=$this->transEsc("edit_list")?></a> + <div class="btn-group"> + <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="<?=$this->url('myresearch-deletelist')?>?listID=<?=urlencode($list->id)?>"> + <i class="fa fa-trash-o" aria-hidden="true"></i> <?=$this->transEsc("delete_list")?> + </a> + <ul class="dropdown-menu"> + <li><a href="<?=$this->url('myresearch-deletelist')?>?listID=<?=urlencode($list->id)?>&confirm=1"><?=$this->transEsc('confirm_dialog_yes')?></a></li> + <li><a href="#"><?=$this->transEsc('confirm_dialog_no')?></a></li> + </ul> + </div> <? endif; ?> - </div> + <? endif; ?> + <? if ($recordTotal > 0): ?> + <?=$this->render('search/controls/limit.phtml')?> + <?=$this->render('search/controls/sort.phtml')?> + <? endif; ?> </div> + </nav> <? if ($list && !empty($list->description)): ?> <p><?=$this->escapeHtml($list->description)?></p> <? endif; ?> - <? if ($recordTotal > 0): ?> - <div class="resulthead"> - <div class="pull-right flip"> - <?=$this->render('search/controls/limit.phtml')?> - <?=$this->render('search/controls/sort.phtml')?> - </div> - </div> - <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-myresearchbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> - <?=$this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', array('idPrefix' => '', 'list' => isset($list) ? $list : null, 'account' => $this->account))?> - <? foreach ($this->results->getResults() as $i=>$current): ?> - <?=$this->record($current)->getListEntry($list, $user)?> - <? endforeach; ?> - </form> - <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', array('results' => $this->results))?> - <? else: ?> - <p><?=$this->transEsc('You do not have any saved resources')?></p> - <? endif; ?> - </div> + <? if ($recordTotal > 0): ?> + <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-myresearchbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> + <?=$this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', ['idPrefix' => '', 'list' => isset($list) ? $list : null, 'account' => $this->account])?> + <? foreach ($this->results->getResults() as $i => $current): ?> + <?=$this->record($current)->getListEntry($list, $user)?> + <? endforeach; ?> + </form> + <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results])?> + <? else: ?> + <p><?=$this->transEsc('You do not have any saved resources')?></p> + <? endif; ?> +</div> - <div class="<?=$this->layoutClass('sidebar')?>"> - <? if ($user): ?> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", array('active' => isset($list) ? 'list' . $list['id'] : 'favorites'))?> - <? endif; ?> - <? foreach ($this->results->getRecommendations('side') as $current): ?> - <?=$this->recommend($current)?> - <? endforeach; ?> - </div> +<div class="<?=$this->layoutClass('sidebar')?>"> + <? /* nxt-line and related endif are finc-specific #12053, CK*/ ?> + <? if ($user): ?> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => isset($list) ? 'list' . $list['id'] : 'favorites'])?> + <? endif; ?> + <? foreach ($this->results->getRecommendations('side') as $current): ?> + <?=$this->recommend($current)?> + <? endforeach; ?> </div> + +<!-- finc: myresearch - mylist - END --> \ No newline at end of file diff --git a/themes/finc/templates/myresearch/profile.phtml b/themes/finc/templates/myresearch/profile.phtml index 7c79eb7bde6039ac4a7aab58acce3b24fede7c91..64e929fd9cb28f4dd68fd37997eb662a9c020f51 100644 --- a/themes/finc/templates/myresearch/profile.phtml +++ b/themes/finc/templates/myresearch/profile.phtml @@ -1,73 +1,73 @@ <!-- finc: myresearch - profile --> <? - // Set up page title: - $this->headTitle($this->translate('My Profile')); +// Set up page title: +$this->headTitle($this->translate('My Profile')); - // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Profile') . '</li>'; +// Set up breadcrumbs: +$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Profile') . '</li>'; - // Only display home library form if we have multiple pickup locations: - $showHomeLibForm = (isset($this->pickup) && count($this->pickup) > 1); +// Only display home library form if we have multiple pickup locations: +$showHomeLibForm = (isset($this->pickup) && count($this->pickup) > 1); - // Template for use by the renderArray helper: - $arrTemplate = '<tr><th>%%LABEL%%:</th><td> %%VALUE%%</td></tr>'; +// Template for use by the renderArray helper: +$arrTemplate = '<tr><th>%%LABEL%%:</th><td> %%VALUE%%</td></tr>'; ?> -<div class="row"> - <div class="<?=$this->layoutClass('mainbody')?>"> - <h2><?=$this->transEsc('Your Profile')?></h2> - <?=$this->flashmessages();?> +<div class="<?=$this->layoutClass('mainbody')?>"> + <h2><?=$this->transEsc('Your Profile')?></h2> + <?=$this->flashmessages();?> - <?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', array('user' => $this->auth()->isLoggedIn())); ?> + <?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $this->auth()->isLoggedIn()]); ?> - <table class="table table-striped"> + <table class="table table-striped"> + <? + echo $this->renderArray( + $arrTemplate, $this->profile, + [ + $this->transEsc('First Name') => 'firstname', + $this->transEsc('Last Name') => 'lastname' + ] + ); + ?> + <? if ($showHomeLibForm): ?> + <tr> + <th><?=$this->transEsc('Preferred Library')?>:</th> <? - echo $this->renderArray( - $arrTemplate, $this->profile, - array( - $this->transEsc('First Name') => 'firstname', - $this->transEsc('Last Name') => 'lastname' - ) - ); - ?> - <? if ($showHomeLibForm): ?> - <tr><th><?=$this->transEsc('Preferred Library')?>:</th> - <? - $selected = (isset($this->profile['home_library']) && $this->profile['home_library'] != "") - ? $this->profile['home_library'] : $this->defaultPickupLocation - ?> - <td> - <form id="profile_form" class="form-inline" method="post"> - <select id="home_library" name="home_library" class="form-control"> - <? foreach ($this->pickup as $lib): ?> - <option value="<?=$this->escapeHtmlAttr($lib['locationID'])?>"<?=($selected == $lib['locationID'])?' selected="selected"':''?>><?=$this->transEsc('location_' . $lib['locationDisplay'], null, $lib['locationDisplay'])?></option> - <? endforeach; ?> - </select> - <input class="btn btn-default" type="submit" value="<?=$this->transEsc('Save')?>" /> - </form> - </td> + $selected = (isset($this->profile['home_library']) && $this->profile['home_library'] != "") + ? $this->profile['home_library'] : $this->defaultPickupLocation + ?> + <td> + <form id="profile_form" class="form-inline" method="post"> + <select id="home_library" name="home_library" class="form-control"> + <? foreach ($this->pickup as $lib): ?> + <option + value="<?=$this->escapeHtmlAttr($lib['locationID'])?>"<?=($selected == $lib['locationID']) ? ' selected="selected"' : ''?>><?=$this->transEsc('location_' . $lib['locationDisplay'], null, $lib['locationDisplay'])?></option> + <? endforeach; ?> + </select> + <input class="btn btn-default" type="submit" value="<?=$this->transEsc('Save')?>"/> + </form> + </td> <? endif; ?> <? - echo $this->renderArray( - $arrTemplate, $this->profile, - array( - $this->transEsc('Address') . ' 1' => 'address1', - $this->transEsc('Address') . ' 2' => 'address2', - $this->transEsc('Zip') => 'zip', - $this->transEsc('City') => 'city', - $this->transEsc('Country') => 'country', - $this->transEsc('Email') => 'email', - $this->transEsc('Phone Number') => 'phone', - $this->transEsc('Group') => 'group', - $this->transEsc('Expires') => 'expires' - ) - ); + echo $this->renderArray( + $arrTemplate, $this->profile, + [ + $this->transEsc('Address') . ' 1' => 'address1', + $this->transEsc('Address') . ' 2' => 'address2', + $this->transEsc('Zip') => 'zip', + $this->transEsc('City') => 'city', + $this->transEsc('Country') => 'country', + $this->transEsc('Email') => 'email', + $this->transEsc('Phone Number') => 'phone', + $this->transEsc('Group') => 'group', + $this->transEsc('Expires') => 'expiration_date' + ] + ); ?> - </table> - </div> + </table> +</div> - <div class="<?=$this->layoutClass('sidebar')?>"> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", array('active' => 'profile'))?> - </div> +<div class="<?=$this->layoutClass('sidebar')?>"> + <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'profile'])?> </div> <!-- finc: myresearch - profile - END --> diff --git a/themes/finc/templates/record/cart-buttons.phtml b/themes/finc/templates/record/cart-buttons.phtml new file mode 100644 index 0000000000000000000000000000000000000000..0df48f110968b7314c6a92eee3083e708007157e --- /dev/null +++ b/themes/finc/templates/record/cart-buttons.phtml @@ -0,0 +1,26 @@ +<!-- finc: record -cartbuttons --> +<? $cart = $this->cart(); ?> +<? if ($cart->isActive()): ?> + + <? $cartId = $this->source . '|' . $this->id; ?> + <span class="btn-bookbag-toggle" data-cart-id="<?=$this->escapeHtmlAttr($this->id)?>" data-cart-source="<?=$this->escapeHtmlAttr($this->source)?>"> + <a class="cart-add hidden<? if (!$cart->contains($cartId)): ?> correct<? endif ?>"> + <i class="cart-link-icon fa fa-plus" aria-hidden="true" title="<?=$this->transEsc('Add to Book Bag')?>"></i><span class="cart-link-label"><?=$this->transEsc('Add to Book Bag')?></span> + </a> + <a class="cart-remove hidden<? if ($cart->contains($cartId)): ?> correct<? endif ?>"> + <i class="cart-link-icon fa fa-minus-circle" aria-hidden="true" title="<?=$this->transEsc('Remove from Book Bag')?>"></i> <span + class="cart-link-label"><?=$this->transEsc('Remove from Book Bag')?></span> + </a> + <noscript> + <form method="post" name="addForm" action="<?=$this->url('cart-processor')?>"> + <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($cartId)?>"/> + <? if ($cart->contains($cartId)): ?> + <input class="btn btn-default" type="submit" name="delete" value="<?=$this->transEsc('Remove from Book Bag')?>"/> + <? else: ?> + <input class="btn btn-default" type="submit" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/> + <? endif; ?> + </form> + </noscript> + </span> +<? endif; ?> +<!-- finc: record -cartbuttons END --> diff --git a/themes/finc/templates/record/cover.phtml b/themes/finc/templates/record/cover.phtml index 7323374b350b884f9e0951ab8faa3f6468fd4a1d..c87ba27f09dc86142fc76ff254cb082d61fe1df8 100644 --- a/themes/finc/templates/record/cover.phtml +++ b/themes/finc/templates/record/cover.phtml @@ -1,7 +1,7 @@ <!-- finc: record - cover --> <? /* Display thumbnail if appropriate: */ ?> -<? /* Loading covers in lightbox requires .recordcover; .nocover prevents nocover images from loading in lightbox - or can be used to hide the image */ ?> +<? /* If we want to load covers in lightbox use .recordcover; + the class .nocover prevents nocover images from loading in lightbox or can be used to hide the images */ ?> <? if ($cover): ?> <? if ($this->link): ?><a href="<?=$this->escapeHtmlAttr($this->link)?>"><? endif; ?> <img alt="<?=$this->transEsc('Cover Image')?>" <? if ($linkPreview): ?>data-linkpreview="true" <? endif; ?>class="recordcover" src="<?=$this->escapeHtmlAttr($cover); ?>"/> diff --git a/themes/finc/templates/record/pdaform.phtml b/themes/finc/templates/record/pdaform.phtml index a057f989045a3b852743d5061f117f2257d427d9..bba85b10e7ffc59c11f9ac9fb4c0fd3c6fcc6a06 100644 --- a/themes/finc/templates/record/pdaform.phtml +++ b/themes/finc/templates/record/pdaform.phtml @@ -1,4 +1,4 @@ -<!-- finc - record - PDAFORM --> +<!-- finc - record - pdaform --> <? // Set page title. $this->headTitle($this->translate('PDA::Acquisition')); @@ -9,7 +9,7 @@ . '<li class="active">' . $this->transEsc('PDA::Acquisition') . '</li>'; ?> <h2><?=$this->transEsc('PDA::Acquisition') ?>: <span class="title-in-heading"><?=$this->escapeHtml($this->driver->getBreadcrumb())?></span></h2> -<form method="post" name="acquisitionPDAForm" class="form-horizontal" action="<?=$this->recordLink()->getActionUrl($this->driver, 'PDA')?>"> +<form method="post" name="acquisitionPDAForm" action="<?=$this->recordLink()->getActionUrl($this->driver, 'PDA')?>"> <?=$this->flashmessages()?> <p> <?=$this->translate('PDA::pda_order_text')?> @@ -60,4 +60,4 @@ </div> </div> </form> -<!-- finc - record - PDAFORM - END --> +<!-- finc - record - pdaform - END --> diff --git a/themes/finc/templates/record/view.phtml b/themes/finc/templates/record/view.phtml index d1d2950200cd55d2cc130a4977c91d1c0872732f..1e24eb623bdd4ed31274c8153156591ebe948b42 100644 --- a/themes/finc/templates/record/view.phtml +++ b/themes/finc/templates/record/view.phtml @@ -19,9 +19,7 @@ $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink $this->layout()->title = $this->driver->getShortTitle(); ?> -<? /* we use this row to push down content, finc-specific, CK */ ?> -<div class="row"> - <? if (isset($this->scrollData) && ($this->scrollData['previousRecord'] || $this->scrollData['nextRecord'])): ?> + <? if (isset($this->scrollData) && ($this->scrollData['previousRecord'] || $this->scrollData['nextRecord'])): ?> <? /* Pager is identical to pager in collection - view! - CK */ ?> <ul class="pager hidden-print"> <? if ($this->scrollData['previousRecord']): ?> @@ -39,9 +37,12 @@ $this->layout()->title = $this->driver->getShortTitle(); <? endif; ?> <li class="disabled left"><a href="#">« <?=$this->transEsc('Prev')?></a></li> <? endif; ?> - <? /* finc-specific: li + hidden-xs, and li right below CK */ ?> + <? /* finc-specific: li + hidden-xs, and li class="right" below CK */ ?> <li class="hidden-xs"> - #<?=$this->localizedNumber($this->scrollData['currentPosition']) . ' ' . $this->transEsc('of') . ' ' . $this->localizedNumber($this->scrollData['resultTotal']) . ' ' . $this->transEsc('results')?> + <?=$this->transEsc('of_num_results', [ + '%%position%%' => $this->localizedNumber($this->scrollData['currentPosition']), + '%%total%%' => $this->localizedNumber($this->scrollData['resultTotal']) + ]) ?> </li> <? if ($this->scrollData['nextRecord']): ?> <li class="right"> @@ -61,9 +62,9 @@ $this->layout()->title = $this->driver->getShortTitle(); </ul> <? endif; ?> - <? /* finc-specific: Remove toolbar from here and add it to sidebar below - CK */ ?> + <? /* finc-specific: Remove getToolbar from here and add it to sidebar below - CK */ ?> - <div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?> row"> + <div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>"> <div class="<?=$this->layoutClass('mainbody')?>"> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/> @@ -77,7 +78,7 @@ $this->layout()->title = $this->driver->getShortTitle(); <? foreach ($this->tabs as $tab => $obj): ?> <? // add current tab to breadcrumbs if applicable: $desc = $obj->getDescription(); - $tab_classes = array(); + $tab_classes = []; if (0 === strcasecmp($this->activeTab, $tab)) { if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) { $tab_classes[] = 'active'; @@ -122,8 +123,6 @@ $this->layout()->title = $this->driver->getShortTitle(); <? endforeach; ?> </div> </div> - <? /* closing DIV row, finc-specific, CK */ ?> -</div> <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET');?> <!-- finc: record - view - END --> diff --git a/themes/finc/templates/search/advanced/layout.phtml b/themes/finc/templates/search/advanced/layout.phtml index fec216d6d050be502ee5b42950b8f4bfe9ac7221..1bf1f46e7eee11004402fc3fe7feb41aa04e3074 100644 --- a/themes/finc/templates/search/advanced/layout.phtml +++ b/themes/finc/templates/search/advanced/layout.phtml @@ -1,65 +1,65 @@ <!-- finc: search - advanced - layout --> <? - // Set page title. - $this->headTitle($this->translate('Advanced Search')); +// Set page title. +$this->headTitle($this->translate('Advanced Search')); - // Disable top search box -- this page has a special layout. - $this->layout()->searchbox = false; +// Disable top search box -- this page has a special layout. +$this->layout()->searchbox = false; - // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li>'; - $lastSearchLink = $this->searchMemory()->getLastSearchLink($this->transEsc('Search')); - $this->layout()->breadcrumbs .= !empty($lastSearchLink) - ? $lastSearchLink : $this->transEsc('Search'); - $this->layout()->breadcrumbs .= '</li> <li class="active">' . $this->transEsc('Advanced') . '</li>'; +// Set up breadcrumbs: +$this->layout()->breadcrumbs = '<li>'; +$lastSearchLink = $this->searchMemory()->getLastSearchLink($this->transEsc('Search')); +$this->layout()->breadcrumbs .= !empty($lastSearchLink) + ? $lastSearchLink : $this->transEsc('Search'); +$this->layout()->breadcrumbs .= '</li> <li class="active">' . $this->transEsc('Advanced') . '</li>'; - // Set up saved search details: - if (isset($this->saved) && is_object($this->saved)) { - $searchDetails = $this->saved->getParams()->getQuery(); - if ($searchDetails instanceof \VuFindSearch\Query\Query) { - // Not an advanced query -- ignore it. - $searchDetails = $groups = false; - } else { - $groups = $searchDetails->getQueries(); - } - $hasDefaultsApplied = $this->saved->getParams()->hasDefaultsApplied(); - $searchFilters = $this->saved->getParams()->getFilterList(); - $hiddenFilters = $this->saved->getParams()->getHiddenFilters(); +// Set up saved search details: +if (isset($this->saved) && is_object($this->saved)) { + $searchDetails = $this->saved->getParams()->getQuery(); + if ($searchDetails instanceof \VuFindSearch\Query\Query) { + // Not an advanced query -- ignore it. + $searchDetails = $groups = false; } else { - $hasDefaultsApplied = $searchDetails = $searchFilters = $groups = false; - $hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId, true); + $groups = $searchDetails->getQueries(); } + $hasDefaultsApplied = $this->saved->getParams()->hasDefaultsApplied(); + $searchFilters = $this->saved->getParams()->getFilterList(); + $hiddenFilters = $this->saved->getParams()->getHiddenFilters(); +} else { + $hasDefaultsApplied = $searchDetails = $searchFilters = $groups = false; + $hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId, true); +} - // Step 1: Load the javascript - $this->headScript()->appendFile( - isset($this->advancedSearchJsOverride) ? $this->advancedSearchJsOverride : 'advanced_search.js' - ); - // Step 2: Build the page - $this->headScript()->appendScript( - $this->partial( - isset($this->buildPageOverride) ? $this->buildPageOverride : 'search/advanced/build_page.phtml', - ['options' => $this->options, 'searchDetails' => $searchDetails] - ) - ); +// Step 1: Load the javascript +$this->headScript()->appendFile( + isset($this->advancedSearchJsOverride) ? $this->advancedSearchJsOverride : 'advanced_search.js' +); +// Step 2: Build the page +$this->headScript()->appendScript( + $this->partial( + isset($this->buildPageOverride) ? $this->buildPageOverride : 'search/advanced/build_page.phtml', + ['options' => $this->options, 'searchDetails' => $searchDetails] + ) +); - // Collect previous search queries - $setSearchGroups = []; - $setGroupCount = 0; - $setQueries = []; - if (isset($searchDetails) && is_object($searchDetails)) { - foreach ($searchDetails->getQueries() as $group=>$searchGroup) { - $setSearchGroups[$group] = $searchGroup->isNegated() ? 'NOT' : $searchGroup->getOperator(); - if ($setGroupCount < $group) { - $setGroupCount = $group; - } - if (!isset($setQueries[$group])) { - $setQueries[$group] = []; - } - foreach ($searchGroup->getQueries() as $search) { - $setQueries[$group][] = $search; - } +// Collect previous search queries +$setSearchGroups = []; +$setGroupCount = 0; +$setQueries = []; +if (isset($searchDetails) && is_object($searchDetails)) { + foreach ($searchDetails->getQueries() as $group=>$searchGroup) { + $setSearchGroups[$group] = $searchGroup->isNegated() ? 'NOT' : $searchGroup->getOperator(); + if ($setGroupCount < $group) { + $setGroupCount = $group; + } + if (!isset($setQueries[$group])) { + $setQueries[$group] = []; + } + foreach ($searchGroup->getQueries() as $search) { + $setQueries[$group][] = $search; } } +} ?> <?=$this->flashmessages()?> @@ -70,138 +70,120 @@ <input type="hidden" name="hiddenFilters[]" value="<?=$this->escapeHtmlAttr($key) . ':' . $this->escapeHtmlAttr($value)?>" /> <? endforeach; ?> <? endforeach; ?> - <div class="row"> - <? /* finc: use xs-cols to improve mobile view, CK */ ?> - <div class="col-xs-11 <?=$this->layoutClass('mainbody')?>"> - <? $lastSort = $this->searchMemory()->getLastSort($this->searchClassId); ?> - <? if (!empty($lastSort)): ?> - <input type="hidden" name="sort" value="<?=$this->escapeHtmlAttr($lastSort)?>" /> - <? endif; ?> - <div class="clearfix"> - <h2 class="pull-left flip"><?=$this->transEsc('Advanced Search')?></h2> - <div id="groupJoin" class="form-inline pull-right flip"> - <label for="groupJoinOptions"><?=$this->transEsc("search_match")?>:</label> - <select id="groupJoinOptions" name="join" class="form-control"> - <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> - </div> + <div class="<?=$this->layoutClass('mainbody')?>"> + <? $lastSort = $this->searchMemory()->getLastSort($this->searchClassId); ?> + <? if (!empty($lastSort)): ?> + <input type="hidden" name="sort" value="<?=$this->escapeHtmlAttr($lastSort)?>" /> + <? endif; ?> + <div class="clearfix"> + <h2 class="pull-left flip"><?=$this->transEsc('Advanced Search')?></h2> + <div id="groupJoin" class="form-inline pull-right flip"> + <label for="groupJoinOptions"><?=$this->transEsc("search_match")?>:</label> + <select id="groupJoinOptions" name="join" class="form-control"> + <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> </div> - <? /* An empty div. This is the target for the javascript that builds this screen */ ?> - <span id="groupPlaceHolder" class="hidden"> - <i class="fa fa-plus" aria-hidden="true"></i> <a href="#" onClick="addGroup()"><?= $this->transEsc('add_search_group') ?></a> - </span> - <? /* fallback to a fixed set of search groups/fields if JavaScript is turned off */ ?> - <div class="no-js"> - <? if(!empty($this->formOverride)): ?> - <?=$this->formOverride ?> - <? else: ?> - <? for($group=0 ; $group<3 || $group<=$setGroupCount ; $group++): ?> - <? if($group == 0): ?> - <div id="new_group_template"> - <? endif; ?> - <div id="group<?=$group ?>" class="group row"> - <a href="javascript:void(0);" class="group-close hidden" title="<?=$this->transEsc("del_search")?>">×</a> - <div class="col-sm-9"> - <div class="row"> - <div class="col-sm-12"> - <label class="help-block"><?=$this->transEsc("adv_search_label")?>:</label> - </div> - <div class="col-sm-12"> - <? for($search=0 ; $search<3 || (isset($setQueries[$group]) && $search<count($setQueries[$group])) ; $search++): ?> - <? if($group == 0 && $search == 0): ?> - <div id="new_search_template"> - <? endif; ?> - <div id="search<?=$group.'_'.$search ?>" class="search"> - <div class="row"> - <? /* finc: use xs-cols to improve mobile view, CK */ ?> - <div class="col-xs-11 col-sm-7 left no-gutter-r gutter-l"> - <input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group.'_'.$search ?>" class="form-control" type="text"<?if(isset($setQueries[$group][$search])):?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?endif;?>> - </div> - <? /* finc: use xs-cols to improve mobile view, CK */ ?> - <div class="col-xs-10 col-sm-4 middle"> - <select class="type form-control" name="type<?=$group ?>[]"> - <? foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?> - <option value="<?=$this->escapeHtml($searchVal)?>"<?if(isset($setQueries[$group][$search]) && $searchVal == $setQueries[$group][$search]->getHandler()):?> selected<?endif;?>><?=$this->transEsc($searchDesc)?></option> - <? endforeach; ?> - </select> - </div> - <div class="col-sm-1 close hidden"> - <? /* finc: use tooltip, CK */ ?> - <a class="help-block" href="javascript:void(0);" data-toggle="tooltip" title="<?=$this->transEsc("Delete")?>">×</a> - </div> - </div> - </div> - <? if($group == 0 && $search == 0): ?> - </div> - <i class="fa fa-plus search_place_holder hidden" aria-hidden="true"></i> <a href="#" class="add_search_link hidden"><?=$this->transEsc("add_search")?></a> - <? endif; ?> - <? endfor; ?> - </div> - </div> - </div> - <div class="col-sm-3 match"> - <div class="col-sm-12"> - <label class="search_bool"><?=$this->transEsc("search_match")?>: </label> + </div> + <? /* finc: keep icon inside link for consistent functionality */ ?> + <span id="groupPlaceHolder" class="hidden"> + <a href="javascript:void(0);" onClick="addGroup();return false"><i class="fa fa-plus" aria-hidden="true"> </i> <?= $this->transEsc('add_search_group') ?></a> + </span> + <? /* fallback to a fixed set of search groups/fields if JavaScript is turned off */ ?> + <div class="no-js"> + <? if(!empty($this->formOverride)): ?> + <?=$this->formOverride ?> + <? else: ?> + <? for($group=0 ; $group<3 || $group<=$setGroupCount ; $group++): ?> + <? if($group == 0): ?> + <div id="new_group_template"> + <? endif; ?> + <div id="group<?=$group ?>" class="adv-group"> + <div class="adv-group-terms"> + <label class="adv-group-label"><?=$this->transEsc("adv_search_label")?>:</label> + <? for($search=0 ; $search<3 || (isset($setQueries[$group]) && $search<count($setQueries[$group])) ; $search++): ?> + <? if($group == 0 && $search == 0): ?> + <div id="new_search_template"> + <? endif; ?> + <div id="search<?=$group.'_'.$search ?>" class="adv-search"> + <input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group.'_'.$search ?>" class="adv-term-input form-control" type="text"<?if(isset($setQueries[$group][$search])):?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?endif;?>> + <select class="adv-term-type form-control" name="type<?=$group ?>[]"> + <? foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?> + <option value="<?=$this->escapeHtml($searchVal)?>"<?if(isset($setQueries[$group][$search]) && $searchVal == $setQueries[$group][$search]->getHandler()):?> selected<?endif;?>><?=$this->transEsc($searchDesc)?></option> + <? endforeach; ?> + </select> + <a href="javascript:void(0);" class="adv-term-remove hidden">×</a> </div> - <select name="bool<?=$group ?>[]" id="search_bool<?=$group ?>" class="form-control"> - <option value="AND"<? if(isset($setSearchGroups[$group]) && 'AND' == $setSearchGroups[$group]):?> selected<?endif;?>><?=$this->transEsc("search_AND")?></option> - <option value="OR"<? if(isset($setSearchGroups[$group]) && 'OR' == $setSearchGroups[$group]):?> selected<?endif;?>><?=$this->transEsc("search_OR")?></option> - <option value="NOT"<? if(isset($setSearchGroups[$group]) && 'NOT' == $setSearchGroups[$group]):?> selected<?endif;?>><?=$this->transEsc("search_NOT")?></option> - </select> - </div> + <? if($group == 0 && $search == 0): ?> + </div> + <? /* finc: moving entire original icon tag inside link WILL BUST removal-button functionality! + (As this will also 'shift search_place_holder') Therefore Keep 'search_place_holder' separate and move icon only ! + */ ?> + <span class="float-left"> + <span class="search_place_holder hidden" aria-hidden="true"></span> + <a href="javascript:void(0);" class="add_search_link hidden"> + <i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc("add_search")?></a> + </span> + <? endif; ?> + <? endfor; ?> </div> - <? if($group == 0): ?> - </div> - <? endif; ?> - <? endfor; ?> - <? endif; ?> - </div> - - <div class="clearfix"> - <input class="btn btn-transparent" type="button" value="<?= $this->transEsc('Clear')?>"> - <input class="btn btn-primary pull-right flip" type="submit" value="<?= $this->transEsc('Find')?>"> - </div> - - <? /* This is where the limit to controls come in - CK */ ?> - <? if (isset($this->extraAdvancedControls)): ?> - <?=$this->extraAdvancedControls ?> - <? /* finc: use gutter-top to improve spacing, CK */ ?> - <div class="clearfix gutter-top"> - <input class="btn btn-transparent" type="button" value="<?= $this->transEsc('Clear')?>"> - <input class="btn btn-primary pull-right flip" type="submit" value="<?= $this->transEsc('Find')?>"> - </div> + <div class="adv-group-match"> + <label class="search_bool"><?=$this->transEsc("search_match")?>: </label> + <select name="bool<?=$group ?>[]" id="search_bool<?=$group ?>" class="form-control"> + <option value="AND"<? if(isset($setSearchGroups[$group]) && 'AND' == $setSearchGroups[$group]):?> selected<?endif;?>><?=$this->transEsc("search_AND")?></option> + <option value="OR"<? if(isset($setSearchGroups[$group]) && 'OR' == $setSearchGroups[$group]):?> selected<?endif;?>><?=$this->transEsc("search_OR")?></option> + <option value="NOT"<? if(isset($setSearchGroups[$group]) && 'NOT' == $setSearchGroups[$group]):?> selected<?endif;?>><?=$this->transEsc("search_NOT")?></option> + </select> + </div> + <a href="javascript:void(0);" class="adv-group-close hidden"><i class="fa fa-close"></i> <?=$this->transEsc("del_search")?></a> + </div> + <? if($group == 0): ?> + </div> + <? endif; ?> + <? endfor; ?> <? endif; ?> </div> + <? /* finc: introduce 'fnd-btn'-class to swap submit and clear buttons for consistency */ ?> + <div class="adv-submit"> + <input class="clear-btn btn btn-transparent" type="button" value="<?=$this->transEsc('Clear')?>"> + <input class="fnd-btn btn btn-primary" type="submit" value="<?= $this->transEsc('Find')?>"> + </div> + <? if (isset($this->extraAdvancedControls)): ?> + <div class="clearfix"> + <?=$this->extraAdvancedControls ?> + </div> + <div class="adv-submit margin-t"> + <input class="clear-btn btn btn-transparent" type="button" value="<?=$this->transEsc('Clear')?>"> + <input class="fnd-btn btn btn-primary" type="submit" value="<?= $this->transEsc('Find')?>"> + </div> + <? endif; ?> + </div> - <div class="<?=$this->layoutClass('sidebar')?>"> - <? if ($hasDefaultsApplied): ?> - <input type="hidden" name="dfApplied" value="1" /> - <? endif ?> - <? if (!empty($searchFilters)): ?> - <h4><?=$this->transEsc("adv_search_filters")?></h4> - <div class="list-group"> - <label class="list-group-item checkbox"> - <input type="checkbox" checked="checked" class="checkbox-select-all"/> - <?=$this->transEsc("adv_search_select_all")?> - </label> - </div> - <? foreach ($searchFilters as $field => $data): ?> - <div class="list-group"> - <div class="list-group-item title"><?=$this->transEsc($field)?></div> - <? foreach ($data as $value): ?> - <label class="list-group-item checkbox"><input class="checkbox-select-item" type="checkbox" checked="checked" name="filter[]" value='<?=$this->escapeHtmlAttr($value['field'])?>:"<?=$this->escapeHtmlAttr($value['value'])?>"' /> <?=$this->escapeHtml($value['displayText'])?></label> - <? endforeach; ?> - </div> - <? endforeach; ?> - <? endif; ?> - <div class="sidegroup"> - <h4><?=$this->transEsc("Search Tips")?></h4> - <div class="list-group"> - <a class="list-group-item help-link" data-lightbox href="<?=$this->url('help-home')?>?topic=advsearch&_=<?=time() ?>"><?=$this->transEsc("Help with Advanced Search")?></a> - <a class="list-group-item help-link" data-lightbox href="<?=$this->url('help-home')?>?topic=search&_=<?=time() ?>"><?=$this->transEsc("Help with Search Operators")?></a> - </div> + <div class="<?=$this->layoutClass('sidebar')?>"> + <? if ($hasDefaultsApplied): ?> + <input type="hidden" name="dfApplied" value="1" /> + <? endif ?> + <? if (!empty($searchFilters)): ?> + <h4><?=$this->transEsc("adv_search_filters")?></h4> + <div class="facet-group"> + <label class="checkbox"> + <input type="checkbox" checked="checked" class="checkbox-select-all"/> + <?=$this->transEsc("adv_search_select_all")?> + </label> </div> + <? foreach ($searchFilters as $field => $data): ?> + <div class="facet-group"> + <div class="title"><?=$this->transEsc($field)?></div> + <? foreach ($data as $value): ?> + <label class="facet checkbox"><input class="checkbox-select-item" type="checkbox" checked="checked" name="filter[]" value='<?=$this->escapeHtmlAttr($value['field'])?>:"<?=$this->escapeHtmlAttr($value['value'])?>"' /> <?=$this->escapeHtml($value['displayText'])?></label> + <? endforeach; ?> + </div> + <? endforeach; ?> + <? endif; ?> + <h4><?=$this->transEsc("Search Tips")?></h4> + <div class="facet-group"> + <a class="facet help-link" data-lightbox href="<?=$this->url('help-home')?>?topic=advsearch&_=<?=time() ?>"><?=$this->transEsc("Help with Advanced Search")?></a> + <a class="facet help-link" data-lightbox href="<?=$this->url('help-home')?>?topic=search&_=<?=time() ?>"><?=$this->transEsc("Help with Search Operators")?></a> </div> </div> </form> diff --git a/themes/finc/templates/search/advanced/ranges.phtml b/themes/finc/templates/search/advanced/ranges.phtml deleted file mode 100644 index 5aa6053580aa55475e70b3bdfb48d09c8b77bbe3..0000000000000000000000000000000000000000 --- a/themes/finc/templates/search/advanced/ranges.phtml +++ /dev/null @@ -1,79 +0,0 @@ -<!-- finc: search - advanced - ranges --> -<? /* There is another slider in recommend - sidefacets but both should be identical - CK */ ?> -<? if (isset($this->ranges) && !empty($this->ranges)): ?> - <? $params = $this->searchParams($this->searchClassId); - $params->activateAllFacets(); ?> - <? foreach ($this->ranges as $current): $escField = $this->escapeHtmlAttr($current['field']); ?> - <? $extraInputAttribs = ($current['type'] == 'date') ? 'maxlength="4" ' : ''; ?> - <? /* use xs-cols to improve mobile view, finc-specific, CK */ ?> - <fieldset class="col-xs-11 col-sm-4"> - <legend><?= $this->transEsc($params->getFacetLabel($current['field'])) ?></legend> - <input type="hidden" name="<?= $this->escapeHtmlAttr($current['type']) ?>range[]" value="<?= $escField ?>"/> - <div class="row"> - <div class="col-sm-6"> - <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]):''?>" class="form-control" <?=$extraInputAttribs?>/> - </div> - <div class="col-sm-6"> - <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]):''?>" class="form-control" <?=$extraInputAttribs?>/> - </div> - </div> - <? if ($current['type'] == 'date'): ?> - <div class="slider-container"> - <input type="text" id="<?= $escField ?><?= $this->escapeHtmlAttr($current['type']) ?>Slider"> - </div> - <? - $this->headScript()->appendFile('vendor/bootstrap-slider.js'); - $this->headLink()->appendStylesheet('vendor/bootstrap-slider.min.css'); - $min = !empty($current['values'][0]) ? min($current['values'][0], 1400) : 1400; - $future = date('Y', time() + 31536000); - $max = !empty($current['values'][1]) ? max($future, $current['values'][1]) : $future; - $low = !empty($current['values'][0]) ? $current['values'][0] : $min; - $high = !empty($current['values'][1]) ? $current['values'][1] : $max; - $min = intval($min); - $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() { - var fillTexts = function() { - var v = {$escField}dateSlider.getValue(); - $('#${escField}from').val(v[0]); - $('#${escField}to').val(v[1]); - }; - var {$escField}dateSlider = $('#{$escField}dateSlider') - .slider({ - 'min':{$min}, - 'max':{$max}, - 'handle':"square", - 'tooltip':"hide", - 'value':[{$low},{$high}], - 'reversed': {$reversed} - }) - .on('change', fillTexts) - .data('slider'); - {$init} -}); -// finc-specific: Update slider handle position with input date; CK -$('#{$escField}from, #{$escField}to').change(function () { - var from = Number($('#{$escField}from').val()); - var to = Number($('#{$escField}to').val()); - if (from <= 0) { - from = {$min}; - } - if (to <= 0) { - to = {$max}; - } - $('#{$escField}dateSlider').slider('setValue', [from, to], true); -}); -JS; - ?> - <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> - </fieldset> - <? endif; ?> - <? endforeach; ?> -<? endif; ?> -<!-- finc: search - advanced - ranges - END --> diff --git a/themes/finc/templates/search/advanced/solr.phtml b/themes/finc/templates/search/advanced/solr.phtml index 0de570c4802d9ebc263e3d026e245ba3b3fbe28b..82bad4aee83620f6bfe2e823468692c9e711aae6 100644 --- a/themes/finc/templates/search/advanced/solr.phtml +++ b/themes/finc/templates/search/advanced/solr.phtml @@ -1,59 +1,59 @@ <!-- finc: search - advanced - solr --> <? if (!empty($this->facetList) || !empty($this->checkboxFacets)): ?> - <div class="row"> - <? /* use xs-cols to improve mobile view, finc-specific, CK */ ?> - <fieldset class="col-xs-12 col-sm-12"> - <legend><?=$this->transEsc('Limit To')?></legend> - <? if (!empty($this->checkboxFacets)): ?> - <?=$this->render('search/advanced/checkbox-filters.phtml')?> - <? endif; ?> - <? /* finc: we need the limiter-boxes class to set select height to auto + remove bg image - CK */ ?> - <div class="row limiter-boxes"> - <? foreach ($this->facetList as $field => $list): ?> - <div class="col-sm-<?=floor(12/count($this->facetList)) ?>"> - <label for="limit_<?=$this->escapeHtmlAttr(str_replace(' ', '', $field))?>"><?=$this->transEsc($list['label'])?>:</label> - <select class="form-control" id="limit_<?=$this->escapeHtmlAttr(str_replace(' ', '', $field))?>" name="filter[]" multiple="multiple" size="10"> - <? if (is_array($this->hierarchicalFacets) && in_array($field, $this->hierarchicalFacets)): ?> - <? foreach ($list['list'] as $value): ?> - <? $display = str_pad('', 4 * $value['level'] * 6, ' ', STR_PAD_LEFT) . $this->escapeHtml($value['displayText']); ?> - <option value="<?=$this->escapeHtmlAttr(($value['operator'] == 'OR' ? '~' : '') . $field . ':"' . $value['value'] . '"')?>"<?=(isset($value['selected']) && $value['selected'])?' selected="selected"':''?>><?=$display?></option> - <? endforeach; ?> - <? else: ?> - <? - // Sort the current facet list alphabetically; we'll use this data - // along with the foreach below to display facet options in the - // correct order. - $sorted = array(); - foreach ($list['list'] as $i => $value) { - if (!empty($value['displayText'])) { - $sorted[$i] = $value['displayText']; - } + <fieldset class="solr-facets"> + <legend><?=$this->transEsc('Limit To')?></legend> + <? if (!empty($this->checkboxFacets)): ?> + <?=$this->render('search/advanced/checkbox-filters.phtml')?> + <? endif; ?> + <? /* finc: we need the limiter-boxes class to set select height to auto + remove bg image - CK */ ?> + <div class="solr-facet-container limiter-boxes"> + <? foreach ($this->facetList as $field => $list): ?> + <div class="solr-adv-facet"> + <label for="limit_<?=$this->escapeHtmlAttr(str_replace(' ', '', $field))?>"><?=$this->transEsc($list['label'])?>:</label> + <select class="form-control" id="limit_<?=$this->escapeHtmlAttr(str_replace(' ', '', $field))?>" name="filter[]" multiple="multiple" size="10"> + <? if (is_array($this->hierarchicalFacets) && in_array($field, $this->hierarchicalFacets)): ?> + <? foreach ($list['list'] as $value): ?> + <? $display = str_pad('', 4 * $value['level'] * 6, ' ', STR_PAD_LEFT) . $this->escapeHtml($value['displayText']); ?> + <option + value="<?=$this->escapeHtmlAttr(($value['operator'] == 'OR' ? '~' : '') . $field . ':"' . $value['value'] . '"')?>"<?=(isset($value['selected']) && $value['selected']) ? ' selected="selected"' : ''?>><?=$display?></option> + <? endforeach; ?> + <? else: ?> + <? + // Sort the current facet list alphabetically; we'll use this data + // along with the foreach below to display facet options in the + // correct order. + $sorted = array(); + foreach ($list['list'] as $i => $value) { + if (!empty($value['displayText'])) { + $sorted[$i] = $value['displayText']; } - natcasesort($sorted); - ?> - <? foreach ($sorted as $i => $display): ?> - <? $value = $list['list'][$i]; ?> - <option value="<?=$this->escapeHtmlAttr(($value['operator'] == 'OR' ? '~' : '') . $field . ':"' . $value['value'] . '"')?>"<?=(isset($value['selected']) && $value['selected'])?' selected="selected"':''?>><?=$this->escapeHtml($display)?></option> - <? endforeach; ?> - <? endif; ?> - </select> - </div> - <? endforeach; ?> - </div> - </fieldset> - </div> -<? endif; ?> -<div class="row"> - <? if (isset($this->illustratedLimit)): ?> - <fieldset class="col-sm-4"> - <legend><?=$this->transEsc("Illustrated")?>:</legend> - <? foreach ($this->illustratedLimit as $current): ?> - <input id="illustrated_<?=$this->escapeHtmlAttr($current['value'])?>" type="radio" name="illustration" value="<?=$this->escapeHtmlAttr($current['value'])?>"<?=$current['selected']?' checked="checked"':''?>/> - <label for="illustrated_<?=$this->escapeHtmlAttr($current['value'])?>"><?=$this->transEsc($current['text'])?></label><br/> + } + natcasesort($sorted); + ?> + <? foreach ($sorted as $i => $display): ?> + <? $value = $list['list'][$i]; ?> + <option + value="<?=$this->escapeHtmlAttr(($value['operator'] == 'OR' ? '~' : '') . $field . ':"' . $value['value'] . '"')?>"<?=(isset($value['selected']) && $value['selected']) ? ' selected="selected"' : ''?>><?=$this->escapeHtml($display)?></option> + <? endforeach; ?> + <? endif; ?> + </select> + </div> <? endforeach; ?> - </fieldset> - <? endif; ?> - <?=$this->render('search/advanced/limit.phtml')?> - <?=$this->render('search/advanced/ranges.phtml')?> -</div> + </div> + </fieldset> + +<? endif; ?> + +<? if (isset($this->illustratedLimit)): ?> + <fieldset class="solr"> + <legend><?=$this->transEsc("Illustrated")?>:</legend> + <? foreach ($this->illustratedLimit as $current): ?> + <input id="illustrated_<?=$this->escapeHtmlAttr($current['value'])?>" type="radio" name="illustration" + value="<?=$this->escapeHtmlAttr($current['value'])?>"<?=$current['selected'] ? ' checked="checked"' : ''?>/> + <label for="illustrated_<?=$this->escapeHtmlAttr($current['value'])?>"><?=$this->transEsc($current['text'])?></label><br/> + <? endforeach; ?> + </fieldset> +<? endif; ?> +<?=$this->render('search/advanced/limit.phtml')?> +<?=$this->render('search/advanced/ranges.phtml')?> <!-- finc: search - advanced - solr - END --> diff --git a/themes/finc/templates/search/bulk-action-buttons.phtml b/themes/finc/templates/search/bulk-action-buttons.phtml index 95c1c076baa57428637c5437f1f0129a769fa5c3..367fa90c12779fe53e6a74b32b7a997a807be9aa 100644 --- a/themes/finc/templates/search/bulk-action-buttons.phtml +++ b/themes/finc/templates/search/bulk-action-buttons.phtml @@ -1,26 +1,28 @@ -<? if((isset($this->showBulkOptions) && $this->showBulkOptions) - || (isset($this->showCartControls) && $this->showCartControls)): ?> +<!-- finc: search - bulk-action-buttons --> +<? if (isset($this->showCheckboxes) && $this->showCheckboxes): ?> <div class="bulkActionButtons hidden-print"> - <div class="checkbox"> - <label> - <input type="checkbox" class="checkbox-select-all" name="selectAll" id="<?=$this->idPrefix?>addFormCheckboxSelectAll"/> <?=$this->transEsc('select_page')?> + <div class="bulk-checkbox"> + <input type="checkbox" class="checkbox-select-all" name="selectAll" id="<?=$this->idPrefix?>addFormCheckboxSelectAll"<?if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<? endif; ?>/> + <label for="<?=$this->idPrefix?>addFormCheckboxSelectAll"> + <?=$this->transEsc('select_page')?> | <?=$this->transEsc('with_selected')?>: </label> </div> <div class="btn-group"> <? if (isset($this->showBulkOptions) && $this->showBulkOptions): ?> - <input id="ribbon-email" class="btn btn-transparent" type="submit" name="email" title="<?=$this->transEsc('bookbag_email_selected')?>" value="<?=$this->transEsc('Email')?>"/> + <input id="ribbon-email" class="btn btn-transparent" type="submit" name="email" title="<?=$this->transEsc('bookbag_email_selected')?>" value="<?=$this->transEsc('Email')?>"<?if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<? endif; ?>/> <? $exportOptions = $this->export()->getBulkOptions(); if (count($exportOptions) > 0): ?> - <input id="ribbon-export" class="btn btn-transparent" type="submit" name="export" title="<?=$this->transEsc('bookbag_export_selected')?>" value="<?=$this->transEsc('Export')?>"/> + <input id="ribbon-export" class="btn btn-transparent" type="submit" name="export" title="<?=$this->transEsc('bookbag_export_selected')?>" value="<?=$this->transEsc('Export')?>"<?if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<? endif; ?>/> <? endif; ?> - <input id="ribbon-print" class="btn btn-transparent" type="submit" name="print" title="<?=$this->transEsc('bookbag_print_selected')?>" value="<?=$this->transEsc('Print')?>"/> + <input id="ribbon-print" class="btn btn-transparent" type="submit" name="print" title="<?=$this->transEsc('bookbag_print_selected')?>" value="<?=$this->transEsc('Print')?>"<?if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<? endif; ?>/> <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <input id="ribbon-save" class="btn btn-transparent" type="submit" name="saveCart" title="<?=$this->transEsc('bookbag_save_selected')?>" value="<?=$this->transEsc('Save')?>"/> + <input id="ribbon-save" class="btn btn-transparent" type="submit" name="saveCart" title="<?=$this->transEsc('bookbag_save_selected')?>" value="<?=$this->transEsc('Save')?>"<?if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<? endif; ?>/> <? endif; ?> <? endif; ?> <? if (isset($this->showCartControls) && $this->showCartControls): ?> - <input id="<?=$this->idPrefix?>updateCart" type="submit" class="btn btn-transparent" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"/> + <input id="<?=$this->idPrefix?>updateCart" type="submit" class="btn btn-transparent" name="add" value="<?=$this->transEsc('Add to Book Bag')?>"<?if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<? endif; ?>/> <? endif; ?> </div> </div> <? endif; ?> +<!-- finc: search - bulk-action-buttons - END --> \ No newline at end of file diff --git a/themes/finc/templates/search/controls/limit.phtml b/themes/finc/templates/search/controls/limit.phtml index 27a2a780c9ca9ad94b41f02892e80bdb24a9c2fb..03befccf3df28b2ab0fdd1eb9633517988b2c1c6 100644 --- a/themes/finc/templates/search/controls/limit.phtml +++ b/themes/finc/templates/search/controls/limit.phtml @@ -1,4 +1,4 @@ -<!-- search - controls - LIMIT --> +<!-- finc: search - controls - limit --> <? $limitList = $this->params->getLimitList(); ?> <? if (count($limitList) > 1): ?> <? /* finc: DO NOT use 'form-inline' as it messes up the select box */ ?> @@ -13,4 +13,4 @@ <noscript><input type="submit" value="<?=$this->transEsc("Set")?>" /></noscript> </form> <? endif; ?> -<!-- search - controls - LIMIT - END --> +<!-- finc: search - controls - limit - END --> diff --git a/themes/finc/templates/search/controls/sort.phtml b/themes/finc/templates/search/controls/sort.phtml index d95e70000c4e3677779a807014f5202b34b0587f..c007e3e5a7c74012cae8f5d02aa0fcb87a01eb37 100644 --- a/themes/finc/templates/search/controls/sort.phtml +++ b/themes/finc/templates/search/controls/sort.phtml @@ -1,7 +1,7 @@ -<!-- finc: search - controls - SORT --> +<!-- finc: search - controls - sort --> <? $list = $this->params->getSortList(); if (!empty($list)): ?> <? /* finc: DO NOT use 'form-inline' as it messes up the select box */ ?> - <form class="sort text-right" action="<?=$this->currentPath()?>" method="get" name="sort"> + <form class="search-sort text-right" action="<?=$this->currentPath()?>" method="get" name="sort"> <?=$this->results->getUrlQuery()->asHiddenFields(array('sort' => '/.*/'));?> <label for="sort_options_1"><?=$this->transEsc('Sort')?></label> <? /* finc: DO NOT use 'form-control' as it messes up the select box */ ?> @@ -13,4 +13,4 @@ <noscript><input type="submit" class="btn btn-primary" value="<?=$this->transEsc("Set")?>" /></noscript> </form> <? endif; ?> -<!-- search - controls - SORT - END --> +<!-- finc: search - controls - sort - END --> diff --git a/themes/finc/templates/search/home.phtml b/themes/finc/templates/search/home.phtml index c8db769491fac593273086ff326d560469d2b627..7c0e5f69a12dce82a523763bbb3e49e084023954 100644 --- a/themes/finc/templates/search/home.phtml +++ b/themes/finc/templates/search/home.phtml @@ -3,8 +3,8 @@ // Set page title. $this->headTitle($this->translate('Search Home')); -// Disable top search box -- this page has a special layout. -$this->layout()->searchbox = false; +// finc: disable top search box here if you want the old look, see also below +// $this->layout()->searchbox = false; // Set default value if necessary: if (!isset($this->searchClassId)) { @@ -30,23 +30,22 @@ $this->layout()->breadcrumbs = false; data: {'offlineModeMsg':'ils_offline_home_message'}, url: VuFind.path + '/AJAX/JSON?method=getIlsStatus', success: function(response) { - $('.searchHomeContent').append(response.data); + $('.searchHomeContent').prepend(response.data); } }); }); JS; ?> <? /* finc-specific: #7187 - END */ ?> - <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $ilsStatusScript, 'SET'); ?> - <? /* finc: don't use role='search' here but in searchbox template */ ?> - <div class="well well-lg clearfix"> - <?=$this->context($this)->renderInContext("search/searchbox.phtml", ['ignoreHiddenFilterMemory' => true])?> - </div> + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $ilsStatusScript, 'SET');?> + + <? /* finc: Activate search box here if you want the old look -- otherwise we keep the consisten look with searchbox in header */ ?> + <? /* =$this->context($this)->renderInContext("search/searchbox.phtml", ['ignoreHiddenFilterMemory' => true])?> + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$("#searchForm_lookfor").focus();', 'SET'); */ ?> </div> -<? $facetList = is_object($this->results) ? $this->results->getFacetList() : array(); ?> <? if (isset($facetList) && is_array($facetList)): ?> - <div class="row"> + <div class="search-home-facets"> <? foreach ($facetList as $field => $details): ?> <? if (isset($this->hierarchicalFacets) && in_array($field, $this->hierarchicalFacets)): ?> <? $this->headScript()->appendFile('vendor/jsTree/jstree.min.js'); ?> @@ -59,36 +58,38 @@ $(document).ready(function() { }); JS; ?> - <?= $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> - <div class="facet <?= $field == 'callnumber-first' ? 'col-sm-6' : 'col-sm-3' ?>"> - <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) ?>" + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET');?> + <div class="home-facet <?=$this->escapeHtmlAttr($field)?>"> + <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)?>" data-exclude="0" data-operator="AND" - data-exclude-title="<?= $this->transEsc('exclude_facet') ?>" + data-exclude-title="<?=$this->transEsc('exclude_facet')?>" data-sort="all"> </div> </div> <noscript> <? endif; ?> <? $sortedList = $this->sortFacetList($this->results, $field, $details['list'], $basicSearch); ?> - <? /* finc: keep .browsesuggest to prevent torn-apart look if only 2 cols are present - CK */ ?> - <div class="<?= $field == 'callnumber-first' ? 'col-sm-6' : 'col-sm-3' ?> browsesuggest"> - <h2><?= $this->transEsc('home_browse') . ' ' . $this->transEsc($details['label']) ?></h2> - <div class="row"> - <ul class="list-unstyled <?=$field == "callnumber-first" ? 'col-sm-6' : 'col-sm-12' ?>"> + <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"> <? /* Special case: two columns for LC call numbers... */ ?> <? if ($field == "callnumber-first"): ?> <? $i = 0; - foreach ($sortedList as $url => $value): ?> + foreach ($sortedList + + as $url => $value): ?> <? if (!empty($value)): ?> - <li><a href="<?= $url ?>"><?= $this->escapeHtml($value) ?></a></li> + <li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li> <? else: $i--; ?> <? endif; ?> <? if (++$i == 10): ?> - </ul><ul class="list-unstyled col-sm-6"> + </ul> + <ul class="home-facet-list"> <? endif; ?> <? endforeach; ?> <? /* Special case: collections */ ?> @@ -96,20 +97,19 @@ JS; <? $i = 0; foreach ($sortedList as $url => $value): ?> <? if (++$i > 10): ?> - <li><a href="<?= $this->url('collections-home') ?>"><strong><?= $this->transEsc("More options") ?> ...</strong></a></li> + <li><a href="<?=$this->url('collections-home')?>"><strong><?=$this->transEsc("More options")?> ...</strong></a></li> <? break; ?> - <? else: ?> - <li><a href="<?= $this->url('collections-bytitle') ?>?title=<?= urlencode($value) ?>"><?= $this->escapeHtml($value) ?></a></li> <? endif; ?> + <li><a href="<?=$this->url('collections-bytitle')?>?title=<?=urlencode($value)?>"><?=$this->escapeHtml($value)?></a></li> <? endforeach; ?> <? else: ?> <? $i = 0; foreach ($sortedList as $url => $value): ?> <? if (++$i > 10): ?> - <li><a href="<?= $this->url($advSearch) ?>"><strong><?= $this->transEsc("More options") ?> ...</strong></a></li> + <li><a href="<?=$this->url($advSearch)?>"><strong><?=$this->transEsc("More options")?> ...</strong></a></li> <? break; ?> <? elseif (!empty($value)): ?> - <li><a href="<?= $url ?>"><?= $this->escapeHtml($value) ?></a></li> + <li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li> <? else: $i--; ?> <? endif; ?> <? endforeach; ?> diff --git a/themes/finc/templates/search/pagination.phtml b/themes/finc/templates/search/pagination.phtml index b84f3b32bc494fd0f304e5cc60cd6b50345b40cb..5df5bfdb8980e89fcdefe7633c73568497e61bb8 100644 --- a/themes/finc/templates/search/pagination.phtml +++ b/themes/finc/templates/search/pagination.phtml @@ -5,7 +5,7 @@ <? if (!isset($this->options['disableFirst']) || !$this->options['disableFirst']): ?> <li class="first"><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage(1)?>">[1]</a></li> <? endif; ?> - <li class="prev"><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>">« <span class="hidden-xs"><?=$this->transEsc('Prev')?></span></a></li> + <li class="page-prev"><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->previous)?>">« <span class="hidden-xs"><?=$this->transEsc('Prev')?></span></a></li> <? endif; ?> <? if (count($this->pagesInRange) > 1): ?> @@ -19,7 +19,7 @@ <? endif; ?> <? if (isset($this->next)): ?> - <li class="nxt"><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->next)?>"><span class="hidden-xs"><?=$this->transEsc('Next');?></span> »</a></li> + <li class="page-next"><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->next)?>"><span class="hidden-xs"><?=$this->transEsc('Next');?></span> »</a></li> <? if (!isset($this->options['disableLast']) || !$this->options['disableLast']): ?> <li class="last"><a href="<?=$this->currentPath() . $this->results->getUrlQuery()->setPage($this->pageCount)?>">[<?=$this->pageCount?>]</a></li> <? endif; ?> diff --git a/themes/finc/templates/search/results.phtml b/themes/finc/templates/search/results.phtml index 8a2f10c52391dc32f36516e69afce25f3b887992..4ec2aee5626492de661a4756177925bebc6f631e 100644 --- a/themes/finc/templates/search/results.phtml +++ b/themes/finc/templates/search/results.phtml @@ -34,9 +34,12 @@ } // Enable cart if appropriate: - $this->showCartControls = $this->params->getOptions()->supportsCart() && $this->cart()->isActive(); - // Enable bulk options if appropriate: $this->showBulkOptions = $this->params->getOptions()->supportsCart() && $this->showBulkOptions; + // Checkboxes if appropriate: + $this->showCartControls = $this->params->getOptions()->supportsCart() && $this->cart()->isActive() + && ($this->showBulkOptions || !$this->cart()->isActiveInSearch()); + // Enable bulk options if appropriate: + $this->showCheckboxes = $this->showCartControls || $this->showBulkOptions; // Load Javascript only if list view parameter is NOT full: if ($this->params->getOptions()->getListViewOption() != "full") { @@ -45,50 +48,36 @@ } // Load Javascript dependencies into header: + $this->headScript()->appendFile("vendor/hunt.min.js"); $this->headScript()->appendFile("check_item_statuses.js"); $this->headScript()->appendFile("check_save_statuses.js"); ?> -<div class="row"> - <? /* finc: we need search-results-col to pull content to full width - CK */?> - <div class="<?=$this->layoutClass('mainbody')?> search-results-col"> +<div class="<?=$this->layoutClass('mainbody')?>"> <? if (($recordTotal = $this->results->getResultTotal()) > 0): // only display these at very top if we have results ?> <? foreach ($this->results->getRecommendations('top') as $current): ?> <?=$this->recommend($current)?> <? endforeach; ?> <? endif; ?> <?=$this->flashmessages()?> - <? /* We hide items here for sm + xs - CK */ ?> - <div class="search-controls row hidden-xs hidden-sm hidden-print"> - <div class="col-sm-6"> + <? /* finc: remove 'hidden' below to show search-stats; we also hide the entire bar on xs + sm - CK */ ?> + <nav class="search-header hidden-xs hidden-sm hidden-print"> + <div class="search-stats hidden"> <? if ($recordTotal > 0): ?> - <?=$this->transEsc("Showing")?> - <strong><?=$this->localizedNumber($this->results->getStartRecord())?></strong> - <strong><?=$this->localizedNumber($this->results->getEndRecord())?></strong> - <? if (!isset($this->skipTotalCount)): ?> - <? $this->layout()->srmessage = $this->transEsc('result_count', ['%%count%%' => $this->localizedNumber($recordTotal)]); ?> - <?=$this->transEsc('of')?> <strong><?=$this->localizedNumber($recordTotal)?></strong> - <? endif; ?> - <? if (isset($this->overrideSearchHeading)): ?> - <?=$this->overrideSearchHeading?> - <? elseif ($this->params->getSearchType() == 'basic'): ?> - <?=$this->transEsc('for search')?>: <strong>'<?=$this->escapeHtml($lookfor)?>'</strong>, - <? endif; ?> - <? if ($qtime = $this->results->getQuerySpeed()): ?> - <?=$this->transEsc('query time')?>: <?=$this->localizedNumber($qtime, 2).$this->transEsc('seconds_abbrev')?> - <? endif; ?> + <?=$this->context()->renderInContext('search/controls/showing.phtml', ['lookfor' => $lookfor, 'recordTotal' => $recordTotal]) ?> <? else: ?> <h2><?=$this->transEsc('nohit_heading')?></h2> <? endif; ?> </div> <? if ($recordTotal > 0): ?> - <div class="col-sm-6 text-right"> + <div class="search-controls"> <?=$this->render('search/controls/limit.phtml')?> <?=$this->render('search/controls/sort.phtml')?> <?=$this->render('search/controls/view.phtml')?> </div> <? endif; ?> - </div> + </nav> <? /* End Listing Options */ ?> <? if ($recordTotal < 1): ?> @@ -96,7 +85,7 @@ <? if (isset($this->overrideEmptyMessage)): ?> <?=$this->overrideEmptyMessage?> <? else: ?> - <? $this->layout()->srmessage = $this->transEsc('nohit_prefix') . ' - ' . $this->escapeHtml($lookfor) . ' - ' . $this->transEsc('nohit_suffix'); ?> + <? $this->layout()->srmessage = $this->translate('nohit_lookfor_html', ['%%lookfor%%' => $this->escapeHtml($lookfor)]); ?> <?=$this->layout()->srmessage ?> <? endif; ?> </p> @@ -112,12 +101,12 @@ <? endif; ?> <? endforeach; ?> <? else: ?> - <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-searchresultsbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> - <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', array('idPrefix' => ''))?> + <form id="search-cart-form" method="post" name="bulkActionForm" action="<?=$this->url('cart-searchresultsbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> + <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => ''])?> + </form> <?=$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, 'options' => isset($this->paginationOptions) ? $this->paginationOptions : []))?> - </form> + <?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => 'bottom_', 'formAttr' => 'search-cart-form'])?> + <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results, 'options' => isset($this->paginationOptions) ? $this->paginationOptions : []])?> <div class="searchtools hidden-print"> <strong><?=$this->transEsc('Search Tools')?>:</strong> @@ -148,5 +137,4 @@ <? endforeach; ?> </div> <? /* End Narrow Search Options */ ?> -</div> <!-- finc: search - results - END --> diff --git a/themes/finc/templates/search/searchTabs.phtml b/themes/finc/templates/search/searchTabs.phtml index 4e17691c810cc5a754e75bba9ab0b38d96f295a0..3dfe07d34e0ce1387cbdc9d8fc907ec4b088dc1d 100644 --- a/themes/finc/templates/search/searchTabs.phtml +++ b/themes/finc/templates/search/searchTabs.phtml @@ -1,9 +1,16 @@ +<!-- finc: search - searchTabs --> <? if (isset($searchTabs) && count($searchTabs) > 0): ?> <ul class="nav nav-tabs"> <? foreach ($searchTabs as $tab): ?> - <li<?=$tab['selected'] ? ' class="active"' : ''?>> - <a <?=$tab['selected'] ? '' : 'href="' . $this->escapeHtmlAttr($tab['url']) . '"' ?>><?=$this->transEsc($tab['label']); ?></a> - </li> + <? if ($this->permission()->allowDisplay($tab['permission'])): ?> + <li<?=$tab['selected'] ? ' class="active"' : ''?>> + <a <?=$tab['selected'] ? '' : 'href="' . $this->escapeHtmlAttr($tab['url']) . '"'?>><?=$this->transEsc($tab['label']);?></a> + </li> + <? elseif ($block = $this->permission()->getAlternateContent($tab['permission'])): ?> + <?=$block?> + <? endif; ?> <? endforeach; ?> </ul> <? endif; ?> + +<!-- finc: search - searchTabs - END --> diff --git a/themes/finc/templates/search/searchbox.phtml b/themes/finc/templates/search/searchbox.phtml index 2a727ded39a6fe012defd9061d65792902de4b36..e2078ad5c929bed32fee3fb861257f14718e3eff 100644 --- a/themes/finc/templates/search/searchbox.phtml +++ b/themes/finc/templates/search/searchbox.phtml @@ -8,130 +8,141 @@ if (!isset($this->searchClassId)) { // Load search actions and settings (if any): $options = $this->searchOptions($this->searchClassId); $handlers = $this->searchbox()->getHandlers( - $this->searchClassId, - isset($this->searchIndex) ? $this->searchIndex : null + $this->searchClassId, + isset($this->searchIndex) ? $this->searchIndex : null ); $handlerCount = count($handlers); $basicSearch = $this->searchbox()->combinedHandlersActive() ? 'combined-searchbox' : $options->getSearchAction(); $searchHome = $options->getSearchHomeAction(); $advSearch = $options->getAdvancedSearchAction(); - $lastSort = $this->searchMemory()->getLastSort($this->searchClassId); - $lastLimit = $this->searchMemory()->getLastLimit($this->searchClassId); - $ignoreHiddenFilterMemory = isset($this->ignoreHiddenFilterMemory) && $this->ignoreHiddenFilterMemory; - $ignoreHiddenFiltersInRequest = isset($this->ignoreHiddenFiltersInRequest) && $this->ignoreHiddenFiltersInRequest; - $hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId, $ignoreHiddenFilterMemory, $ignoreHiddenFiltersInRequest); - if (empty($hiddenFilters) && !$ignoreHiddenFilterMemory) { - $hiddenFilters = $this->searchMemory()->getLastHiddenFilters($this->searchClassId); - if (empty($hiddenFilters)) { - $hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId); - } - } - $hiddenFilterParams = $this->searchtabs()->getCurrentHiddenFilterParams($this->searchClassId, $ignoreHiddenFilterMemory, '?'); +$lastSort = $this->searchMemory()->getLastSort($this->searchClassId); +$lastLimit = $this->searchMemory()->getLastLimit($this->searchClassId); +$ignoreHiddenFilterMemory = isset($this->ignoreHiddenFilterMemory) && $this->ignoreHiddenFilterMemory; +$ignoreHiddenFiltersInRequest = isset($this->ignoreHiddenFiltersInRequest) && $this->ignoreHiddenFiltersInRequest; +$hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId, $ignoreHiddenFilterMemory, $ignoreHiddenFiltersInRequest); +if (empty($hiddenFilters) && !$ignoreHiddenFilterMemory) { + $hiddenFilters = $this->searchMemory()->getLastHiddenFilters($this->searchClassId); + if (empty($hiddenFilters)) { + $hiddenFilters = $this->searchtabs()->getHiddenFilters($this->searchClassId); + } +} +$hiddenFilterParams = $this->searchtabs()->getCurrentHiddenFilterParams($this->searchClassId, $ignoreHiddenFilterMemory, '?'); ?> +<? $searchTabs = $this->searchtabs()->getTabConfig($this->searchClassId, $this->lookfor, $this->searchIndex, $this->searchType, $hiddenFilters); ?> <? if ($this->searchType == 'advanced'): ?> - <? /* keep no-margin or advanced search box will be pushed down too far (navbar-form) */ ?> - <div class="searchForm navbar-form navbar-left flip no-margin-t"> - <? $tabs = $this->context($this)->renderInContext('search/searchTabs', ['hiddenFilters' => $hiddenFilters]); ?> - <? if (!empty($tabs)): ?><?= $tabs ?><div class="tab-content clearfix"><? endif; ?> - <p class="adv_search_terms"><?= $this->transEsc("Your search terms") ?> : "<strong><?= $this->escapeHtml($this->lookfor) ?></strong>"</p> - <? /* We use an ul li list, CK */ ?> + <? /* finc: keep .no-margin-t or advanced search box will be pushed down too far (navbar-form) */ ?> + <div class="navbar-left flip no-margin-t"> + <? $tabs = $this->context($this)->renderInContext('search/searchTabs', ['searchTabs' => $searchTabs['tabs']]); ?> + <? if (!empty($tabs)): ?><?=$tabs?> + <div class="tab-content clearfix no-gutter-all"><? endif; ?> + <p class="adv_search_terms"><?=$this->transEsc("Your search terms")?> : "<strong><?=$this->escapeHtml($this->lookfor)?></strong>"</p> + <? /* finc: we use an ul li list, CK */ ?> <ul class="adv_search_links"> - <li><a href="<?= $this->url($advSearch) ?>?edit=<?= $this->escapeHtmlAttr($this->searchId) ?>"><?= $this->transEsc("Edit this Advanced Search") ?></a></li> - <li><a href="<?= $this->url($advSearch) . $hiddenFilterParams?>"><?= $this->transEsc("Start a new Advanced Search") ?></a></li> - <li><a href="<?= $this->url($searchHome) . $hiddenFilterParams?>"><?= $this->transEsc("Start a new Basic Search") ?></a></li> + <li><a href="<?=$this->url($advSearch)?>?edit=<?=$this->escapeHtmlAttr($this->searchId)?>"><?=$this->transEsc("Edit this Advanced Search")?></a></li> + <li><a href="<?=$this->url($advSearch) . $hiddenFilterParams?>"><?=$this->transEsc("Start a new Advanced Search")?></a></li> + <li><a href="<?=$this->url($searchHome) . $hiddenFilterParams?>"><?=$this->transEsc("Start a new Basic Search")?></a></li> </ul> <? if (!empty($tabs)): ?></div><? endif; ?> </div> <? else: ?> - <? /* No navbar-form etc here but below, CK */ ?> -<form class="searchForm" role="search" method="get" action="<?= $this->url($basicSearch) ?>" name="searchForm" autocomplete="off"> - <?= $this->context($this)->renderInContext('search/searchTabs', ['hiddenFilters' => $hiddenFilters]); ?> - <? /* We use a list and add the navbar-left etc here, CK */ ?> - <ul class="navbar-left left list-unstyled"> - <li class="has-form"> - <? /* We use 'required', CK */ ?> - <input class="searchForm_lookfor form-control search-query<? if ($this->searchbox()->autocompleteEnabled($this->searchClassId)): ?> autocomplete searcher:<?= $this->escapeHtmlAttr($this->searchClassId) ?><? endif ?>" type="text" name="lookfor" value="<?= $this->escapeHtmlAttr($this->lookfor) ?>" required="required"/> - </li> - <? if ($handlerCount > 1): ?> - <li class="has-form hidden-xs"> - <select class="searchForm_type form-control" name="type" data-native-menu="false"> - <? foreach ($handlers as $handler): ?> - <option value="<?= $this->escapeHtmlAttr($handler['value']) ?>"<?= $handler['selected'] ? ' selected="selected"' : '' ?>><?= $handler['indent'] ? '-- ' : '' ?><?= $this->transEsc($handler['label']) ?></option> - <? endforeach; ?> - </select> + <form id="searchForm" class="searchForm navbar-form navbar-left flip" role="search" method="get" action="<?=$this->url($basicSearch)?>" name="searchForm" autocomplete="off"> + <?=$this->context($this)->renderInContext('search/searchTabs', ['searchTabs' => $searchTabs['tabs']]);?> + <? $placeholder = $this->searchbox()->getPlaceholderText(isset($searchTabs['selected']['id']) ? $searchTabs['selected']['id'] : null); ?> + <? /* finc: We use a list here, CK */ ?> + <ul class="navbar-left list-unstyled"> + <li> + <? /* finc: we use required='required', CK */ ?> + <input id="searchForm_lookfor" + class="searchForm_lookfor form-control search-query<? if ($this->searchbox()->autocompleteEnabled($this->searchClassId)): ?> autocomplete searcher:<?=$this->escapeHtmlAttr($this->searchClassId)?><? endif ?>" + type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"<? if ($placeholder): ?> placeholder="<?=$this->transEsc($placeholder)?>"<? endif ?> required="required"/> </li> - <? elseif ($handlerCount == 1): ?> - <input type="hidden" name="type" value="<?= $this->escapeHtmlAttr($handlers[0]['value']) ?>"/> - <? endif; ?> - <li class="has-form"> - <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> <?= $this->transEsc("Find") ?></button> - </li> - <? if ($advSearch): ?> - <li class="has-form hidden-xs"> - <a href="<?=$this->url($advSearch) . ((isset($this->searchId) && $this->searchId) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams) ?>" class="btn btn-transparent" role="button" rel="nofollow"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a> + <? if ($handlerCount > 1): ?> + <li class="hidden-xs"> + <select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false"> + <? foreach ($handlers as $handler): ?> + <option + value="<?=$this->escapeHtmlAttr($handler['value'])?>"<?=$handler['selected'] ? ' selected="selected"' : ''?>><?=$handler['indent'] ? '-- ' : ''?><?=$this->transEsc($handler['label'])?></option> + <? endforeach; ?> + </select> + </li> + <? elseif ($handlerCount == 1): ?> + <input type="hidden" name="type" value="<?=$this->escapeHtmlAttr($handlers[0]['value'])?>"/> + <? endif; ?> + <li> + <button type="submit" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i> <span class="find-label"><?=$this->transEsc("Find")?></span></button> </li> - <? endif; ?> - </ul> + <? if ($advSearch): ?> + <li class="hidden-xs"> + <a href="<?=$this->url($advSearch) . ((isset($this->searchId) && $this->searchId) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams)?>" class="btn btn-transparent" + role="button" rel="nofollow"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a> + </li> + <? endif; ?> + <li> + <? if ($geoUrl = $this->geocoords()->getSearchUrl($options)) : ?> + <a href="<?=$geoUrl?>" class="btn btn-link"><?=$this->transEsc('Geographic Search')?></a> + <? endif; ?> + </li> + </ul> - <? /* We hide this for small - CK */ ?> - <div class="checkbox hidden-xs"> - <? $shards = $options->getShards(); if ($options->showShardCheckboxes() && !empty($shards)): ?> - <? - $selectedShards = isset($this->selectedShards) + <? /* finc: We hide this for small and keep the solution using labels, same below - CK */ ?> + <div class="checkbox hidden-xs"> + <? $shards = $options->getShards(); + if ($options->showShardCheckboxes() && !empty($shards)): ?> + <? + $selectedShards = isset($this->selectedShards) ? $this->selectedShards : $options->getDefaultSelectedShards(); - ?> - <? foreach ($shards as $shard => $val): ?> - <? $isSelected = empty($selectedShards) || in_array($shard, $selectedShards); ?> - <input type="checkbox" <?= $isSelected ? 'checked="checked" ' : '' ?>name="shard[]" value='<?= $this->escapeHtmlAttr($shard) ?>' id='checkbox_<?= $this->escapeHtmlAttr($shard) ?>' /> <label for="checkbox_<?= $this->escapeHtmlAttr($shard) ?>"><?= $this->transEsc($shard) ?></label> - <? endforeach; ?> - <? endif; ?> - </div> - - <? - $filterDetails = $this->searchbox()->getFilterDetails( - isset($this->filterList) && is_array($this->filterList) ? $this->filterList : array(), - isset($this->checkboxFilters) && is_array($this->checkboxFilters) ? $this->checkboxFilters : array() - ); - ?> - <? if ((isset($hasDefaultsApplied) && $hasDefaultsApplied) || !empty($filterDetails)): ?> - <? $defaultFilterState = $options->getRetainFilterSetting() ? ' checked="checked"' : ''; ?> - <div class="checkbox"> - <input id="keepfilters" onChange="$('.applied-filter').click()" type="checkbox"<?= $defaultFilterState ?> class="searchFormKeepFilters"/> - <label for="keepfilters"> - <?=$this->transEsc("basic_search_keep_filters")?> - </label> - </div> - <div class="hidden"> - <? foreach ($filterDetails as $current): ?> - <input class="applied-filter" id="<?= $this->escapeHtmlAttr($current['id']) ?>" type="checkbox"<?= $defaultFilterState ?> name="filter[]" value="<?= $this->escapeHtmlAttr($current['value']) ?>"/> - <label for="<?= $this->escapeHtmlAttr($current['id']) ?>"><?= $this->escapeHtml($current['value']) ?></label> - <? endforeach; ?> - <? if (isset($hasDefaultsApplied) && $hasDefaultsApplied): ?> - <!-- this is a hidden element that flags whether or not default filters have been applied; - it is intentionally unlabeled, as users are not meant to manipulate it directly. --> - <input class="applied-filter" id="dfApplied" type="checkbox" name="dfApplied" value="1"<?= $defaultFilterState ?> /> + ?> + <? foreach ($shards as $shard => $val): ?> + <? $isSelected = empty($selectedShards) || in_array($shard, $selectedShards); ?> + <input type="checkbox" <?=$isSelected ? 'checked="checked" ' : ''?>name="shard[]" value='<?=$this->escapeHtmlAttr($shard)?>' id='checkbox_<?=$this->escapeHtmlAttr($shard)?>'/> <label for="checkbox_<?=$this->escapeHtmlAttr($shard)?>"><?=$this->transEsc($shard)?></label> + <? endforeach; ?> <? endif; ?> </div> - <? endif; ?> + + <? + $filterDetails = $this->searchbox()->getFilterDetails( + isset($this->filterList) && is_array($this->filterList) ? $this->filterList : [], + isset($this->checkboxFilters) && is_array($this->checkboxFilters) ? $this->checkboxFilters : [] + ); + ?> + <? if ((isset($hasDefaultsApplied) && $hasDefaultsApplied) || !empty($filterDetails)): ?> + <? $defaultFilterState = $options->getRetainFilterSetting() ? ' checked="checked"' : ''; ?> + <div class="checkbox"> + <input type="checkbox"<?=$defaultFilterState?> class="searchFormKeepFilters" id="keepfilters"> + <label for="keepfilters"> + <?=$this->transEsc("basic_search_keep_filters")?> + </label> + </div> + <div class="hidden"> + <? foreach ($filterDetails as $current): ?> + <input class="applied-filter" id="<?=$this->escapeHtmlAttr($current['id'])?>" type="checkbox"<?=$defaultFilterState?> name="filter[]" value="<?=$this->escapeHtmlAttr($current['value'])?>"/> + <label for="<?=$this->escapeHtmlAttr($current['id'])?>"><?=$this->escapeHtml($current['value'])?></label> + <? endforeach; ?> + <? if (isset($hasDefaultsApplied) && $hasDefaultsApplied): ?> + <!-- this is a hidden element that flags whether or not default filters have been applied; + it is intentionally unlabeled, as users are not meant to manipulate it directly. --> + <input class="applied-filter" id="dfApplied" type="checkbox" name="dfApplied" value="1"<?=$defaultFilterState?> /> + <? endif; ?> + </div> + <? endif; ?> <? foreach ($hiddenFilters as $key => $filter): ?> <? foreach ($filter as $value): ?> - <input type="hidden" name="hiddenFilters[]" value="<?=$this->escapeHtmlAttr($key) . ':' . $this->escapeHtmlAttr($value)?>" /> + <input type="hidden" name="hiddenFilters[]" value="<?=$this->escapeHtmlAttr($key) . ':' . $this->escapeHtmlAttr($value)?>"/> <? endforeach; ?> <? endforeach; ?> - <? - /* Show hidden field for active search class when in combined handler mode. */ - if ($this->searchbox()->combinedHandlersActive()) { - echo '<input type="hidden" name="activeSearchClassId" value="' . $this->escapeHtmlAttr($this->searchClassId) . '" />'; - } - /* Load hidden limit preference from Session */ - if (!empty($lastLimit)) { - echo '<input type="hidden" name="limit" value="' . $this->escapeHtmlAttr($lastLimit) . '" />'; - } - if (!empty($lastSort)) { - echo '<input type="hidden" name="sort" value="' . $this->escapeHtmlAttr($lastSort) . '" />'; - } - ?> -</form> -<script type="text/javascript">$(".searchForm_lookfor:visible").focus()</script> + <? + /* Show hidden field for active search class when in combined handler mode. */ + if ($this->searchbox()->combinedHandlersActive()) { + echo '<input type="hidden" name="activeSearchClassId" value="' . $this->escapeHtmlAttr($this->searchClassId) . '" />'; + } + /* Load hidden limit preference from Session */ + if (!empty($lastLimit)) { + echo '<input type="hidden" name="limit" value="' . $this->escapeHtmlAttr($lastLimit) . '" />'; + } + if (!empty($lastSort)) { + echo '<input type="hidden" name="sort" value="' . $this->escapeHtmlAttr($lastSort) . '" />'; + } + ?> + </form> <? endif; ?> <!-- finc: search - searchbox - END --> diff --git a/themes/finc/theme.config.php b/themes/finc/theme.config.php index a5f77b8caac35d8463cb7f22180bcc588858a41b..4ade313e43d1b747e2a3d11fd6285ce189c300b2 100644 --- a/themes/finc/theme.config.php +++ b/themes/finc/theme.config.php @@ -7,7 +7,7 @@ return array( ), 'helpers' => array( 'factories' => array( - 'permission' => 'finc\View\Helper\Root\Factory::getPermission', + //'permission' => 'finc\View\Helper\Root\Factory::getPermission', 'record' => 'finc\View\Helper\Root\Factory::getRecord', 'recordlink' => 'finc\View\Helper\Root\Factory::getRecordLink', 'interlibraryloan' => @@ -18,6 +18,8 @@ return array( 'sidefacet' => 'finc\View\Helper\Root\Factory::getSideFacet', 'externalCatalogueLink' => 'finc\View\Helper\Root\Factory::getExternalCatalogueLink', + 'recordDataFormatter' => + 'finc\View\Helper\Root\RecordDataFormatterFactory', ), 'invokables' => array( 'resultfeed' => 'finc\View\Helper\Root\ResultFeed'