/
result-list.phtml
189 lines (176 loc) · 9.2 KB
/
result-list.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
<div class="<?=$this->driver->supportsAjaxStatus()?'ajaxItem ':''?>col-xs-11">
<div class="row">
<div>
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" />
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" class="hiddenSource" />
</div>
<? $cover = $this->record($this->driver)->getCover('result-list', 'medium', $this->recordLink()->getUrl($this->driver)); ?>
<? if ($cover): ?>
<div class="col-sm-2 col-xs-3 left">
<?=$cover ?>
</div>
<div class="col-sm-7 col-xs-6 middle">
<? else : ?>
<div class="col-sm-9 col-xs-9 middle">
<? endif ?>
<div>
<a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title">
<?=$this->record($this->driver)->getTitleHtml()?>
</a>
</div>
<div>
<? if($this->driver->isCollection()): ?>
<?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary())); ?>
<? else: ?>
<? $summAuthor = $this->driver->getPrimaryAuthor(); if (!empty($summAuthor)): ?>
<?=$this->transEsc('by')?>
<a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>"><?
$summHighlightedAuthor = $this->driver->getHighlightedAuthor();
echo !empty($summHighlightedAuthor)
? $this->highlight($summHighlightedAuthor)
: $this->escapeHtml($summAuthor);
?></a>
<? endif; ?>
<? $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublicationDates(); ?>
<? if (!empty($journalTitle)): ?>
<?=!empty($summAuthor) ? '<br />' : ''?>
<?=$this->transEsc('Published in')?>
<? $containerID = $this->driver->getContainerRecordID(); ?>
<? /* TODO: handle highlighting more elegantly here: */?>
<a href="<?=($containerID ? $this->recordLink()->getUrl("VuFind|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)))?>"><?=$this->highlight($journalTitle) ?></a>
<?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?>
<? elseif (!empty($summDate)): ?>
<?=!empty($summAuthor) ? '<br />' : ''?>
<?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate[0])?>
<? endif; ?>
<? $summInCollection = $this->driver->getContainingCollections(); if (!empty($summInCollection)): ?>
<? foreach ($summInCollection as $collId => $collText): ?>
<div>
<b><?=$this->transEsc("in_collection_label")?></b>
<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; ?>
<? endif; ?>
<? endif; ?>
<?
/* Display information on duplicate records if available */
$dedupData = $this->driver->getDedupData();
if ($dedupData): ?>
<div class="dedupInformation">
<?
$i = 0;
foreach ($dedupData as $source => $current) {
if (++$i == 1) {
?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", array(), $source)?></a></span><?
} else {
if ($i == 2) {
?> <span class="otherSources">(<?=$this->transEsc('Other Sources')?>: <?
} else {
?>, <?
}
?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", array(), $source)?></a><?
}
}
if ($i > 1) {
?>)</span><?
}?>
</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">
<?=$this->transEsc('Loading')?>...<br/>
</span>
<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; ?>
<? endif; ?>
</div>
<? /* 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);
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"></i> <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?></a><br/>
<? endforeach; ?>
<? endif; ?>
<? endif; ?>
<?=str_replace('class="', 'class="label label-info ', $this->record($this->driver)->getFormatList())?>
<? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?>
<span class="status ajax-availability hidden">
<span class="label label-default"><?=$this->transEsc('Loading')?>...</span>
</span>
<? endif; ?>
<?=$this->record($this->driver)->getPreviews()?>
</div>
<div class="col-xs-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">
<i class="fa fa-fw fa-qrcode"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
<div class="qrcode hidden">
<script type="text/template" class="qrCodeImgTag">
<img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
</script>
</div><br/>
</span>
<? endif; ?>
<? if ($this->userlist()->getMode() !== 'disabled'): ?>
<? /* Add to favorites */ ?>
<i class="fa fa-fw fa-star"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record modal-link" id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/>
<? /* Saved lists */ ?>
<div class="savedLists alert alert-info hidden">
<strong><?=$this->transEsc("Saved in")?>:</strong>
</div>
<? endif; ?>
<? /* Hierarchy tree link */ ?>
<? $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" />
<i class="fa fa-fw fa-sitemap"></i>
<a class="hierarchyTreeLinkText modal-link" href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>">
<?=$this->transEsc('hierarchy_view_context')?><? 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>
</div>
</div>