forked from aadl/sopac
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sopac-results.tpl.php
104 lines (95 loc) · 3.36 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
<?php
/*
* Hitlist Page template
*/
// Set some stuff up here
$getvars = sopac_parse_get_vars();
$sorted_by = $getvars['sort'];
$uri_arr = explode('?', $_SERVER['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);
?>
<?php if ($result_info['num_results'] > 0) { ?>
<div class="hitlist-top-bar">
<?php if ($locum_result['suggestion']) { ?>
<div class="hitlist-suggestions">
Did you mean <i><a href="<?php print suggestion_link($locum_result); ?>"><?php
print $locum_result['suggestion'];
?></a></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="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>
<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>
</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>