-
Notifications
You must be signed in to change notification settings - Fork 6
/
sopac-results.tpl.php
126 lines (115 loc) · 4.07 KB
/
sopac-results.tpl.php
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
<?php
/*
* Hitlist Page template
*/
// Set some stuff up here
$getvars = sopac_parse_get_vars();
$sorted_by = $getvars['sort'];
$uri_arr = explode('?', request_uri());
$uri = $uri_arr[0];
$uri = $_GET['q'];
$perpage = $result_info['limit'];
$sortopts = array(
'' => t('Relevance'),
'atoz' => t('Alphabetical A to Z'),
'ztoa' => t('Alphabetical Z to A'),
'catalog_newest' => t('Just Added'),
'newest' => t('Pub date: Newest'),
'oldest' => t('Pub date: Oldest'),
'author' => t('Alphabetically by Author'),
'top_rated' => t('Top Rated Items'),
'popular_week' => t('Most Popular this Week'),
'popular_month' => t('Most Popular this Month'),
'popular_year' => t('Most Popular this Year'),
'popular_total' => t('All Time Most Popular'),
);
$default_perpage = variable_get('sopac_results_per_page', 10);
// Only show mel link on searches for books
if ($_GET['search_format']) {
foreach(explode('|', $_GET['search_format']) as $format) {
if (strpos($locum_config['format_groups']['books'], $format) !== FALSE) {
$show_mel_link = TRUE;
}
}
}
else {
$show_mel_link = TRUE; // show link if not limited by format
}
?>
<?php if ($result_info['num_results'] > 0) { ?>
<div class="hitlist-top-bar">
<?php echo $rss_link; ?>
<?php if ($locum_result['changed'] == "yes") { ?>
<p class="resultswitch">No results found for <strong>ALL</strong> your search terms. Found <?php echo $result_info[num_results]; ?> results that match <strong>ANY</strong> terms.</p>
<?php } ?>
<?php if ($locum_result['suggestion']) { ?>
<div class="hitlist-suggestions">
Did you mean <i><?php print suggestion_link($locum_result); ?></i> ?
</div>
<br />
<?php } ?>
<div class="hitlist-range">
<span class="range">Showing results <strong><?php print $result_info['hit_lowest'] . '</strong> to <strong>' . $result_info['hit_highest'] . '</strong> of <strong>' . $result_info['num_results'] .'</strong>'; ?></span>
<span class="hitlist-sorter">
<script>
jQuery(document).ready(function() {$('#sortlist').change(function(){ location.href = $(this).val();});});
</script>
Sort by: <select name="sort" id="sortlist">
<?php
foreach($sortopts as $key => $value) {
print '<option value="' . url($_GET['q'], array('query' => sopac_make_pagevars(sopac_parse_get_vars(array('page' => '', 'limit' => '', 'sort' => $key))))) . '" ';
if ($sorted_by == $key) {
print 'selected';
}
print '>' . $value . '</option>';
}
?>
</select>
</span>
<span class="pagination">Show:
<?php
if ($perpage == $default_perpage || !$perpage) {
print "<strong>" . $default_perpage . "</strong>";
}
else {
$getvars['perpage'] = $default_perpage;
$getvars['page'] = '';
print l($default_perpage, $uri, array('query' => sopac_make_pagevars(sopac_parse_get_vars($getvars))));
}
print ' | ';
if ($perpage == ($default_perpage * 3)) {
print "<strong>" . ($default_perpage * 3) . "</strong>";
}
else {
$getvars['perpage'] = ($default_perpage * 3);
$getvars['page'] = '';
print l(($default_perpage * 3), $uri, array('query' => sopac_make_pagevars(sopac_parse_get_vars($getvars))));
}
print ' | ';
if ($perpage == ($default_perpage * 6)) {
print "<strong>" . ($default_perpage * 6) . "</strong>";
}
else {
$getvars['perpage'] = ($default_perpage * 6);
$getvars['page'] = '';
print l(($default_perpage * 6), $uri, array('query' => sopac_make_pagevars(sopac_parse_get_vars($getvars))));
}
?>
</span>
</div>
</div>
<br />
<div class="hitlist-pager">
<?php print $hitlist_pager; ?>
</div>
<?php } ?>
<div class="hitlist-content">
<?php print $hitlist_content; ?>
</div>
<div class="hitlist-pager">
<?php print $hitlist_pager; ?>
</div>
<?php if ($show_mel_link) {
echo '<p class="mel">' , l("Try this search at other Michigan libraries", 'http://elibrary.mel.org/search/X' . $locum_result['term']) , '</p>';
}
?>