--- loncom/interface/lonsearchcat.pm 2004/07/19 16:38:07 1.231 +++ loncom/interface/lonsearchcat.pm 2004/09/23 21:16:45 1.233 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.231 2004/07/19 16:38:07 raeburn Exp $ +# $Id: lonsearchcat.pm,v 1.233 2004/09/23 21:16:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -659,18 +659,18 @@ sub print_basic_search_form { my $scrout = &search_html_header().$bodytag; if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { # Define interface components - my $userelatedwords= + my $userelatedwords= ''; + my $onlysearchdomain=''; my $adv_search_link = ''. + ('
'. + $sortform. + ''. &prev_next_buttons($min,$ENV{'form.show'},$total_results). ''. &viewoptions().'
' @@ -2647,13 +2711,21 @@ sub display_results { ""); return; } else { - $r->print - ("
Results $min to $max out of $total_results
\n"); + $r->print('
'. + mt('Results [_1] to [_2] out of [_3]', + $min,$max,$total_results). + "
\n"); } ## ## Get results from MySQL table - my @Results = &Apache::lonmysql::get_rows($table, - 'id>='.$min.' AND id<='.$max); + my $sort_command = 'id>='.$min.' AND id<='.$max; + if ($ENV{'form.sortfield'} ne 'default' && + exists($sort_fields{$ENV{'form.sortfield'}})) { + $sort_command = $ENV{'form.sortfield'}.' IS NOT NULL '. + 'ORDER BY '.$ENV{'form.sortfield'}. + ' LIMIT '.($min-1).','.($max-$min); + } + my @Results = &Apache::lonmysql::get_rows($table,$sort_command); ## ## Loop through the results and output them. foreach my $row (@Results) {