--- loncom/lonenc.pm 2004/12/20 19:26:53 1.9 +++ loncom/lonenc.pm 2005/01/19 18:16:35 1.10 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for encrypted filenames # -# $Id: lonenc.pm,v 1.9 2004/12/20 19:26:53 albertel Exp $ +# $Id: lonenc.pm,v 1.10 2005/01/19 18:16:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -146,6 +146,22 @@ sub check_decrypt { return $str; } +sub encrypt_ref { + my ($token,$elements)=@_; + my $html; + if ($ENV{'request.enc'}) { + while (my ($name,$value)= each(%{ $elements })) { + if (!$value) { next; } + my $href=&Apache::lonnet::hreflocation($Apache::lonxml::pwd[-1],$value); + if ($href !~ /^http:/) { $href=&Apache::lonenc::encrypted($href); } + $token->[2]->{$name}=$href; + } + $html = &Apache::edit::rebuild_tag($token); + } else { + $html = $token->[4]; + } + return $html; +} 1; __END__