--- loncom/xml/londefdef.pm 2009/03/31 10:12:45 1.399
+++ loncom/xml/londefdef.pm 2009/04/13 20:42:32 1.401
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.399 2009/03/31 10:12:45 foxr Exp $
+# $Id: londefdef.pm,v 1.401 2009/04/13 20:42:32 raeburn Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -558,13 +558,18 @@ sub start_body {
}
sub edit_controls {
+ my ($nochgview) = @_;
my $result .= '
';
@@ -1612,6 +1617,26 @@ sub start_a {
my $href=&Apache::lonxml::get_param('href',$parstack,$safeeval,
undef,1);
$currentstring=&Apache::lonenc::encrypt_ref($token,{'href'=>$href});
+ if ($href =~ /\S/) {
+ if ($href !~ m{^https?://}) {
+ my $url=&Apache::lonnet::hreflocation('',$env{'request.filename'});
+ my $linkurl;
+ if ($href =~ m{^/uploaded/}) {
+ $linkurl = $href;
+ } elsif ($href =~ m{^[^/]}) {
+ my $path = $url;
+ $path =~ s{[^/]*$}{};
+ $linkurl = $path.$href;
+ }
+ if ($linkurl =~ m{^/uploaded/}) {
+ if (!&Apache::lonnet::allowed('bre',$linkurl)) {
+ if (&Apache::lonnet::is_on_map($url)) {
+ &Apache::lonxml::extlink($linkurl);
+ }
+ }
+ }
+ }
+ }
}
return $currentstring;
}