--- loncom/interface/lonsearchcat.pm 2007/05/01 02:13:40 1.285 +++ loncom/interface/lonsearchcat.pm 2008/02/12 18:48:03 1.289 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.285 2007/05/01 02:13:40 www Exp $ +# $Id: lonsearchcat.pm,v 1.289 2008/02/12 18:48:03 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -138,7 +138,7 @@ sub handler { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['catalogmode','launch','acts','mode','form','element','pause', 'phase','persistent_db_id','table','start','show', - 'cleargroupsort','titleelement','area']); + 'cleargroupsort','titleelement','area','inhibitmenu']); ## ## The following is a trick - we wait a few seconds if asked to so ## the daemon running the search can get ahead of the daemon @@ -190,7 +190,8 @@ sub handler { } &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/searchcat?'. - 'catalogmode='.$env{'form.catalogmode'}. + &Apache::loncommon::inhibit_menu_check(). + '&catalogmode='.$env{'form.catalogmode'}. '&launch='.$env{'form.launch'}. '&mode='.$env{'form.mode'}, text=>"$crumb_text", @@ -258,6 +259,9 @@ sub handler { if (exists($env{'form.area'})) { $hidden_fields .= &hidden_field('area'); } + if (exists($env{'form.inhibitmenu'})) { + $hidden_fields .= &hidden_field('inhibitmenu'); + } ## ## Configure dynamic components of interface ## @@ -308,15 +312,17 @@ END $srchtype = 'Portfolio'; } &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/searchcat?phase=disp_adv&'. - 'catalogmode='.$env{'form.catalogmode'}. + ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). + '&phase=disp_adv'. + '&catalogmode='.$env{'form.catalogmode'}. '&launch='.$env{'form.launch'}. '&mode='.$env{'form.mode'}, text=>"Advanced $srchtype Search", bug=>'Searching',}); } elsif ($env{'form.searchmode'} eq 'course search') { &Apache::lonhtmlcommon::add_breadcrumb - ({href=>'/adm/searchcat?phase=disp_adv&'. + ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). + '&phase=disp_adv'. 'catalogmode='.$env{'form.catalogmode'}. '&launch='.$env{'form.launch'}. '&mode='.$env{'form.mode'}, @@ -379,7 +385,7 @@ END $errorstring); my $msg = - 'Unable to create table in which to store search results. '. + 'Unable to create table in which to save search results. '. 'The search has been aborted.'; &Apache::loncommon::simple_error_page($r,'Search Error', $msg); @@ -388,7 +394,7 @@ END delete($env{'form.launch'}); if (! &make_form_data_persistent($r,$persistent_db_file)) { my $msg= - 'Unable to properly store search information. '. + 'Unable to properly save search information. '. 'The search has been aborted.'; &Apache::loncommon::simple_error_page($r,'Search Error', $msg); @@ -759,8 +765,9 @@ sub setup_basic_search { ''; } $adv_search_link = ''; my %fields=&Apache::lonmeta::fieldnames(); # - $scrout .= '
'. (' 'x2).&searchhelp()." | ';
}
@@ -2146,7 +2153,7 @@ sub ensure_db_and_table {
##
if (! defined($table) || $table eq '' || $table =~ /\D/ ) {
$r->print("Unable to retrieve search results. ".
- "Unable to determine the table results were stored in. ".
+ "Unable to determine the table results were saved in. ".
&Apache::loncommon::end_page());
return undef;
}
@@ -2156,7 +2163,7 @@ sub ensure_db_and_table {
my $connection_result = &Apache::lonmysql::connect_to_db();
if (!defined($connection_result)) {
$r->print("Unable to connect to the MySQL database where your results".
- " are stored.".
+ " are saved.".
&Apache::loncommon::end_page());
&Apache::lonnet::logthis("lonsearchcat: unable to get lonmysql to".
" connect to database.");
@@ -2265,14 +2272,11 @@ END
# }
# $result.="\n";
my $revise = &revise_button();
- $result.=< -Search: $pretty_query_string - - -END + $result.='' + .&mt('There are [_1] matches to your query.',$total_results) + .' '.$revise.' ' + .''.&mt('Search: ').$pretty_query_string + .' '; $r->print($result.&Apache::loncommon::end_page()); return; } @@ -2444,13 +2448,14 @@ Returns: html string for a 'revise searc ###################################################################### ###################################################################### sub revise_button { + my $revisetext = &mt('Revise search'); my $revise_phase = 'disp_basic'; $revise_phase = 'disp_adv' if ($env{'form.searchmode'} eq 'advanced'); my $newloc = '/adm/searchcat'. '?persistent_db_id='.$env{'form.persistent_db_id'}. '&cleargroupsort=1'. '&phase='.$revise_phase; - my $result = qq{ }; return $result; } @@ -2522,7 +2527,7 @@ END # Check on the mysql table we will use to store results. my $table =$env{'form.table'}; if (! defined($table) || $table eq '' || $table =~ /\D/ ) { - $r->print("Unable to determine table id to store search results in.". + $r->print("Unable to determine table id to save search results in.". "The search has been aborted.". &Apache::loncommon::end_page()); return; @@ -2760,7 +2765,7 @@ sub display_results { if ($env{'form.catalogmode'} eq 'import') { if (! tie(%groupsearch_db,'GDBM_File',$diropendb, &GDBM_WRCREAT(),0640)) { - $r->print('Unable to store import results.'. + $r->print('Unable to save import results.'. &Apache::loncommon::end_page()); $r->rflush(); return; @@ -2997,8 +3002,8 @@ sub catalogmode_output { $title=~ s/\'/\\\'/g; if ($env{'form.catalogmode'} eq 'interactive') { $output.=<\n";
$result .= ''.$values{'author'}.','.
@@ -3444,11 +3450,8 @@ sub detailed_citation_view {
if (exists($field->{'type'}) && $field->{'type'} eq 'list') {
$result .= ''.&mt($field->{'translate'}).'';
foreach my $item (split(',',$values{$field->{'name'}})){
- $result .=
- &Apache::lonhtmlcommon::crumbs(&Apache::lonnet::clutter($item),
- 'preview',
- '',
- (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),2,0,1);
+ $item = &Apache::lonnet::clutter($item);
+ $result .= &display_url($item,[2,0,1]);
}
} elsif (exists($field->{'format'}) && $field->{'format'} ne ''){
$result.= &mt($field->{'translate'},
@@ -3456,15 +3459,7 @@ sub detailed_citation_view {
$values{$field->{'name'}}))." |