--- loncom/interface/lonsearchcat.pm 2004/01/01 20:13:17 1.200 +++ loncom/interface/lonsearchcat.pm 2004/04/19 16:53:27 1.209 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.200 2004/01/01 20:13:17 www Exp $ +# $Id: lonsearchcat.pm,v 1.209 2004/04/19 16:53:27 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -48,7 +48,7 @@ described at http://www.lon-capa.org. lonsearchcat presents the user with an interface to search the LON-CAPA digital library. lonsearchcat also initiates the execution of a search by sending the search parameters to LON-CAPA servers. The progress of -search (on a server basis) is displayed to the user in a seperate window. +search (on a server basis) is displayed to the user in a separate window. =head1 Internals @@ -73,6 +73,7 @@ use Apache::lonmysql(); use Apache::lonmeta; use Apache::lonhtmlcommon; use Apache::lonlocal; +use LONCAPA::lonmetadata(); ###################################################################### ###################################################################### @@ -163,6 +164,25 @@ sub handler { '_'.&Apache::lonnet::escape($ENV{'user.name'}). '_'.$ENV{'form.persistent_db_id'}.'_persistent_search.db'; ## + &Apache::lonhtmlcommon::clear_breadcrumbs(); + if (exists($ENV{'request.course.id'}) && $ENV{'request.course.id'} ne '') { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/searchcat?'. + 'catalogmode='.$ENV{'form.catalogmode'}. + '&launch='.$ENV{'form.launch'}. + '&mode='.$ENV{'form.mode'}, + text=>"Course and Catalog Search", + bug=>'Searching',}); + } else { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/searchcat?'. + 'catalogmode='.$ENV{'form.catalogmode'}. + '&launch='.$ENV{'form.launch'}. + '&mode='.$ENV{'form.mode'}, + text=>"Catalog Search", + bug=>'Searching',}); + } + # if (! &get_persistent_form_data($persistent_db_file)) { if ($ENV{'form.phase'} =~ /(run_search|results)/) { &Apache::lonnet::logthis("lonsearchcat:Unable to recover data ". @@ -263,6 +283,32 @@ END } $ENV{'form.phase'} = 'disp_basic' if (! exists($ENV{'form.phase'})); $ENV{'form.show'} = 20 if (! exists($ENV{'form.show'})); + # + $ENV{'form.searchmode'} = 'basic'; + if ($ENV{'form.phase'} eq 'adv_search' || + $ENV{'form.phase'} eq 'disp_adv') { + $ENV{'form.searchmode'} = 'advanced'; + } elsif ($ENV{'form.phase'} eq 'course_search') { + $ENV{'form.searchmode'} = 'course_search'; + } + # + if ($ENV{'form.searchmode'} eq 'advanced') { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/searchcat?phase=disp_adv&'. + 'catalogmode='.$ENV{'form.catalogmode'}. + '&launch='.$ENV{'form.launch'}. + '&mode='.$ENV{'form.mode'}, + text=>"Advanced Search", + bug=>'Searching',}); + } elsif ($ENV{'form.searchmode'} eq 'course search') { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/searchcat?phase=disp_adv&'. + 'catalogmode='.$ENV{'form.catalogmode'}. + '&launch='.$ENV{'form.launch'}. + '&mode='.$ENV{'form.mode'}, + text=>"Course Search", + bug=>'Searching',}); + } ## ## Switch on the phase ## @@ -287,10 +333,6 @@ END &course_search($r); } elsif(($ENV{'form.phase'} eq 'basic_search') || ($ENV{'form.phase'} eq 'adv_search')) { - $ENV{'form.searchmode'} = 'basic'; - if ($ENV{'form.phase'} eq 'adv_search') { - $ENV{'form.searchmode'} = 'advanced'; - } # Set up table if (! defined(&create_results_table())) { my $errorstring=&Apache::lonmysql::get_error(); @@ -359,7 +401,8 @@ my $totalfound; sub course_search { my $r=shift; - my $bodytag=&Apache::loncommon::bodytag('Course Search'); + my $bodytag=&Apache::loncommon::bodytag('Course Search'). + &Apache::loncommon::help_open_bug('Searching'); my $pretty_search_string = ''.$ENV{'form.courseexp'}.''; my $search_string = $ENV{'form.courseexp'}; my @New_Words; @@ -375,7 +418,7 @@ sub course_search { my @allwords=($search_string,@New_Words); $totalfound=0; $r->print('
ENDDOCUMENT
- $scrout.=' '.&Apache::lonhtmlcommon::textbox('basicexp',
- $ENV{'form.basicexp'},40).
- ' ';
- my $relatedcheckbox = &Apache::lonhtmlcommon::checkbox('related',
- $ENV{'form.related'});
- my $domain = $r->dir_config('lonDefDomain');
- my $domaincheckbox = &Apache::lonhtmlcommon::checkbox('domains',
- $ENV{'form.domains'});
- my $srch=&mt('Search');
- my $header=&mt('Advanced Search');
- my $userelatedwords=&mt('use related words');
- my $onlysearchdomain=&mt('only search domain');
- my $view=&viewoptions();
- $scrout.=<$header | |