--- loncom/interface/lonsearchcat.pm 2006/06/13 14:42:24 1.269 +++ loncom/interface/lonsearchcat.pm 2006/07/31 19:45:58 1.275 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.269 2006/06/13 14:42:24 www Exp $ +# $Id: lonsearchcat.pm,v 1.275 2006/07/31 19:45:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1540,12 +1540,12 @@ sub parse_domain_restrictions { $domain_hash{$_}++; } if ($domain_hash{'any'}) { - $pretty_domains_string = "In all LON-CAPA domains."; + $pretty_domains_string = &mt("in all LON-CAPA domains."); } else { if (@allowed_domains > 1) { - $pretty_domains_string = "In LON-CAPA domains:"; + $pretty_domains_string = &mt("in LON-CAPA domains:"); } else { - $pretty_domains_string = "In LON-CAPA domain "; + $pretty_domains_string = &mt("in LON-CAPA domain "); } foreach (sort @allowed_domains) { $pretty_domains_string .= "".$_." "; @@ -1614,6 +1614,9 @@ sub parse_basic_search { #} my $final_query = 'SELECT * FROM metadata WHERE '.join(" AND ",@Queries); # + if ($env{'form.related'}) { + $pretty_search_string.=' '.&mt('(including related words)'); + } if (defined($pretty_domains_string) && $pretty_domains_string ne '') { $pretty_search_string .= ' '.$pretty_domains_string; } @@ -2104,7 +2107,7 @@ sub print_sort_form { END my $start_page = &Apache::loncommon::start_page('Results',$js, - {'only_body' => 1}); + {'no_title' => 1}); my $breadcrumbs= &Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', $env{'form.catalogmode'} ne 'import'); @@ -2114,7 +2117,7 @@ $start_page $breadcrumbs
- + END #

Sort Results

@@ -2133,7 +2136,7 @@ END

There are $total_results matches to your query. $revise

-Search:$pretty_query_string +Search: $pretty_query_string

