6 /search/result_list.mas - a Mason module to display search results
10 Displays search results, based on an arrayref containing one "page" of results (see arguments), and displays links for moving to previous and next pages etc.
18 The name of the search
20 =item search_parameter_hashref
22 a hashref mapping parameter names to their values
26 a url, semi-absolute if possible, for the search. Needs to take a page argument.
28 =item total_result_count
30 The total number of results in the resultset.
34 How many results are presented on one page.
38 The current page number.
40 =item results_arrayref
42 An arrayref of arrayrefs containing the contents of the search result page. Each arrayref is a line in a table.
44 =item headers_arrayref
46 The headers of the columns for the search results; has to map to the results_arrayref.
52 Lukas Mueller <lam87@cornell.edu>
61 $search_parameter_hashref
74 my $dp = Data::Page->new();
75 if (!$current_page) { $current_page=1; }
76 $dp->total_entries($total_result_count);
77 $dp->entries_per_page($entries_per_page);
78 $dp->current_page($current_page);
79 my $first = $dp->first();
80 my $last = $dp->last();
84 <& /page/page_title.mas, title => $search_name &>
85 <&| /page/info_section.mas, title => $search_name, subtitle=> "Total found: $total_result_count" &>
86 <& /page/columnar_table.mas, headings => $headers_arrayref, data => $results_arrayref &>
90 % foreach my $page ($first..$last) {
91 <a href="<% $search_link %> "><% $page %></a>