/
core.phtml
270 lines (247 loc) · 11.3 KB
/
core.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<?
if($loggedin = $this->auth()->isLoggedIn()) {
$user_id = $loggedin->id;
$loggedin = true;
} else {
$user_id = false;
}
?>
<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(); ?>
<? if ($QRCode || $cover || $preview): ?>
<div class="col-sm-3">
<div class="text-center">
<? /* Display thumbnail if appropriate: */ ?>
<? 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>
<? 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">
<? else: ?>
<div class="col-sm-12">
<? endif; ?>
<h3 property="name"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection())?></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')?>#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" id="savedLists">
<strong><?=$this->transEsc("Saved in")?>:</strong>
</div>
<? endif; ?>
<?/* Display Main Details */?>
<table class="table table-striped" summary="<?=$this->transEsc('Bibliographic Details')?>">
<? $journalTitle = $this->driver->getContainerTitle(); if (!empty($journalTitle)): ?>
<tr>
<th><?=$this->transEsc('Published in')?>:</th>
<td>
<? $containerID = $this->driver->getContainerRecordID(); ?>
<a href="<?=($containerID ? $this->recordLink()->getUrl("VuFind|$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; ?>
<? $authors = $this->driver->getDeduplicatedAuthors(); ?>
<? if (isset($authors['main']) && !empty($authors['main'])): ?>
<tr>
<th><?=$this->transEsc('Main Author')?>: </th>
<td property="author"><a href="<?=$this->record($this->driver)->getLink('author', $authors['main'])?>"><?=$this->escapeHtml($authors['main'])?></a></td>
</tr>
<? endif; ?>
<? if (isset($authors['corporate']) && !empty($authors['corporate'])): ?>
<tr>
<th><?=$this->transEsc('Corporate Author')?>: </th>
<td property="creator"><a href="<?=$this->record($this->driver)->getLink('author', $authors['corporate'])?>"><?=$this->escapeHtml($authors['corporate'])?></a></td>
</tr>
<? endif; ?>
<? if (isset($authors['secondary']) && !empty($authors['secondary'])): ?>
<tr>
<th><?=$this->transEsc('Other Authors')?>: </th>
<td>
<? $i = 0; foreach ($authors['secondary'] as $field): ?><?=($i++ == 0)?'':', '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $field)?>"><?=$this->escapeHtml($field)?></a></span><? endforeach; ?>
</td>
</tr>
<? endif; ?>
<? $formats = $this->driver->getFormats(); if (!empty($formats)): ?>
<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>
<td>
<? foreach ($publications 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>
<? $pubDate = $field->getDate(); if (!empty($pubDate)): ?>
<span property="publicationDate"><?=$this->escapeHtml($pubDate)?></span>
<? endif; ?>
<br/>
<? endforeach; ?>
</td>
</tr>
<? endif; ?>
<? $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. */?>
<? $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="subjectLine" property="keywords">
<? $subject = ''; ?>
<? if(count($field) == 1) $field = explode('--', $field[0]); ?>
<? $i = 0; foreach ($field as $subfield): ?>
<?=($i++ == 0) ? '' : ' > '?>
<? $subject = trim($subject . ' ' . $subfield); ?>
<a class="backlink" 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 id="tagRecord" class="btn btn-link modal-link pull-right flip" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" title="<?=$this->transEsc('Add Tag')?>">
<i class="fa fa-plus"></i> <?=$this->transEsc('Add Tag')?></a>
</a>
<?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?>
</td>
</tr>
<? endif; ?>
</table>
<?/* End Main Details */?>
</div>
</div>