--- loncom/interface/lonsearchcat.pm 2008/08/27 19:50:46 1.299 +++ loncom/interface/lonsearchcat.pm 2009/07/31 10:58:57 1.312 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.299 2008/08/27 19:50:46 raeburn Exp $ +# $Id: lonsearchcat.pm,v 1.312 2009/07/31 10:58:57 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -191,9 +191,9 @@ sub handler { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/searchcat?'. &Apache::loncommon::inhibit_menu_check(). - '&catalogmode='.$env{'form.catalogmode'}. - '&launch='.$env{'form.launch'}. - '&mode='.$env{'form.mode'}, + '&catalogmode='.$env{'form.catalogmode'}. + '&launch='.$env{'form.launch'}. + '&mode='.$env{'form.mode'}, text=>"$crumb_text", target=>'_top', bug=>'Searching',}); @@ -314,19 +314,19 @@ END } &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). - '&phase=disp_adv'. - '&catalogmode='.$env{'form.catalogmode'}. - '&launch='.$env{'form.launch'}. - '&mode='.$env{'form.mode'}, + '&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?'.&Apache::loncommon::inhibit_menu_check(). - '&phase=disp_adv'. + '&phase=disp_adv'. 'catalogmode='.$env{'form.catalogmode'}. - '&launch='.$env{'form.launch'}. - '&mode='.$env{'form.mode'}, + '&launch='.$env{'form.launch'}. + '&mode='.$env{'form.mode'}, text=>"Course Search", bug=>'Searching',}); } @@ -488,7 +488,20 @@ sub course_search { my $discuss=$env{'form.crsdiscuss'}; my @allwords=($search_string,@New_Words); $totalfound=0; - $r->print(&Apache::loncommon::start_page('Course Search'). + + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/searchcat?'.&Apache::loncommon::inhibit_menu_check(). + '&phase=disp_adv'. + 'catalogmode='.$env{'form.catalogmode'}. + '&launch='.$env{'form.launch'}. + '&mode='.$env{'form.mode'}, + text=>"Course Search", + bug=>'Searching',}); + $r->print(&Apache::loncommon::start_page('Course Search')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', + $env{'form.catalogmode'} ne 'import')); + + $r->print( '
'.&mt('No matches found in resources').'.
'); + $r->print(''.&mt('No matches found in resources.').'
'); } # Check discussions if requested @@ -519,72 +532,77 @@ sub course_search { my $totaldiscussions = 0; $r->print(''.&mt('No matches found in postings').'.
'); + unless ($totaldiscussions) { + $r->print(''.&mt('No matches found in postings.').'
'); + } + } else { + $r->print('$lt{'note'}.
-
ENDCOURSESEARCH @@ -732,8 +749,9 @@ ENDCOURSESEARCH | |
- + +
+
@@ -762,14 +780,14 @@ sub setup_basic_search { ''; $adv_search_link = ''.&mt('Advanced Search').''; # $scrout.=''. ''.&searchhelp().''.''. '' + .&mt('Internal Error - Bad view selected.') + .'
'."\n"); $r->rflush(); return; } @@ -2761,7 +2780,10 @@ sub display_results { if ($env{'form.catalogmode'} eq 'import') { if (! tie(%groupsearch_db,'GDBM_File',$diropendb, &GDBM_WRCREAT(),0640)) { - $r->print('Unable to save import results.'. + $r->print(''. + &mt('Unable to save import results.'). + '
'. + ''. &Apache::loncommon::end_page()); $r->rflush(); return; @@ -2775,7 +2797,10 @@ sub display_results { ## Get the number of results my $total_results = &Apache::lonmysql::number_of_rows($table); if (! defined($total_results)) { - $r->print("A MySQL error has occurred.". + $r->print(''. + &mt('A MySQL error has occurred.'). + '
'. + ''. &Apache::loncommon::end_page()); &Apache::lonnet::logthis("lonmysql was unable to determine the number". " of rows in table ".$table); @@ -2894,7 +2919,7 @@ sub display_results { ## Output links (if necessary) for 'prev' and 'next' pages. $r->print (''.
- ' | '. &prev_next_buttons($min,$env{'form.show'},$total_results). ' | '.
@@ -2902,15 +2927,15 @@ sub display_results {
);
if ($total_results == 0) {
$r->print(''.
- ''.&mt('There are currently no results').'.'. + ''.&mt('There are currently no results').'. '. "". &Apache::loncommon::end_page()); return; } else { - $r->print(''.
mt('Results [_1] to [_2] out of [_3]',
$min,$max,$total_results).
- "\n");
+ " \n");
}
##
## Get results from MySQL table
@@ -2940,13 +2965,14 @@ sub display_results {
if ($area eq 'portfolio') {
$tabletype = 'portfolio_search';
}
+ $r->print(&Apache::loncommon::start_data_table());
foreach my $row (@Results) {
if ($connection->aborted()) {
&cleanup();
return;
}
my %Fields = %{&parse_row($tabletype,@$row)};
- my $output="\n"; + my $output; if (! defined($Fields{'title'}) || $Fields{'title'} eq '') { $Fields{'title'} = 'Untitled'; } @@ -2955,18 +2981,26 @@ sub display_results { # Render the result into html $output.= &$viewfunction($prefix,%Fields); # Print them out as they come in. - $r->print($output); + $r->print(&Apache::loncommon::start_data_table_row() + .' '
+ .$output
+ .' | '
+ .&Apache::loncommon::end_data_table_row()
+ );
$r->rflush();
}
+ $r->print(&Apache::loncommon::end_data_table());
if (@Results < 1) {
- $r->print(&mt("There were no results matching your query"));
+ $r->print('' + .&mt('There were no results matching your query.') + .' '); } else { $r->print ('\n"; @@ -3470,17 +3504,14 @@ sub detailed_citation_view { if (exists($values{'shortabstract'}) && $values{'shortabstract'} ne '') { $result .= ' '.$values{'shortabstract'}.' '; } - $result .= ''."\n"; return $result; } sub detailed_citation_preview { my ($prefix,%values)=@_; - return '
'; + &Apache::lonindexer::showpreview($values{'url'}); } @@ -3497,7 +3528,7 @@ sub detailed_citation_preview { sub summary_view { my ($prefix,%values) = @_; my $icon=&Apache::loncommon::icon($values{'url'}); - my $result=qq{$prefix}; + my $result=qq{$prefix}; if (exists($env{'form.sortfield'}) && $env{'form.sortfield'} !~ /^(default| author| @@ -3516,24 +3547,20 @@ sub summary_view { $result.=< -$link + target="preview">$values{'title'} +$link $values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'} $values{'copyrighttag'} $values{'extrashow'} - - END return $result; } sub summary_preview { my ($prefix,%values)=@_; - return '
'; + &Apache::lonindexer::showpreview($values{'url'}); } ###################################################################### @@ -3555,7 +3582,7 @@ sub compact_view { my $link = &display_url($jumpurl,[1,1,1]); my $result = - $prefix.''; + $prefix.''; if (exists($env{'form.sortfield'}) && $env{'form.sortfield'} !~ /^(default|author|url|title)$/) { my $tmp = $values{$env{'form.sortfield'}}; @@ -3566,7 +3593,7 @@ sub compact_view { $result.=' '. ''. &HTML::Entities::encode($values{'title'},'<>&"').' '. - $link.' '.$values{'author'}.' ('.$values{'domain'}.') '; + $link.' '.$values{'author'}.' ('.$values{'domain'}.')'; return $result; } @@ -3606,7 +3633,7 @@ sub fielded_format_view { $jumpurl=~s|^/ext/|http://|; my $result=< |