/
list-entry.phtml
120 lines (113 loc) · 5.85 KB
/
list-entry.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
<?
// Set up some convenience variables:
$id = $this->driver->getUniqueId();
$source = $this->driver->getResourceSource();
if (isset($this->list) && is_object($this->list)) {
$list_id = $this->list->id;
$user_id = $this->list->user_id;
} else {
$list_id = null;
$user_id = $this->user ? $this->user->id : null;
}
?>
<div class="listentry recordId source<?=$this->escapeHtmlAttr($source)?><?=$this->driver->supportsAjaxStatus()?' ajaxItemId':''?>" id="record<?=$this->escapeHtmlAttr($id)?>">
<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId" />
<? $cover = $this->record($this->driver)->getCover('list-entry', 'small'); ?>
<? if ($cover): ?>
<div class="span-2">
<?=$cover?>
</div>
<div class="span-10">
<? else: ?>
<div class="span-12">
<? endif; ?>
<a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title">
<?=$this->record($this->driver)->getTitleHtml()?>
</a><br/>
<? $listAuthor = $this->driver->getPrimaryAuthor(); if (!empty($listAuthor)): ?>
<?=$this->transEsc('by')?>:
<a href="<?=$this->record($this->driver)->getLink('author', $listAuthor)?>"><?=$this->escapeHtml($listAuthor)?></a><br/>
<? endif; ?>
<? $listTags = ($this->usertags()->getMode() !== 'disabled') ? $this->driver->getTags(
null === $list_id ? true : $list_id, // get tags for all lists if no single list is selected
$user_id, 'tag'
) : array();
?>
<? if (count($listTags) > 0): ?>
<strong><?=$this->transEsc('Your Tags')?>:</strong>
<? $i = 0; foreach ($listTags as $tag): ?><?=($i++ == 0)?'':', '?><a href="<?=$this->url('tag-home')?>?lookfor=<?=urlencode($tag->tag)?>"><?=$this->escapeHtml($tag->tag)?></a><? endforeach; ?>
<br/>
<? endif; ?>
<? $listNotes = $this->driver->getListNotes($list_id, $user_id); ?>
<? if (count($listNotes) > 0): ?>
<strong><?=$this->transEsc('Notes')?>:</strong>
<? if (count($listNotes) > 1): ?><br/><? endif; ?>
<? foreach ($listNotes as $note): ?>
<?=$this->escapeHtml($note)?><br/>
<? endforeach; ?>
<? endif; ?>
<? if (count($this->lists) > 0): ?>
<strong><?=$this->transEsc('Saved in')?>:</strong>
<? $i=0;foreach($this->lists as $current): ?>
<a href="<?=$this->url('userList', array('id' => $current->id))?>"><?=$current->title?></a><? if($i++ < count($this->lists)-1): ?>,<? endif; ?>
<? endforeach; ?>
<br/>
<? endif; ?>
<div class="callnumAndLocation">
<? if ($this->driver->supportsAjaxStatus()): ?>
<strong class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</strong>
<span class="callnumber ajax_availability hide">
<?=$this->transEsc('Loading')?>...
</span><br class="hideIfDetailed"/>
<strong><?=$this->transEsc('Located')?>:</strong>
<span class="location ajax_availability hide">
<?=$this->transEsc('Loading')?>...
</span>
<div class="locationDetails hide"></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(); foreach ($urls as $current): ?>
<br/>
<a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"><?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?></a>
<? endforeach; ?>
<? endif; ?>
<br class="hideIfDetailed"/>
<?=$this->record($this->driver)->getFormatList()?>
<? if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?>
<div class="status ajax_availability hide"><?=$this->transEsc('Loading')?>...</div>
<? endif; ?>
</div>
<? // Allow editing if a list is selected and edit is allowed OR if no list is selected
// and a user is logged in (which means we are viewing all of the user's favorites)
if ((isset($list) && $list->editAllowed($this->user)) || (!isset($list) && $this->user)): ?>
<div class="floatright">
<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>
<? /* Use a different delete URL if we're removing from a specific list or the overall favorites: */
$deleteUrl = is_null($list_id)
? $this->url('myresearch-favorites')
: $this->url('userList', array('id' => $list_id));
$deleteUrl .= '?delete=' . urlencode($id) . '&source=' . urlencode($source);
?>
<a href="<?=$deleteUrl?>" title="<?=$this->transEsc('confirm_delete_brief')?>" class="delete tool source<?=$this->escapeHtmlAttr($source)?>"><?=$this->transEsc('Delete')?></a>
</div>
<? endif; ?>
<div class="clear"></div>
</div>
<?=$this->driver->supportsCoinsOpenUrl()?'<span class="Z3988" title="'.$this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()).'"></span>':''?>