This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
forked from vufind-org/vufind
-
Notifications
You must be signed in to change notification settings - Fork 7
/
holdingsils.phtml
134 lines (112 loc) · 5.96 KB
/
holdingsils.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
/** @var Swissbib\RecordDriver\SolrMarc $record */
$record = $this->driver;
$titleStatement = $record->getTitleStatement(true);
/** @var Swissbib\View\Helper\Record $viewRecord */
$viewRecord = $this->record($record);
$responsible = $viewRecord->getResponsible($titleStatement, $record);
$formats = $record->getFormats();
//for the head title
$extendedTitle = '';
if (!empty($responsible)) {
$extendedTitle .= ' / ' . $responsible;
}
if (isset($formats) and isset($formats[0])) {
$extendedTitle .= ' (' . $this->laminasTranslate($formats[0], 'formats') . ')';
}
$extendedTitle .= '. ';
$holdings = $record->getHoldingsStructure();
// Copy favorites to own container
$holdings = $this->extractFavoriteInstitutionsForHoldings($holdings);
// Set page title.
$this->headTitle('swissbib : ' . $this->driver->getBreadcrumb() . $extendedTitle);
?>
<?php if ($holdings): ?>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<?php foreach ($holdings as $groupCode => $group): ?>
<?php $groupNetworkCode = $group['networkCode'] ?? 'dummy'; ?>
<!-- begin: group <?= $groupCode ?> -->
<div class="panel panel-default" id="holdings-<?= $groupCode ?>">
<!-- begin: group heading -->
<div class="panel-heading" role="tab" id="heading-<?= $groupCode ?>">
<h3 class="panel-title">
<a data-toggle="collapse" href="#collapse-<?= $groupCode ?>" aria-expanded="false" aria-controls="collapse-<?= $groupCode ?>">
<?php if (is_array($group['label'])): ?>
<?php $group['label'] = implode('', array_unique($group['label'])); ?>
<?php endif; ?>
<?php if ($group['label'] == 'mylibraries'): ?>
<span><?= $this->laminasTranslate($group['label']) ?></span>
<?php else: ?>
<span><?= $this->laminasTranslate($group['label'], 'group') ?></span>
<?php endif; ?>
</a>
</h3>
</div>
<!-- end: group heading -->
<!-- begin: group content -->
<div id="collapse-<?= $groupCode ?>" level="1" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-<?= $groupCode ?>">
<div class="list-group">
<?php
$translatedInstitutions = [];
foreach ($group['institutions'] as $index => $institution) {
$institution['translatedInstitution'] = $this->escapeHtml($this->laminasTranslate($institution['label'], 'institution'));
$translatedInstitutions[$index] = $institution;
}
$translatedInstitutions = $this->displayNameSorter($translatedInstitutions, "translatedInstitution");
?>
<div class="panel-group" id="institutions-<?= $groupCode ?>" role="tablist" aria-multiselectable="true">
<?php foreach ($translatedInstitutions as $institutionCode => $institution): ?>
<!-- begin: institution <?= $institutionCode ?>-->
<div class="panel panel-default institutionBox institution-<?= $institutionCode ?>-box" id="holding-institution-<?= $groupCode ?>-<?= $institutionCode ?>-box">
<!-- begin: institution heading -->
<div class="panel-heading" role="tab" id="heading-<?= $groupCode ?>-<?= $institutionCode ?>">
<h4 class="panel-title clearfix">
<div class="miniactions miniactions-<?= $institutionCode ?> pull-right">
<div class="institutionFavorite">
<a href="javascript:void(0)" title="<?php if (isset($institution['favorite']) && $institution['favorite']): ?> <?= $this->transEsc('mylibraries.remove')?> <?php else: ?> <?= $this->transEsc('mylibraries.add')?> <?php endif; ?>"></a>
</div>
</div>
<a data-toggle="collapse" href="#collapse-<?= $groupCode ?>-<?= $institutionCode ?>" aria-expanded="false" aria-controls="collapse-<?= $groupCode ?>-<?= $institutionCode ?>"
id="holding-institution-<?= $groupCode ?>-<?= $institutionCode ?>" data-expandlibGroup="<?= $groupNetworkCode . '-' . $institutionCode ?>" class="toggler institutionToggler">
<?= $this->escapeHtml($this->laminasTranslate($institution['label'], 'institution')) ?>
</a>
</h4>
</div>
<!-- end: institution heading -->
<!-- begin: institution content -->
<div id="collapse-<?= $groupCode ?>-<?= $institutionCode ?>" level="2" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-<?= $groupCode ?>-<?= $institutionCode ?>">
<div class="panel-body">
<!--begin: holdings-table -->
<div class="holding-institution-<?= $groupCode ?>-<?= $institutionCode ?>" id="holding-institution-<?= $institutionCode ?>">
<div class="holdingsAjaxSpinner holding-ajax-spinner-<?= $groupCode ?>-<?= $institutionCode ?>">
<i class="fa fa-spinner fa-spin"></i>
<span>Loading...</span>
</div>
</div>
<!--end: holdings-table -->
</div>
</div>
<!-- end: institution content -->
</div>
<!-- end: institution <?= $institutionCode ?> -->
<?php endforeach; ?>
</div>
</div>
</div>
<!-- end: group content -->
</div>
<!-- end: group <?= $groupCode ?> -->
<?php endforeach; ?>
</div>
<div id="holdings-items-popup" style="display:none">
Loading...
</div>
<script type="text/javascript">
swissbib.Holdings.initRecord('<?=$record->getUniqueID()?>');
swissbib.HoldingFavorites.initRecord('<?=$record->getUniqueID()?>');
swissbib.Accordion.initRecord('<?=$record->getUniqueID()?>');
vufindString.favoriteReload = '<?=$this->transEsc('mylibraries.reload')?>';
</script>
<?php else: ?>
<?= $this->render('RecordTab/holdingils-noholdings') ?>
<?php endif; ?>