--- loncom/interface/lonsearchcat.pm 2009/07/03 08:18:48 1.311 +++ 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.311 2009/07/03 08:18:48 bisitz Exp $ +# $Id: lonsearchcat.pm,v 1.312 2009/07/31 10:58:57 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -524,7 +524,7 @@ sub course_search { untie(%hash); } unless ($totalfound) { - $r->print('

'.&mt('No matches found in resources').'.

'); + $r->print('

'.&mt('No matches found in resources.').'

'); } # Check discussions if requested @@ -599,7 +599,7 @@ sub course_search { } } unless ($totaldiscussions) { - $r->print('

'.&mt('No matches found in postings').'.

'); + $r->print('

'.&mt('No matches found in postings.').'

'); } } else { $r->print('
'.&mt('An error occurred retrieving information about resources in the course.').'
'.&mt('It is recommended that you [_1]re-initialize the course[_2] and then try your search again.','','').'
'); @@ -729,7 +729,6 @@ $hidden_fields

$lt{'note'}.

-

-
ENDCOURSESEARCH @@ -750,8 +749,9 @@ ENDCOURSESEARCH

+ +

+

@@ -2761,7 +2761,9 @@ sub display_results { ## my $viewfunction = $Views{$env{'form.viewselect'}}; if (!defined($viewfunction)) { - $r->print("Internal Error - Bad view selected.\n"); + $r->print('

' + .&mt('Internal Error - Bad view selected.') + .'

'."\n"); $r->rflush(); return; } @@ -2778,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; @@ -2792,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); @@ -2919,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('
'. + $r->print('
'. mt('Results [_1] to [_2] out of [_3]', $min,$max,$total_results). - "
\n"); + "\n"); } ## ## Get results from MySQL table @@ -2957,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'; } @@ -2972,11 +2981,19 @@ 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 ('
'. @@ -3395,7 +3412,7 @@ sub detailed_citation_view { my $jumpurl=$values{'url'}; $jumpurl=~s|^/ext/|http://|; $result .= ''.$prefix. - ''.' '. + ''.' '. ''.$values{'title'}."\n"; $result .= "

\n"; @@ -3487,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 '
'. - &detailed_citation_view($prefix,%values). + return &detailed_citation_view($prefix,%values). ''. - &Apache::lonindexer::showpreview($values{'url'}). - '

'; + &Apache::lonindexer::showpreview($values{'url'}); } @@ -3514,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| @@ -3533,24 +3547,20 @@ sub summary_view { $result.=<$values{'title'}
-$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 '
'. - &summary_view($prefix,%values). + return &summary_view($prefix,%values). ''. - &Apache::lonindexer::showpreview($values{'url'}). - '

'; + &Apache::lonindexer::showpreview($values{'url'}); } ###################################################################### @@ -3583,7 +3593,7 @@ sub compact_view { $result.=' '. ''. &HTML::Entities::encode($values{'title'},'<>&"').' '. - $link.' '.$values{'author'}.' ('.$values{'domain'}.')
'; + $link.' '.$values{'author'}.' ('.$values{'domain'}.')'; return $result; } @@ -3623,7 +3633,7 @@ sub fielded_format_view { $jumpurl=~s|^/ext/|http://|; my $result=< +$prefix
URL:
$values{'extrashow'} -
END return $result; } @@ -3763,9 +3771,12 @@ sub output_unparsed_phrase_error { my ($r,$closebutton,$parms,$hidden_fields,$field)=@_; my $errorstring; if ($field eq 'basicexp') { - $errorstring = &mt('Unable to understand the search phrase [_1]. Please modify your search.',$env{'form.basicexp'}); + $errorstring = &mt('Unable to understand the search phrase [_1]. Please modify your search.' + ,''.$env{'form.basicexp'}.''); } else { - $errorstring = &mt('Unable to understand the search phrase [_1]:[_2].',$field,$env{'form.'.$field}); + $errorstring = &mt('Unable to understand the search phrase [_1]: [_2]' + ,''.$field.'' + ,$env{'form.'.$field}); } my $heading = &mt('Unparsed Field'); my $revise = &mt('Revise search request'); @@ -3779,7 +3790,7 @@ $hidden_fields $closebutton

$heading

-

+

$errorstring

@@ -3811,7 +3822,7 @@ $parms is extra information to include i ###################################################################### sub output_blank_field_error { my ($r,$closebutton,$parms,$hidden_fields)=@_; - my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.'); + my $errormsg = &mt('You did not fill in enough information for the search to be started. You need to fill in relevant fields on the search page in order for a query to be processed.'); my $revise = &mt('Revise Search Request'); my $heading = &mt('Unactionable Search Queary'); my $start_page = &Apache::loncommon::start_page('Search'); @@ -3823,7 +3834,7 @@ $hidden_fields $closebutton


$heading

-

+

$errormsg

@@ -3858,6 +3869,7 @@ sub output_date_error { # make query information persistent to allow for subsequent revision my $start_page = &Apache::loncommon::start_page('Search'); my $end_page = &Apache::loncommon::end_page(); + my $heading = &mt('Error'); $r->print(< @@ -3865,9 +3877,10 @@ $hidden_fields $closebutton +


-

Error

-

+

$heading

+

$message

$end_page