--- loncom/interface/lonsearchcat.pm 2006/05/12 16:45:41 1.264 +++ loncom/interface/lonsearchcat.pm 2006/05/30 12:46:09 1.265 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.264 2006/05/12 16:45:41 albertel Exp $ +# $Id: lonsearchcat.pm,v 1.265 2006/05/30 12:46:09 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -78,6 +78,8 @@ use HTML::Entities(); use Parse::RecDescent; use Apache::lonnavmaps; use Apache::lonindexer(); +use lib '/home/httpd/lib/perl/'; +use LONCAPA; ###################################################################### ###################################################################### @@ -164,8 +166,8 @@ sub handler { } my $persistent_db_file = "/home/httpd/perl/tmp/". - &Apache::lonnet::escape($domain). - '_'.&Apache::lonnet::escape($env{'user.name'}). + &escape($domain). + '_'.&escape($env{'user.name'}). '_'.$env{'form.persistent_db_id'}.'_persistent_search.db'; ## &Apache::lonhtmlcommon::clear_breadcrumbs(); @@ -551,7 +553,7 @@ sub course_search { } else { $url .= '?symb='; } - $url .= &Apache::lonnet::escape($resource->symb()); + $url .= &escape($resource->symb()); my $title = $resource->compTitle(); $r->print('
'. ($title?$title:$url).'  - '.$disctype.'
'); @@ -587,7 +589,7 @@ sub checkonthis { my ($extension)=($url=~/\.(\w+)$/); if (&Apache::loncommon::fileembstyle($extension) eq 'ssi' && ($url) && ($fulltext)) { - $result.=&Apache::lonnet::ssi_body($url.'?symb='.&Apache::lonnet::escape($symb)); + $result.=&Apache::lonnet::ssi_body($url.'?symb='.&escape($symb)); } $result=~s/\s+/ /gs; my $applies = 0; @@ -603,7 +605,7 @@ sub checkonthis { $href=&Apache::lonenc::encrypted($href) .'?symb='.&Apache::lonenc::encrypted($symb); } else { - $href.='?symb='.&Apache::lonnet::escape($symb); + $href.='?symb='.&escape($symb); } $r->print(''.($title?$title:$url). '
'); @@ -1147,7 +1149,7 @@ sub get_persistent_form_data { # End kludge (hopefully) next if (exists($env{$name})); my @values = map { - &Apache::lonnet::unescape($_); + &unescape($_); } split(',',$persistent_db{$name}); next if (@values <1); if ($arrays_allowed{$name}) { @@ -1193,7 +1195,7 @@ sub get_persistent_data { next; } my @values = map { - &Apache::lonnet::unescape($_); + &unescape($_); } split(',',$persistent_db{$name}); if (@values <= 1) { push @Values,$values[0]; @@ -1230,7 +1232,7 @@ sub make_persistent { foreach my $name (keys(%save)) { my @values = (ref($save{$name}) ? @{$save{$name}} : ($save{$name})); # We handle array references, but not recursively. - my $store = join(',', map { &Apache::lonnet::escape($_); } @values ); + my $store = join(',', map { &escape($_); } @values ); $persistent_db{$name} = $store; } untie(%persistent_db); @@ -1313,7 +1315,7 @@ sub parse_advanced_search { foreach ('mode','form','element') { # is this required? Hmmm. next if (! exists($env{'form.'.$_})); - $env{'form.'.$_}=&Apache::lonnet::unescape($env{'form.'.$_}); + $env{'form.'.$_}=&unescape($env{'form.'.$_}); $env{'form.'.$_}=~s/[^\w\/\s\(\)\=\-\"\']//g; } # Preprocess the category form element. @@ -1581,7 +1583,7 @@ sub parse_basic_search { foreach ('mode','form','element') { # is this required? Hmmm. next unless (exists($env{"form.$_"})); - $env{"form.$_"}=&Apache::lonnet::unescape($env{"form.$_"}); + $env{"form.$_"}=&unescape($env{"form.$_"}); $env{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g; } my ($libraries_to_query,$pretty_domains_string) = &parse_domain_restrictions(); @@ -2855,7 +2857,7 @@ sub parse_row { &set_up_table_structure(); } for (my $i=0;$i<=$#Row;$i++) { - $Fields{$Datatypes[$i]->{'name'}}=&Apache::lonnet::unescape($Row[$i]); + $Fields{$Datatypes[$i]->{'name'}}=&unescape($Row[$i]); } $Fields{'language'} = &Apache::loncommon::languagedescription($Fields{'language'}); @@ -2892,7 +2894,7 @@ sub parse_raw_result { # conclude from self to others regarding fields my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash (map { - &Apache::lonnet::unescape($_); + &unescape($_); } (split(/\,/,$result)) ); return %Fields; } @@ -2930,7 +2932,7 @@ sub handle_custom_fields { if ($result=~/^(custom\=.*)$/) { # grab all custom metadata my $tmp=$result; $tmp=~s/^custom\=//; - my ($k,$v)=map {&Apache::lonnet::unescape($_); + my ($k,$v)=map {&unescape($_); } split(/\,/,$tmp); $customhash{$k}=$v; }