--- loncom/interface/lonsearchcat.pm 2006/03/15 20:56:16 1.256 +++ loncom/interface/lonsearchcat.pm 2006/05/12 16:45:41 1.264 @@ -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.264 2006/05/12 16:45:41 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. @@ -663,9 +660,8 @@ sub print_basic_search_form { my ($r,$closebutton,$hidden_fields) = @_; my $result = ($env{'form.catalogmode'} ne 'groupsearch'); my $bread_crumb = - &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching','Search_Basic', - undef,undef, - $env{'form.catalogmode'} ne 'groupsearch'); + &Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic', + $env{'form.catalogmode'} ne 'groupsearch'); my $scrout = &Apache::loncommon::start_page('Search').$bread_crumb; if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) { # Define interface components @@ -707,10 +703,8 @@ sub print_basic_search_form { } $scrout.=''.
- &Apache::lonhtmlcommon::textbox
- ('basicexp',
- &HTML::Entities::encode($env{'form.basicexp'},'<>&"'),50
- ).
+ &Apache::lonhtmlcommon::textbox('basicexp',
+ $env{'form.basicexp'},50).
' '. ''.&searchhelp().''.' | '.
''.
@@ -797,10 +791,8 @@ Prints the advanced search form.
sub print_advanced_search_form{
my ($r,$closebutton,$hidden_fields) = @_;
my $bread_crumb =
- &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching',
- 'Search_Advanced',
- undef,undef,
- $env{'form.catalogmode'} ne 'groupsearch');
+ &Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Advanced',
+ $env{'form.catalogmode'} ne 'groupsearch');
my %lt=&Apache::lonlocal::texthash('srch' => 'Search',
'reset' => 'Reset',
'help' => 'Help');
@@ -2065,10 +2057,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 +2089,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.=< |