diff --git a/themes/fid_bbi/js/theme.js b/themes/fid_bbi/js/theme.js index 0b4939a71d5b4d4b6f19eb8fe0ce77a6de33d44a..76111a94f9e7b430b0f661150ecab6f52e3553e1 100644 --- a/themes/fid_bbi/js/theme.js +++ b/themes/fid_bbi/js/theme.js @@ -44,7 +44,7 @@ const theme = { const ariaExpanded = button.getAttribute('aria-expanded') if (role === 'tab') { - selectTab(targetId) + // TODO: Currently handled by Bootstrap JS } else if (ariaExpanded !== null) { button.setAttribute('aria-expanded', ariaExpanded === 'false') const targetElement = document.getElementById(targetId) diff --git a/themes/fid_bbi/scss/base/common.scss b/themes/fid_bbi/scss/base/common.scss index 84606f0364283538af1c7ab4e40ebf2fe7bcbaed..300507814cbbca63d73313e93e43585736fe1d10 100644 --- a/themes/fid_bbi/scss/base/common.scss +++ b/themes/fid_bbi/scss/base/common.scss @@ -70,7 +70,6 @@ code { } dd { - margin: 0; margin: 0 0 g(.5); overflow: visible; @@ -225,16 +224,18 @@ pre { } table { - margin: 0 auto g(); - min-width: 100%; + @include paragraph; + width: 100%; } -th { - color: $text-muted-color; - font-weight: bold; +td { + padding: g(.25) 0; + + + td { + padding-left: g(.5); + } } -td, th { padding: g(.25) 0; @@ -245,7 +246,7 @@ th { } tr { - box-shadow: 0 -2px #000 inset; + box-shadow: 0 -2px $text-muted-color inset; } ul { diff --git a/themes/fid_bbi/scss/blocks/icon.scss b/themes/fid_bbi/scss/blocks/icon.scss index b4d82a6d8b7f39546ab4d539aba862d121884a5f..4e4eb2943c9b880f1f9dcdf278b839fd1ac1d8c4 100644 --- a/themes/fid_bbi/scss/blocks/icon.scss +++ b/themes/fid_bbi/scss/blocks/icon.scss @@ -6,6 +6,28 @@ stroke: currentColor; stroke-width: 2; vertical-align: top; + + &.-beat { + animation: beat $td 1; + + @keyframes beat { + 0% { + transform: scale(1); + } + + 50% { + transform: scale(1.5); + } + + 100% { + transform: scale(1); + } + } + + path { + fill: currentColor; + } + } } .link-with-icon { diff --git a/themes/fid_bbi/scss/blocks/record.scss b/themes/fid_bbi/scss/blocks/record.scss index 6b731b7d406f7a27311ebed125418972ef2161c7..beff50f9c219976b5a91371c5a17cd3cc95dd6d1 100644 --- a/themes/fid_bbi/scss/blocks/record.scss +++ b/themes/fid_bbi/scss/blocks/record.scss @@ -39,6 +39,11 @@ h2 { color: inherit; flex: 0 0 g(8 - 1.25); // Space for link icons + margin: 0; + } + + ul { + margin: 0; } } @@ -46,32 +51,59 @@ display: flex; flex-wrap: wrap; margin-bottom: g(0); + position: relative; // required for dropdowns +} - a { - @include button-icon-bg(small); - @include button-small; - display: flex; - margin: g(.25); - white-space: nowrap; - width: calc(100% - #{g(.5)}); +.record_action { + @include button-icon-bg(small); + @include button-small; + display: flex; + margin: g(.25); + white-space: nowrap; + width: calc(100% - #{g(.5)}); - @include hover { - box-shadow: none; - } + @include hover { + box-shadow: none; + } + &.cart-remove { .icon { - color: #fff; - margin-right: g(.75); + path { + fill: #fff; + } } } - &.-secondary { - a { - width: calc(50% - #{g(.5)}); - } + .icon { + color: #fff; + margin-right: g(.75); + } + + .record_actions.-secondary & { + width: calc(50% - #{g(.5)}); + } +} + +.record_action-group { + width: 100%; +} + +.record_header { + flex: 1; + + > h1, + > dl { + border-left: 2px solid $text-color; + margin-left: 0; + padding-left: g() - 2px; + } + + > h1 { + padding-bottom: g(); } } +.record table, .record_internal { margin: 0 0 g(); min-width: 0; @@ -79,6 +111,12 @@ tr { box-shadow: none; } + + th, + td { + padding-top: 0; + padding-bottom: 0; + } } .record_links { @@ -134,20 +172,6 @@ } } -.record_title { - flex: 1; - - > h1, - > dl { - border-left: 2px solid $text-color; - padding-left: g() - 2px; - } - - > h1 { - padding-bottom: g(); - } -} - .record_type { display: none; margin-left: g(-4); diff --git a/themes/fid_bbi/scss/blocks/tabs.scss b/themes/fid_bbi/scss/blocks/tabs.scss index 1754361f260109a8c40678d198db3d70143f7dd2..44120737e1b0c5fdd859b9f47ff4ddb4859dedc1 100644 --- a/themes/fid_bbi/scss/blocks/tabs.scss +++ b/themes/fid_bbi/scss/blocks/tabs.scss @@ -2,17 +2,32 @@ // } +.tab-content, .tabs_main { border: 2px solid; margin-bottom: -2px; margin-top: -2px; + + h2, + h3, + h4, + dl, + ol, + p, + ul { + max-width: none; + } } +.record-tab, .tabs_button { - background: none; - border-color: transparent; + a { + @include button; + border-color: transparent; + display: block; + } - &[aria-selected="true"] { + &.active a { background: #fff; border-bottom: 0; border-color: $text-color; @@ -23,16 +38,27 @@ .tabs_header { display: flex; + margin: 0; + padding: 0; + max-width: none; position: relative; z-index: 1; + + li { + &::before { + content: none; // remove bullet + } + } } +.tab-pane, .tabs_item { + display: none; max-width: 100%; overflow: auto; padding: g(); - &[hidden] { - display: none; + &.active { + display: block; } } diff --git a/themes/fid_bbi/scss/blocks/tags.scss b/themes/fid_bbi/scss/blocks/tags.scss new file mode 100644 index 0000000000000000000000000000000000000000..0ac890c0b54686377baccfcbc619609c220ea2a9 --- /dev/null +++ b/themes/fid_bbi/scss/blocks/tags.scss @@ -0,0 +1,12 @@ +.tags { + margin-bottom: g(.5); +} + +.tags_button { + border: 0; + padding: 0; +} + +.tags_form { + display: inline; +} diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss index 741f2e23e9c29f90fe6122f0fefddc5295998e0f..a2a3b9458a49f4a713628989125f4845cc70dfe9 100644 --- a/themes/fid_bbi/scss/compiled.scss +++ b/themes/fid_bbi/scss/compiled.scss @@ -56,3 +56,5 @@ @import 'blocks/unstyled-list'; @import 'plugins/slim-select'; + +@import 'util/hacks'; diff --git a/themes/fid_bbi/scss/mixins/button.scss b/themes/fid_bbi/scss/mixins/button.scss index cfce0591b0bbf95209d9fca0959ab21905de9f80..87d0e06df8f78c2287a437b77d68921208ed4f20 100644 --- a/themes/fid_bbi/scss/mixins/button.scss +++ b/themes/fid_bbi/scss/mixins/button.scss @@ -3,6 +3,7 @@ background: none; border: 2px solid; color: $button-color; + display: inline-block; font-family: display-font, sans-serif; font-size: $font-size-special; padding: (g(.5) - 2px) (g() - 2px); @@ -10,6 +11,7 @@ @include hover { background: $button-hover-bg; + box-shadow: none; // overwrite <a> styles color: $link-hover-color; outline: 0; } diff --git a/themes/fid_bbi/scss/util/hacks.scss b/themes/fid_bbi/scss/util/hacks.scss new file mode 100644 index 0000000000000000000000000000000000000000..d9c9686e2abbc8c1c83e796c02c562c06ea405b6 --- /dev/null +++ b/themes/fid_bbi/scss/util/hacks.scss @@ -0,0 +1,55 @@ +// This file contains hacks for templates which were created for Bootstrap 3 and +// would only require minor changes to work with the new theme, which does not +// justify to recreate those templates. Instead, some CSS is applied to +// Bootstrap classes. + +// Last row of forms, containing a "cancel" link and the submit button +.form-group:last-child > .col-lg-11 { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + flex-direction: row-reverse; +} + +.dropdown-menu { + background: $white; + box-shadow: 0 0 0 2px $text-color inset; + display: none; + list-style: none; + margin-top: g(.25); + padding: g(.5) g(); + position: absolute; + z-index: 9; + + &.-right { + margin-top: g(.25 + 1.75); // only for record "Export" + right: 0; + } + + .open > & { + display: block; + } + + &::before { + background: $white; + content: ''; + display: block; + position: absolute; + width: 12px; + height: 12px; + box-shadow: 2px 2px 0 $text-color inset; + top: -5px; // align with top + transform: rotate(45deg); + } + + &.-right::before { + right: g(); + } + + > li { + &::before { + content: none; + } + } +} diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml index 6175ce2ce23d8d6616747489497e4dab11b16e7f..dd532bdbd710a11e04632e8ab1c2e45d7d4abfbf 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml @@ -1,81 +1,133 @@ <!-- fid_bbi: RecordDriver - DefaultRecord - core --> -<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> - <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> - <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> +<div + class="record_main" + vocab="http://schema.org/" + resource="#record" + typeof="<?=$this->driver->getSchemaOrgFormats()?> Product" +> + <div class="record_type"> <?php - $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(); + $format = ($this->driver->tryMethod('getFormats') ?? ['Unknown format'])[0]; + $formatIconMappingsFile = APPLICATION_PATH . '/themes/fid_bbi/format-icon-mappings.json'; + $formatIconMappings = json_decode(file_get_contents($formatIconMappingsFile), true); ?> - <?php if ($QRCode || $cover || $preview): ?> - <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> - <?php /* Display thumbnail if appropriate: */ ?> - <?php if ($cover): ?> - <?=$cover?> - <?php /* BOF - finc-specific StyleBasedIcons */ ?> - <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> - <?=$this->record($this->driver)->getFormatIcon()?> - <?php /* EOF - finc-specific StyleBasedIcons */ ?> - <?php endif; ?> - <?php /* Display qrcode if appropriate: */ ?> - <?php if ($QRCode): ?> - <span class="hidden-xs"> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> - </span> - <?php endif; ?> + <?php if (!empty($formatIconMappings[$format])): ?> + <?=$this->icon("big/{$formatIconMappings[$format]}")?> + <?php else: ?> + <?=$this->icon('big/unknown')?> + <?php endif; ?> + </div> + <div class="record_header"> + <?php + // finc: We want to get rid of trailing special chars in the title and + // limit its length to 100 chars; in finc: keep schema name tag here!! + // #13861 - CK + // fid_bbi: Show solr field title with blanks before and after semicolon - + // semicolon between 245 a and b #15534 - RL + $title = $this->escapeHtml( + preg_replace( + ['/(\s[\/\.:]\s*)*$/', '/(\s*):(\s*)/'], + ['', ' : '], + $this->truncate($this->driver->getTitle(), 170) + ) + ); + ?> + <h1 property="name"><?=$title?></h1> - <?php // 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) ?> - <?php if ($preview): ?> - <div class="record-previews"> - <?=$preview?> - </div> + <?php + $formatter = $this->recordDataFormatter(); + $recordType = $driver->tryMethod('getRecordType'); + $coreType = ['ai' => 'core-ai', 'marcfinc' => 'core-marc'][$recordType] ?? 'core'; + $coreFields = $formatter->getData($driver, $formatter->getDefaults($coreType)); + ?> + <?php if (!empty($coreFields)): ?> + <h2 class="sr-only"><?=$this->transEsc('Bibliographic Details')?></h2> + <dl> + <?php foreach ($coreFields as $current): ?> + <?php if (is_null($current['label'])): ?> + <?php // For tags, values already include dt/dd ?> + <?=$current['value']?> + <?php else: ?> + <dt><?=$this->transEsc($current['label'])?></dt> + <dd><?=$current['value']?></dd> <?php endif; ?> - </div> + <?php endforeach; ?> + </dl> <?php endif; ?> - <div class="media-body"> - - <?php /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars; - in finc: keep schema name tag here!! #13861 - CK - */ - ?> - <?php /* finc: add schema tags for title #13850 - VE */ ?> - <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 170)))?></h3> - - <?/* fid_bbi: #15189 remove summary - GG */ ?> + </div> - <?php if ($this->userlist()->getMode() !== 'disabled'): ?> - <?php /* Display the lists that this record is saved to */ ?> - <div class="savedLists hidden alert alert-info"> - <strong><?=$this->transEsc("Saved in")?>:</strong> - </div> - <?php endif; ?> + <?=$this->record($this->driver)->getToolbar()?> +</div> - <?php /* Display Main Details */ ?> - <?php - $formatter = $this->recordDataFormatter(); - $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-marc')); - ?> - <?php if (!empty($coreFields)): ?> - <table class="table table-striped"> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> - <?php foreach ($coreFields as $current): ?> - <?php if (is_null($current['label'])): ?> - <?=$current['value']?> - <?php else: ?> - <tr> - <th><?=$this->transEsc($current['label'])?>:</th> - <td><?=$current['value']?></td> - </tr> - <?php endif; ?> - <?php endforeach; ?> - </table> - <?php endif; ?> - <?php /* End Main Details */ ?> +<div class="box -left"> + <div class="record_access"> + <h2><?=$this->translate('Access')?></h2> + <ul class="unstyled-list"> + <li> + <a class="link-with-icon" href="#TODO"> + <?=$this->icon('small/arrow-right')?> + TODO + </a> + </li> + </ul> </div> </div> + +<ul class="record_links"> + <li> + <?php + $permalink = $this->url( + 'record', + ['action' => 'record', 'id' => $this->driver->getUniqueId()], + ['force_canonical' => true] + ); + ?> + <a + class="link-with-icon" + id="permalink" + href="<?=$permalink?>" + > + <?=$this->icon('small/link')?> + <?=$this->transEsc('Permalink')?> + </a> + </li> + + <li> + <a + class="link-with-icon" + data-lightbox + href="<?=$this->recordLink()->getActionUrl($this->driver, 'Acquisition')?>" + rel="nofollow" + > + <?=$this->icon('small/add-book')?> + <?=$this->transEsc('Book Suggestion')?> + </a> + </li> + + <li> + <a + class="link-with-icon" + data-lightbox + href="<?=$this->recordLink()->getActionUrl($this->driver, 'ReportErrors')?>" + rel="nofollow" + > + <?=$this->icon('small/lightning')?> + <?=$this->transEsc('ReportErrors')?> + </a> + </li> +</ul> + +<script> +document.getElementById('permalink').onclick = function (e) { + e.preventDefault(); + var $temp = $('<input>'); + $('body').append($temp); + $temp.val($(this).attr('href').trim()).select(); + document.execCommand('copy'); + // TODO: Use temporary popup instead + alert('<?=$this->translate('copied_link_to_clipboard')?>'); + $temp.remove(); +} +</script> <!-- fid_bbi: RecordDriver - DefaultRecord - core - END --> diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-tags.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-tags.phtml index 0ee9c33dd711759404cad387f67c22026a8c1eca..082d70d4ffe3545a76c1a121cb951726f9f379c6 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-tags.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-tags.phtml @@ -1,30 +1,32 @@ <!-- fid_bbi: RecordDriver - DefaultRecord - data-tags --> <?php - /* - * this is a copy of themes/bootstrap3/templates/RecordDriver/DefaultRecord/data-tags.phtml - * BBI specific changes are: - * * all wrapped in spanned table row - * - * @author: Dorian Merz <merz@ub.uni-leipzig.de> - */ -?> -<?php - if($loggedin = $this->auth()->isLoggedIn()) { - $user_id = $loggedin->id; - $loggedin = true; - } else { - $user_id = false; - } +/* + * Based on themes/bootstrap3/templates/RecordDriver/DefaultRecord/data-tags.phtml + * + * BBI specific changes: + * - Using <dl> elements instead of <table> to match template + * RecordDriver/DefaultRecord/core.phtml + * + * @author: Dorian Merz <merz@ub.uni-leipzig.de> + * @author: Tobias Schäfer <ts@aspectis.net> + */ + +if ($loggedIn = $this->auth()->isloggedIn()) { + $userId = $loggedIn->id; + $loggedIn = true; +} else { + $userId = false; +} ?> + <?php if ($this->usertags()->getMode() !== 'disabled'): ?> -<tr class="hline"><!--empty row--><td></td><td></td></tr> -<tr><th><?=$this->translate('Tags')?>:</th><td><!--empty cell--></td></tr> -<tr><td colspan="2"> - <?php $tagList = $this->driver->getTags(null, null, 'count', $user_id); ?> - <a class="tag-record btn btn-link pull-right flip" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox> - <i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Add Tag')?> + <dt><?=$this->translate('Tags')?></dt> + <dd> + <?php $tagList = $this->driver->getTags(null, null, 'count', $userId); ?> + <?=$this->context($this)->renderInContext('record/taglist', ['tagList' => $tagList, 'loggedin' => $loggedIn]) ?> + <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox> + <?=$this->transEsc('Add Tag')?> </a> - <?=$this->context($this)->renderInContext('record/taglist', ['tagList' => $tagList, 'loggedin' => $loggedin]) ?> -</td></tr> + </dd> <?php endif; ?> <!-- fid_bbi: RecordDriver - DefaultRecord - data-tags - END --> diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/toolbar.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/toolbar.phtml index cb52242732d9b384cf31b5ef3963fb0a3b38cab6..d78dbce0a3de2b5aa8c934954bc6a1cc33f48c12 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/toolbar.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/toolbar.phtml @@ -1,84 +1,111 @@ <!-- fid_bbi: recordDriver - DefaultRecord - toolbar --> -<? - $addThis = $this->addThis(); - if (!empty($addThis)) { - $this->headScript()->appendFile('https://s7.addthis.com/js/250/addthis_widget.js?pub=' . urlencode($addThis)); - } +<?php +$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(); ?> -<? /* #14878: use original toolbar - GG */ ?> -<ul class="record-nav nav nav-pills hidden-print"> - <? /* finc: we use the sr-only description, CK */ ?> - <li class="sr-only"><?=$this->transEsc('Toolbar')?></li> - <? if ($this->userlist()->getMode() !== 'disabled'): ?> - <? /* finc: we use title, CK */ ?> - <li> - <?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 (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; ?> - <? $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')?> +<div class="record_sidebar"> + <h2 class="sr-only"><?=$this->transEsc('Toolbar')?></h2> + <div class="record_actions -primary"> + <?php + $cart = $this->cart(); + $id = $this->driver->getUniqueId(); + $source = $this->driver->getSourceIdentifier(); + ?> + <?php if ($cart->isActive()): ?> + <?php $cartId = $source . '|' . $id; ?> + <div + class="record_action-group btn-bookbag-toggle" + data-cart-id="<?=$this->escapeHtmlAttr($id)?>" + data-cart-source="<?=$this->escapeHtmlAttr($source)?>" + > + <a class="record_action cart-add hidden" href="javascript:;"> + <?=$this->icon('small/pin')?> + <?=$this->transEsc('Add to Book Bag')?> + </a> + <a class="record_action cart-remove hidden" href="javascript:;"> + <?=$this->icon('small/pin', 'icon -beat')?> + <?=$this->transEsc('Remove from Book Bag')?> + </a> + </div> + <?php endif; ?> + + <?php if ($this->permission()->allowDisplay('feature.Favorites')): ?> + <a + class="record_action" + data-lightbox + href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" + title="<?=$this->transEsc('Add to favorites')?>" + rel="nofollow" + > + <?=$this->icon('small/star')?> + <?=$this->transEsc('Add to favorites')?> </a> - <ul class="dropdown-menu" role="menu"> - <? foreach ($exportFormats as $exportFormat): ?> + <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> + <?=$block?> + <?php endif; ?> + </div> + + <div class="record_actions -secondary"> + <a + class="record_action" + data-lightbox + href="<?=$this->recordLink()->getActionUrl($this->driver, 'Cite')?>" + rel="nofollow" + > + <?=$this->icon('small/quote')?> + <?=$this->transEsc('Cite this')?> + </a> + + <?php /* + <a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="<?=$this->url('librarycards-deletecard') ?>?cardID=<?=urlencode($record['id'])?>"> + <i class="fa fa-trash-o" aria-hidden="true"></i> <?=$this->transEsc('Delete')?> + </a> + <ul class="dropdown-menu"> + <li><a href="<?=$this->url('librarycards-deletecard') ?>?cardID=<?=urlencode($record['id'])?>&confirm=1"><?=$this->transEsc('confirm_dialog_yes') ?></a></li> + <li><a href="#"><?=$this->transEsc('confirm_dialog_no')?></a></li> + </ul> + */ ?> + + <?php $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?> + <?php if (count($exportFormats) > 0): ?> + <!-- TODO: ARIA --> + <a class="record_action dropdown-toggle" href="javascript:;" role="button" data-toggle="dropdown"> + <?=$this->icon('small/download')?> + <?=$this->transEsc('Export')?> + </a> + <!-- TODO: Dropdown --> + <ul class="dropdown-menu -right" role="menu"> + <?php 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> + <a <?php if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" + <?php 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; ?> + <?php endforeach; ?> </ul> - </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> - </li> - <? 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; ?> - <li class="bookbag-menu"> - <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]); ?> - </li> - <li> - <a href="javascript:window.print()"><i class="fa fa-printer" aria-hidden="true"></i> <?=$this->transEsc('Print')?></a> - </li> - <li> - <a id="permalink" href="<?=$this->url('record', ['action' => 'record', 'id' => $this->driver->getUniqueId()], ['force_canonical' => true])?>"><i class="fa fa-copy" aria-hidden="true"></i> <?=$this->transEsc('Permalink')?></a> - </li> - <li> - <a class="feedbackLink item" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'ReportErrors')?>" rel="nofollow"><i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('ReportErrors')?></a> - </li> - <li> - <a class="feedbackLink item" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Acquisition')?>" rel="nofollow"><i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Book Suggestion')?></a> - </li> -</ul> -<script> - document.getElementById('permalink').onclick=function(e){ - e.preventDefault(); - var $temp = $("<input>"); - $("body").append($temp); - $temp.val($(this).attr("href").trim()).select(); - document.execCommand("copy"); - alert("<?=$this->translate('copied_link_to_clipboard')?>"); - $temp.remove(); - } -</script> + <?php endif; ?> + + <a + class="record_action" + data-lightbox + href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" + rel="nofollow" + > + <?=$this->icon('small/mail')?> + <?=$this->transEsc('Email this')?> + </a> + + <a class="record_action" href="javascript:window.print()"> + <?=$this->icon('small/printer')?> + <?=$this->transEsc('Print')?> + </a> + </div> +</div> <!-- fid_bbi: recordDriver - DefaultRecord - toolbar - END --> diff --git a/themes/fid_bbi/templates/RecordDriver/SolrAI/core.phtml b/themes/fid_bbi/templates/RecordDriver/SolrAI/core.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f02d93006daf8230fefc3996628b0a71efed2fa4 --- /dev/null +++ b/themes/fid_bbi/templates/RecordDriver/SolrAI/core.phtml @@ -0,0 +1,2 @@ +<?php +echo $this->render('RecordDriver/DefaultRecord/core.phtml'); diff --git a/themes/fid_bbi/templates/RecordDriver/SolrMarc/core.phtml b/themes/fid_bbi/templates/RecordDriver/SolrMarc/core.phtml index 62626dd26dfbe69bb44f22a2a164cd03afa77db6..f02d93006daf8230fefc3996628b0a71efed2fa4 100644 --- a/themes/fid_bbi/templates/RecordDriver/SolrMarc/core.phtml +++ b/themes/fid_bbi/templates/RecordDriver/SolrMarc/core.phtml @@ -1,80 +1,2 @@ -<!-- fid_bbi: RecordDriver - SolrMarc - core --> -<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> - <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> - <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> - <?php - $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(); - ?> - <?php if ($QRCode || $cover || $preview): ?> - <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> - <?php /* Display thumbnail if appropriate: */ ?> - <?php if($cover): ?> - <?=$cover?> - <?php /* BOF - finc-specific StyleBasedIcons */ ?> - <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> - <?=$this->record($this->driver)->getFormatIcon()?> - <?php /* EOF - finc-specific StyleBasedIcons */ ?> - <?php endif; ?> - - <?php /* Display qrcode if appropriate: */ ?> - <?php if($QRCode): ?> - <span class="hidden-xs"> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> - </span> - <?php endif; ?> - - <?php // 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) ?> - <?php if ($preview): ?> - <div class="record-previews"> - <?=$preview?> - </div> - <?php endif; ?> - </div> - <?php endif; ?> - <div class="media-body"> - - <?php /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars; - in finc: keep schema name tag here!! #13861 - CK - */ - ?> - <?php /* fid_bbi: show solr field title with blanks before and after semicolon - semicolon between 245 a and b #15534 - RL */ ?> - <h3 property="name"><?=$this->escapeHtml(preg_replace(['/(\s[\/\.:]\s*)*$/', '/(\s*):(\s*)/'], ['', ' : '], $this->truncate($this->driver->getTitle(), 170)))?></h3> - <?/* fid_bbi: #15189 remove summary - GG */ ?> - - <?php if ($this->userlist()->getMode() !== 'disabled'): ?> - <?php /* Display the lists that this record is saved to */ ?> - <div class="savedLists hidden alert alert-info"> - <strong><?=$this->transEsc("Saved in")?>:</strong> - </div> - <?php endif; ?> - - <?php /* Display Main Details */ ?> - <?php - $formatter = $this->recordDataFormatter(); - $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-marc')); - ?> - <?php if (!empty($coreFields)): ?> - <table class="table table-striped"> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> - <?php foreach ($coreFields as $current): ?> - <?php if (is_null($current['label'])): ?> - <?=$current['value']?> - <?php else: ?> - <tr> - <th><?=$this->transEsc($current['label'])?>:</th> - <td><?=$current['value']?></td> - </tr> - <?php endif; ?> - <?php endforeach; ?> - </table> - <?php endif; ?> - <?php /* End Main Details */ ?> - </div> -</div> -<!-- fid_bbi: RecordDriver - SolrMarc - core - END --> +<?php +echo $this->render('RecordDriver/DefaultRecord/core.phtml'); diff --git a/themes/fid_bbi/templates/RecordTab/description.phtml b/themes/fid_bbi/templates/RecordTab/description.phtml new file mode 100644 index 0000000000000000000000000000000000000000..5befe295bb950c1b9beff094dfc6dd8349dd4b40 --- /dev/null +++ b/themes/fid_bbi/templates/RecordTab/description.phtml @@ -0,0 +1,33 @@ +<!-- fid_bbi: RecordTab - description --> +<?php +/* + * Based on themes/finc/templates/RecordTab/DefaultRecord/description.phtml + * + * BBI specific changes: + * - Using <dl> elements instead of <table> to match template + * RecordDriver/DefaultRecord/core.phtml + * + * @author: Tobias Schäfer <ts@aspectis.net> + */ + +$this->headTitle($this->driver->getBreadcrumb()); + +// List gets filled via recordDriver/.../data-... templates as referenced in +// RecordDataFormatterFactory +$formatter = $this->recordDataFormatter(); +$mainFields = $formatter->getData($driver, $formatter->getDefaults('description')); +?> + +<?php if (!empty($mainFields)): ?> + <dl> + <?php foreach ($mainFields as $current): ?> + <?php if (!empty($current['label'])): ?> + <dt><?=$this->transEsc($current['label'])?></dt> + <?php endif; ?> + <dd><?=$current['value']?></dd> + <?php endforeach; ?> + </dl> +<?php else: ?> + <p><?=$this->transEsc('no_description')?></p> +<?php endif; ?> +<!-- fid_bbi: RecordTab - description - END --> diff --git a/themes/fid_bbi/templates/record/cart-buttons.phtml b/themes/fid_bbi/templates/record/cart-buttons.phtml index 53a18cebf59fb708476802cc26876f33dde7e289..9b58ece3c8f4fd577a2c2abc93864acd428b4c3a 100644 --- a/themes/fid_bbi/templates/record/cart-buttons.phtml +++ b/themes/fid_bbi/templates/record/cart-buttons.phtml @@ -14,7 +14,7 @@ </div> </a> <a class="cart-remove hidden<?php if ($cart->contains($cartId)): ?> correct<?php endif ?>" href="javascript:;"> - <?=$this->icon('small/pin')?> + <?=$this->icon('small/pin', 'icon -beat')?> <div class="tooltip"> <?=$this->transEsc('Remove from Book Bag')?> </div> diff --git a/themes/fid_bbi/templates/record/save.phtml b/themes/fid_bbi/templates/record/save.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e4d4a8ca83d59f56612f402133f9f52b433cfdd0 --- /dev/null +++ b/themes/fid_bbi/templates/record/save.phtml @@ -0,0 +1,62 @@ +<!-- fid_bbi - templates - record - save --> +<?php +$this->headTitle($this->translate('Save')); +?> + +<h2><?=$this->translate('Add to Favorites')?></h2> + +<h3><?=$this->driver->getTitle()?></h3> + +<form class="form-record-save" method="post" action="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" name="saveRecord" data-lightbox-onclose="checkSaveStatusesCallback"> + <input type="hidden" name="submit" value="1" /> + <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId()) ?>" /> + <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" /> + <?php if (!empty($this->containingLists)): ?> + <p><?=$this->transEsc('This item is already part of the following list/lists') ?>: + <?php foreach ($this->containingLists as $i => $list): ?> + <a href="<?=$this->url('userList', ['id' => $list['id']]) ?>" data-lightbox-ignore><?=$this->escapeHtml($list['title'])?></a><?php if($i < count($this->containingLists) - 1): ?>, <?php endif; ?> + <?php endforeach; ?> + </p><hr/> + <?php endif; ?> + + <?php + $showLists = !empty($this->nonContainingLists) + || (empty($this->containingLists) && empty($this->nonContainingLists)); + ?> + + <div class="form-group"> + <?php if ($showLists): ?> + <label class="control-label" for="save_list"><?=$this->transEsc('Choose a List') ?></label> + <?php endif; ?> + <?php if ($showLists): ?> + <select class="form-control" id="save_list" name="list"> + <?php if ($this->nonContainingLists): ?> + <?php foreach ($this->nonContainingLists as $list): ?> + <option value="<?=$list['id'] ?>"<?php if ($list['id'] == $this->userlist()->lastUsed()): ?> selected="selected"<?php endif; ?>><?=$this->escapeHtml($list['title'])?></option> + <?php endforeach; ?> + <?php else: ?> + <option value=""><?=$this->transEsc('My Favorites') ?></option> + <?php endif; ?> + </select> + <?php endif; ?> + <a class="btn btn-link" id="make-list" href="<?=$this->url('editList', ['id' => 'NEW'])?>?recordId=<?=urlencode($this->driver->getUniqueId())?>&recordSource=<?=urlencode($this->driver->getSourceIdentifier())?>"><?=$showLists ? $this->transEsc('or create a new list') : $this->transEsc('Create a List'); ?></a> + </div> + + <?php if ($showLists): ?> + <?php if ($this->usertags()->getMode() !== 'disabled'): ?> + <div class="form-group"> + <label class="control-label" for="add_mytags"><?=$this->transEsc('Add Tags') ?></label> + <input class="form-control" id="add_mytags" type="text" name="mytags" value=""/> + <span class="help-block"><?=$this->transEsc("add_tag_note") ?></span> + </div> + <?php endif; ?> + <div class="form-group"> + <label class="control-label" for="add_notes"><?=$this->transEsc('Add a Note') ?></label> + <textarea class="form-control" id="add_notes" name="notes" rows="3"></textarea> + </div> + <div class="form-group"> + <input class="btn btn-primary" type="submit" value="<?=$this->transEsc('Save') ?>"/> + </div> + <?php endif; ?> +</form> +<!-- fid_bbi - templates - record - save - END --> diff --git a/themes/fid_bbi/templates/record/taglist.phtml b/themes/fid_bbi/templates/record/taglist.phtml index 1a1084abe17eb0914f658cb81a964b82970aca4c..5c20bff0dc3e856bc24f3047832cbd28c0bd8341 100644 --- a/themes/fid_bbi/templates/record/taglist.phtml +++ b/themes/fid_bbi/templates/record/taglist.phtml @@ -1,31 +1,42 @@ <!-- fid_bbi: record - taglist --> -<?php /* this is mostly a copy of the bootstrap3 version */?> -<div class="tagList<?=$loggedin ? ' loggedin' : ''?>"> +<div class="tags<?=$loggedin ? ' -loggedin' : ''?>"> <?php if (count($tagList) > 0): ?> <?php foreach ($tagList as $tag): ?> - <?php $is_me = isset($tag['is_me']) && null !== $tag['is_me'] ? $tag['is_me'] : false; - $is_others = !$is_me || ($tag['cnt'] > 1); - ?> - <div class="tag"> - <?php if ($is_me): ?><i class="tag-icon tagged-by-me" title="<?=$this->translate('tagged_by_you')?>"></i><?php endif;?> - <?php if ($is_others): ?><i class="tag-icon tagged-by-others" title="<?=$this->translate('tagged_by_others')?>"></i><?php endif;?> - <a href="<?=$this->url('tag-home')?>?lookfor=<?=urlencode($tag['tag'])?>"><?=$this->escapeHtml($tag['tag'])?></a> - <?php if($loggedin): ?> - <form method="POST" action="<?=$this->recordLink()->getActionUrl($this->driver, $is_me ? 'DeleteTag' : 'AddTag') ?>" class="tag-form"> - <input type="hidden" name="tag" value="<?=$this->escapeHtmlAttr($tag['tag'])?>"/> - <button type="submit" class="badge" onClick="ajaxTagUpdate(this, '<?=$this->escapeHtmlAttr($tag['tag'])?>', <?=$is_me ? 'true' : 'false' ?>);return false;"> - <?php if($is_me): ?> - <i class="fa fa-close" title="<?=$this->transEsc('delete_tag') ?>"></i> - <?php else: ?> - <i class="fa fa-plus" title="<?=$this->transEsc('confirm_tag') ?>"></i> - <?php endif; ?> + <div class="tags_item"> + <a href="<?=$this->url('tag-home')?>?lookfor=<?=urlencode($tag['tag'])?>"> + <?=$this->escapeHtml($tag['tag'])?> + </a> + + <?php $taggedByCurrentUser = isset($tag['is_me']) && null !== $tag['is_me'] ? $tag['is_me'] : false; ?> + <?php if ($taggedByCurrentUser): ?> + (<?=$this->translate('tagged_by_you')?>) + <?php endif; ?> + + <?php if ($loggedin): ?> + <form + method="POST" + action="<?=$this->recordLink()->getActionUrl($this->driver, $taggedByCurrentUser ? 'DeleteTag' : 'AddTag')?>" + class="tags_form" + > + <input type="hidden" name="tag" value="<?=$this->escapeHtmlAttr($tag['tag'])?>"> + <?php $buttonLabel = $this->transEsc($taggedByCurrentUser ? 'delete_tag' : 'confirm_tag'); ?> + <button + class="tags_button" + type="submit" + onClick="ajaxTagUpdate(this, '<?=$this->escapeHtmlAttr($tag['tag'])?>', <?=$taggedByCurrentUser ? 'true' : 'false'?>); return false;" + aria-label="<?=$buttonLabel?>" + title="<?=$buttonLabel?>" + > + <?php if ($taggedByCurrentUser): ?> + <?=$this->icon('small/x')?> + <?php else: ?> + <?=$this->icon('small/checkmark')?> + <?php endif; ?> </button> </form> <?php endif; ?> </div> <?php endforeach; ?> - <?php else: ?> - <?=$this->transEsc('No Tags')?>, <?=$this->transEsc('Be the first to tag this record')?>! <?php endif; ?> </div> -<!-- fid_bbi: record - taglist - END --> \ No newline at end of file +<!-- fid_bbi: record - taglist - END --> diff --git a/themes/fid_bbi/templates/record/view.phtml b/themes/fid_bbi/templates/record/view.phtml index 396bf6efee0a62a24b433ea023b2a01fffe85817..a05fb9f1c871bbc53b952394723a0359e2bc9b4c 100644 --- a/themes/fid_bbi/templates/record/view.phtml +++ b/themes/fid_bbi/templates/record/view.phtml @@ -1,136 +1,90 @@ <!-- fid_bbi: record - view --> <?php -// Set up standard record scripts: +// Set up standard record scripts $this->headScript()->appendFile("record.js"); $this->headScript()->appendFile("check_save_statuses.js"); -// Activate Syndetics Plus if necessary: + +// Activate Syndetics Plus if necessary if ($this->syndeticsPlus()->isActive()) { $this->headScript()->appendFile($this->syndeticsPlus()->getScript()); } -// Add RDF header link if applicable: +// Add RDF header link if applicable if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) { - $this->headLink()->appendAlternate($this->recordLink()->getActionUrl($this->driver, 'RDF'), 'application/rdf+xml', 'RDF Representation'); + $this->headLink()->appendAlternate( + $this->recordLink()->getActionUrl($this->driver, 'RDF'), + 'application/rdf+xml', + 'RDF Representation' + ); } - -// Set up breadcrumbs: -$this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') . - '<li class="active">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> '; -$this->layout()->title = $this->driver->getShortTitle(); ?> -<?php if (isset($this->scrollData) && isset($this->scrollData['currentPosition'])): ?> - <?=$this->searchMemory()->getAnchoredSearchLink($this->transEsc('back_to_result_list'),'jump'.$this->scrollData['currentPosition'])?> -<?php endif; ?> - <?php if (isset($this->scrollData) && ($this->scrollData['previousRecord'] || $this->scrollData['nextRecord'])): ?> - <?php - /* Pager is identical to pager in collection - view! - Keep .left/.right classes for alignment on left/right edge - CK */ - ?> - <ul class="pager hidden-print"> - <?php if ($this->scrollData['previousRecord']): ?> - <?php if ($this->scrollData['firstRecord']): ?> - <li class="left"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['firstRecord'])?>" title="<?=$this->transEsc('First Search Result')?>" rel="nofollow">« <?=$this->transEsc('First')?></a> - </li> - <?php endif; ?> - <li class="left"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['previousRecord'])?>" title="<?=$this->transEsc('Previous Search Result')?>" rel="nofollow">« <?=$this->transEsc('Prev')?></a> - </li> - <?php else: ?> - <?php if ($this->scrollData['firstRecord']): ?> - <li class="disabled left"><a href="#">« <?=$this->transEsc('First')?></a></li> - <?php endif; ?> - <li class="disabled left"><a href="#">« <?=$this->transEsc('Prev')?></a></li> - <?php endif; ?> - <?php - /* finc-specific wrapping: li + hidden-xs for consistency - CK */ - ?> - <li class="hidden-xs"> - <?=$this->transEsc('of_num_results', [ - '%%position%%' => $this->localizedNumber($this->scrollData['currentPosition']), - '%%total%%' => $this->localizedNumber($this->scrollData['resultTotal']) - ]) ?> - </li> - <?php if ($this->scrollData['nextRecord']): ?> - <li class="right"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['nextRecord'])?>" title="<?=$this->transEsc('Next Search Result')?>" rel="nofollow"><?=$this->transEsc('Next')?> »</a> - </li> - <?php if ($this->scrollData['lastRecord']): ?> - <li class="right"> - <a href="<?=$this->recordLink()->getUrl($this->scrollData['lastRecord'])?>" title="<?=$this->transEsc('Last Search Result')?>" rel="nofollow"><?=$this->transEsc('Last')?> »</a> - </li> - <?php endif; ?> - <?php else: ?> - <li class="disabled right"><a href="#"><?=$this->transEsc('Next')?> »</a></li> - <?php if ($this->scrollData['lastRecord']): ?> - <li class="disabled right"><a href="#"><?=$this->transEsc('Last')?> »</a></li> - <?php endif; ?> - <?php endif; ?> - </ul> - <?php endif; ?> - - <?=$this->record($this->driver)->getToolbar()?> +<div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>"> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId"/> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/> + <?=$this->flashmessages()?> + <?=$this->record($this->driver)->getCoreMetadata()?> - <div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>"> - <?php /* finc: remove related-sidebar count and "solo" class since we use a custom sidebar, - keep print classes, CK */ ?> - <?php $sidebarList = $this->related()->getList($this->driver); ?> - <div class="<?=$this->layoutClass('mainbody')?> print-full-width"> - <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId"/> - <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/> - <?=$this->flashmessages()?> - <?=$this->record($this->driver)->getCoreMetadata()?> + <?php + // TODO: Tabs should have `aria-controls` and `aria-selected` attributes, + // but this would require extending the bootstrap3 theme script files. + ?> + <?php if (count($this->tabs) > 0): ?> + <div class="record-tabs"> + <?php // NOTE: Class "nav-tabs" is required by Bootstrap JS ?> + <ul class="tabs_header nav-tabs"> + <?php foreach ($this->tabs as $tab => $obj): ?> + <?php + $desc = $obj->getDescription(); + $tabName = preg_replace("/\W/", "-", strtolower($tab)); + $tabClasses = [ 'record-tab', $tabName ]; + if (strcasecmp($this->activeTab, $tab) === 0) { + if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) { + $tabClasses[] = 'active'; + } + $tabClasses[] = 'initiallyActive'; + $activeTabObj = $obj; - <?php if (count($this->tabs) > 0): ?> - <a name="tabnav"></a> - <div class="record-tabs"> - <ul class="nav nav-tabs"> - <?php foreach ($this->tabs as $tab => $obj): ?> - <?php // add current tab to breadcrumbs if applicable: - $desc = $obj->getDescription(); - $tabName = preg_replace("/\W/", "-", strtolower($tab)); - $tabClasses = [ 'record-tab', $tabName ]; - if (0 === strcasecmp($this->activeTab, $tab)) { - if (!$this->loadInitialTabWithAjax || !$obj->supportsAjax()) { - $tabClasses[] = 'active'; - } - $tabClasses[] = 'initiallyActive'; - $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>'; - $activeTabObj = $obj; - } - if (!$obj->isVisible()) { $tabClasses[] = 'hidden'; } - if (!$obj->supportsAjax()) { $tabClasses[] = 'noajax'; } - ?> - <li class="<?=implode(' ', $tabClasses)?>" data-tab="<?=$tabName?>"> - <a href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav"<?php if ($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)):?> data-background<?php endif ?>><?=$this->transEsc($desc)?></a> - </li> - <?php endforeach; ?> - </ul> + // NOTE: This is not only used for breadcrumbs (which are not + // displayed by this theme), but also for the page title. + $this->layout()->breadcrumbs .= '<li class="active">' . $this->transEsc($desc) . '</li>'; + } + if (!$obj->isVisible()) { $tabClasses[] = 'hidden'; } + if (!$obj->supportsAjax()) { $tabClasses[] = 'noajax'; } + ?> + <li id="<?=$tabName?>-control" class="<?=implode(' ', $tabClasses)?>" data-tab="<?=$tabName?>"> + <a + href="<?=$this->recordLink()->getTabUrl($this->driver, $tab)?>#tabnav" + <?=($obj->supportsAjax() && in_array($tab, $this->backgroundTabs)) ? ' data-background' : ''?> + > + <?=$this->transEsc($desc)?> + </a> + </li> + <?php endforeach; ?> + </ul> - <div class="tab-content"> - <?php if (!$this->loadInitialTabWithAjax || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?> - <div class="tab-pane active <?=$this->escapeHtmlAttr($this->activeTab) ?>-tab"> - <?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : ''?> - </div> - <?php endif; ?> + <div class="tab-content"> + <?php if (!$this->loadInitialTabWithAjax || !isset($activeTabObj) || !$activeTabObj->supportsAjax()): ?> + <div + class="tab-pane active <?=$this->escapeHtmlAttr($this->activeTab)?>-tab" + aria-labelledby="<?=$this->escapeHtmlAttr($this->activeTab)?>-control" + > + <?=isset($activeTabObj) ? $this->record($this->driver)->getTab($activeTabObj) : ''?> </div> - </div> - <?php endif; ?> - - <?=$this->driver->supportsCoinsOpenURL() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>' : ''?> + <?php endif; ?> + </div> </div> + <?php endif; ?> + <?=$this->driver->supportsCoinsOpenURL() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>' : ''?> - <div class="<?=$this->layoutClass('sidebar')?>"> - <?php /* finc-specific: add toolbar to sidebar - CK ?> - <?=$this->record($this->driver)->getToolbar() */ ?> - - <?php foreach ($sidebarList as $current): ?> - <?=$this->related()->render($current)?> - <?php endforeach; ?> - </div> + <div class="<?=$this->layoutClass('sidebar')?>"> + <?php $sidebarList = $this->related()->getList($this->driver); ?> + <?php foreach ($sidebarList as $current): ?> + <?=$this->related()->render($current)?> + <?php endforeach; ?> </div> +</div> - <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET');?> - <!-- fid_bbi: record - view - END --> +<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET');?> +<!-- fid_bbi: record - view - END -->