--- loncom/interface/lonsearchcat.pm 2006/03/15 20:56:16 1.256 +++ loncom/interface/lonsearchcat.pm 2006/04/11 19:53:11 1.262 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.256 2006/03/15 20:56:16 albertel Exp $ +# $Id: lonsearchcat.pm,v 1.262 2006/04/11 19:53:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -116,9 +116,6 @@ sub handler { my $diropendb; # The full path to the (temporary) search database file. # This is set and used in &handler() and is also used in # &output_results(). - my $bodytag; # LON-CAPA standard body tag, gotten from - # &Apache::lonnet::bodytag. - # No title, no table, just a
tag. my $loaderror=&Apache::lonnet::overloaderror($r); if ($loaderror) { return $loaderror; } @@ -165,7 +162,7 @@ sub handler { ($env{'form.launch'} eq '1')) { $env{'form.persistent_db_id'} = time; } - $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1); + my $persistent_db_file = "/home/httpd/perl/tmp/". &Apache::lonnet::escape($domain). '_'.&Apache::lonnet::escape($env{'user.name'}). @@ -202,7 +199,9 @@ sub handler { 'We were unable to retrieve data describing your search. '. 'This is a serious error and has been logged. '. 'Please alert your LON-CAPA administrator.'; - return &error_page($r,$msg); + &Apache::loncommon::simple_error_page($r,'Search Error', + $msg); + return OK; } } } else { @@ -223,7 +222,9 @@ sub handler { # This is a stupid error to give to the user. # It really tells them nothing. my $msg = 'Unable to tie hash to db file.'; - return &error_page($r,$msg); + &Apache::loncommon::simple_error_page($r,'Search Error', + $msg); + return OK; } } ## @@ -364,14 +365,18 @@ END my $msg = 'Unable to create table in which to store search results. '. 'The search has been aborted.'; - return &error_page($r,$msg); + &Apache::loncommon::simple_error_page($r,'Search Error', + $msg); + return OK; } delete($env{'form.launch'}); if (! &make_form_data_persistent($r,$persistent_db_file)) { my $msg= 'Unable to properly store search information. '. 'The search has been aborted.'; - return &error_page($r,$msg); + &Apache::loncommon::simple_error_page($r,'Search Error', + $msg); + return OK; } ## ## Print out the frames interface @@ -383,14 +388,6 @@ END return OK; } -sub error_page { - my ($r,$msg) = @_; - $r->print(&Apache::loncommon::start_page('Search Error'). - &mt($msg). - &Apache::loncommon::end_page()); - return OK; -} - # # The mechanism used to store values away and retrieve them does not # handle the case of missing environment variables being significant. @@ -2065,10 +2062,6 @@ a link to change the search query. ###################################################################### sub print_sort_form { my ($r,$pretty_query_string) = @_; - my $bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1). - &Apache::lonhtmlcommon::breadcrumbs - (undef,'Searching','Searching',undef,undef, - $env{'form.catalogmode'} ne 'groupsearch'); ## my %SortableFields=&Apache::lonlocal::texthash( @@ -2101,14 +2094,8 @@ sub print_sort_form { &Apache::lonnet::logthis(&Apache::lonmysql::get_error()); return; } - my $result; - my $html = &Apache::lonxml::xmlbegin(); - my $head = &Apache::lonxml::headtag('Results'); - my $end_head = &Apache::loncommon::endheadtag(); - $result.=<