END @@ -2335,7 +2338,7 @@ sub run_search { # Print run_search header # my $start_page = &Apache::loncommon::start_page('Search Status',undef, - {'only_body' => 1}); + {'no_title' => 1}); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', $env{'form.catalogmode'} ne 'import'); @@ -2343,7 +2346,7 @@ sub run_search { $start_page $breadcrumbs
- + END # Remove leading and trailing
$pretty_string =~ s:^\s*
::i; @@ -3063,22 +3066,22 @@ SCRIPT if (document.forms.results.returnvalues.length != "undefined" && typeof(document.forms.results.returnvalues.length) == "number") { if (document.forms.results.returnvalues[checkbox_num].checked) { - parent.statusframe.document.forms.statusform.elements.Queue.value +='1a'+val+'b'; + parent.statusframe.document.forms.statusform.elements.acts.value +='1a'+val+'b'; } else { - parent.statusframe.document.forms.statusform.elements.Queue.value +='0a'+val+'b'; + parent.statusframe.document.forms.statusform.elements.acts.value +='0a'+val+'b'; } } else { if (document.forms.results.returnvalues.checked) { - parent.statusframe.document.forms.statusform.elements.Queue.value +='1a'+val+'b'; + parent.statusframe.document.forms.statusform.elements.acts.value +='1a'+val+'b'; } else { - parent.statusframe.document.forms.statusform.elements.Queue.value +='0a'+val+'b'; + parent.statusframe.document.forms.statusform.elements.acts.value +='0a'+val+'b'; } } } function select_group() { parent.window.location= "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=import&acts="+ - parent.statusframe.document.forms.statusform.elements.Queue.value; + parent.statusframe.document.forms.statusform.elements.acts.value; } SCRIPT @@ -3093,18 +3096,6 @@ END return $result; } -###################################################################### -###################################################################### -sub search_status_header { - my $start_page = &Apache::loncommon::start_page('Search Status',undef, - {'only_body' => 1}); - return <Search Status -Sending search request to LON-CAPA servers.
-ENDSTATUS -} - sub results_link { my $basic_link = "/adm/searchcat?"."&table=".$env{'form.table'}. "&persistent_db_id=".$env{'form.persistent_db_id'}; @@ -3209,11 +3200,11 @@ sub detailed_citation_view { my ($prefix,%values) = @_; my $result; my $jumpurl=$values{'url'}; - $jumpurl=~s/^\/ext\//http\:\/\//; + $jumpurl=~s|^/ext/|http://|; $result .= ''.$prefix. ''.' '. ''.$values{'title'}."\n"; + 'target="preview">'.$values{'title'}."\n"; $result .= "

\n"; $result .= ''.$values{'author'}.','. ' '.$values{'owner'}.'
'; @@ -3280,9 +3271,9 @@ sub detailed_citation_view { $result .= ''.&mt($field->{'translate'}).''; foreach my $item (split(',',$values{$field->{'name'}})){ $result .= - &Apache::lonhtmlcommon::crumbs($item, - (($env{'form.catalogmode'} eq 'import')?'_top':'preview'), - '/res', + &Apache::lonhtmlcommon::crumbs(&Apache::lonnet::clutter($item), + 'preview', + '', (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),2,0,1); } } elsif (exists($field->{'format'}) && $field->{'format'} ne ''){ @@ -3291,11 +3282,15 @@ sub detailed_citation_view { $values{$field->{'name'}}))."
\n"; } else { if ($field->{'special'} eq 'url link') { - $result.= + if ($jumpurl=~/^http\:\/\//) { + $result.=''.$jumpurl.''; + } else { + $result .= &Apache::lonhtmlcommon::crumbs($jumpurl, - (($env{'form.catalogmode'} eq 'import')?'_top':'preview'), + 'preview', '', (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),3,0,1); + } } else { $result.= &mt($field->{'translate'}, $values{$field->{'name'}}); @@ -3351,15 +3346,19 @@ sub summary_view { $result .= ' '.$tmp.' '; } my $jumpurl=$values{'url'}; - $jumpurl=~s/^\/ext\//http\:\/\//; - my $link=&Apache::lonhtmlcommon::crumbs($jumpurl, - (($env{'form.catalogmode'} eq 'import')?'_top':'preview'), + my $link; + if ($jumpurl=~m|^/ext/|) { + $jumpurl=~s|^/ext/|http://|; + $link='
'.$jumpurl.''; + } else { + $link=&Apache::lonhtmlcommon::crumbs($jumpurl, + 'preview', '', (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),2,0,1); - + } $result.=<$values{'title'}$link + target='preview'>$values{'title'}$link $values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}
$values{'copyrighttag'}
$values{'extrashow'} @@ -3392,11 +3391,16 @@ sub summary_preview { sub compact_view { my ($prefix,%values) = @_; my $jumpurl=$values{'url'}; - $jumpurl=~s/^\/ext\//http\:\/\//; - my $link=&Apache::lonhtmlcommon::crumbs($jumpurl, - (($env{'form.catalogmode'} eq 'import')?'_top':'preview'), + my $link; + if ($jumpurl=~m|^/ext/|) { + $jumpurl=~s|^/ext/|http://|; + $link=''.$jumpurl.''; + } else { + $link=&Apache::lonhtmlcommon::crumbs($jumpurl, + 'preview', '', (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1,1,1).' '; + } my $result = $prefix.''; if (exists($env{'form.sortfield'}) && @@ -3405,7 +3409,7 @@ sub compact_view { if (! defined($tmp)) { $tmp = 'undefined'; } $result .= ' '.$tmp.' '; } - $result.=' '. + $result.=' '. $values{'title'}.''.(' 'x2).$link. ''.$values{'author'}.' ('.$values{'domain'}.')
'; return $result; @@ -3428,14 +3432,14 @@ sub fielded_format_view { my $icon=&Apache::loncommon::icon($values{'url'}); my %Translated = &Apache::lonmeta::fieldnames(); my $jumpurl=$values{'url'}; - $jumpurl=~s/^\/ext\//http\:\/\//; + $jumpurl=~s|^/ext/|http://|; my $result=<

URL:
$values{'url'}
+ target='preview'>$values{'url'} END foreach my $field ('title','author','domain','subject','keywords','notes', 'mimetag','language','creationdate','lastrevisiondate',