--- loncom/interface/loncommon.pm 2006/05/10 21:50:39 1.368 +++ loncom/interface/loncommon.pm 2006/05/11 19:04:31 1.369 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.368 2006/05/10 21:50:39 albertel Exp $ +# $Id: loncommon.pm,v 1.369 2006/05/11 19:04:31 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,6 +64,7 @@ use HTML::Entities; use Apache::lonhtmlcommon(); use Apache::loncoursedata(); use Apache::lontexconvert(); +use LONCAPA; my $readit; @@ -709,7 +710,7 @@ sub help_open_menu { my $timestamp = time; foreach my $datum (\$color,\$function,\$topic,\$component_help,\$faq, \$bug,\$origurl) { - $$datum = &Apache::lonnet::escape($$datum); + $$datum = &escape($$datum); } if (!$stayOnPage) { $link = "javascript:helpMenu('open')"; @@ -775,7 +776,7 @@ ENDTEMPLATE $width,$height).' '.$template; } else { my $help_text; - $help_text=&Apache::lonnet::unescape($topic); + $help_text=&unescape($topic); $template=''; + $prevattempts.=''; } } } @@ -2406,7 +2408,7 @@ sub get_previous_attempt { } else { $value=$lasthash{$key}; } - $value=&Apache::lonnet::unescape($value); + $value=&unescape($value); if ($key =~/$regexp$/ && (defined &$gradesub)) {$value = &$gradesub($value)} $prevattempts.=''; } @@ -2528,7 +2530,7 @@ sub submlink { if (!$symb) { $symb=$cursymb; } } if (!$symb) { $symb=&Apache::lonnet::symbread(); } - $symb=&Apache::lonnet::escape($symb); + $symb=&escape($symb); if ($target) { $target="target=\"$target\""; } return ' &Apache::lonnet::escape($Title), - $id.'.xlabel' => &Apache::lonnet::escape($xlabel), - $id.'.ylabel' => &Apache::lonnet::escape($ylabel), + $id.'.title' => &escape($Title), + $id.'.xlabel' => &escape($xlabel), + $id.'.ylabel' => &escape($ylabel), $id.'.y_max_value'=> $Max, $id.'.labels' => join(',',@$Xlabels), $id.'.PlotType' => 'XY', @@ -4914,9 +4916,9 @@ sub DrawXYYGraph { $ylabel = '' if (! defined($ylabel)); my %ValuesHash = ( - $id.'.title' => &Apache::lonnet::escape($Title), - $id.'.xlabel' => &Apache::lonnet::escape($xlabel), - $id.'.ylabel' => &Apache::lonnet::escape($ylabel), + $id.'.title' => &escape($Title), + $id.'.xlabel' => &escape($xlabel), + $id.'.ylabel' => &escape($ylabel), $id.'.labels' => join(',',@$Xlabels), $id.'.PlotType' => 'XY', $id.'.NumSets' => 2, @@ -4988,7 +4990,7 @@ Inputs: sub chartlink { my ($linktext, $sname, $sdomain) = @_; my $link = ''.$linktext.''; } @@ -5051,11 +5053,11 @@ sub store_course_settings { if (ref($env{'form.'.$setting})) { $stored_form = join(',', map { - &Apache::lonnet::escape($_); + &escape($_); } sort(@{$env{'form.'.$setting}})); } else { $stored_form = - &Apache::lonnet::escape($env{'form.'.$setting}); + &escape($env{'form.'.$setting}); } # Determine if the array contents are the same. if ($stored_form ne $env{$envname}) { @@ -5089,7 +5091,7 @@ sub restore_course_settings { } elsif ($type eq 'array') { $env{'form.'.$setting} = [ map { - &Apache::lonnet::unescape($_); + &unescape($_); } split(',',$env{$envname}) ]; } @@ -5162,7 +5164,7 @@ sub escape_double { sub escape_url { my ($url) = @_; my @urlslices = split(/\//, $url,-1); - my $lastitem = &Apache::lonnet::escape(pop(@urlslices)); + my $lastitem = &escape(pop(@urlslices)); return join('/',@urlslices).'/'.$lastitem; } =pod
'. &help_open_topic($component_help,$help_text,$stayOnPage, $width,$height).''.$template. @@ -803,7 +804,7 @@ sub help_open_bug { my $link=''; my $template=''; my $url=$Apache::lonnet::perlvar{'BugzillaHost'}.'enter_bug.cgi?product=LON-CAPA&bug_file_loc='. - &Apache::lonnet::escape($ENV{'REQUEST_URI'}).'&component='.$topic; + &escape($ENV{'REQUEST_URI'}).'&component='.$topic; if (!$stayOnPage) { $link = "javascript:void(open('$url', 'Bugzilla', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height,resizable=yes'))"; @@ -2024,10 +2025,11 @@ sub screenname { # ------------------------------------------------------------- Message Wrapper sub messagewrapper { - my ($link,$username,$domain)=@_; + my ($link,$username,$domain,$subject,$text)=@_; return ''.$link.''; } # --------------------------------------------------------------- Notes Wrapper @@ -2394,7 +2396,7 @@ sub get_previous_attempt { } else { $value=$returnhash{$version.':'.$key}; } - $prevattempts.=''.&Apache::lonnet::unescape($value).' '.&unescape($value).' '.$value.'