--- loncom/xml/londefdef.pm 2008/11/10 11:17:50 1.396 +++ loncom/xml/londefdef.pm 2009/04/11 01:12:58 1.396.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.396 2008/11/10 11:17:50 foxr Exp $ +# $Id: londefdef.pm,v 1.396.2.2 2009/04/11 01:12:58 raeburn Exp $ # # # Copyright Michigan State University Board of Trustees @@ -212,14 +212,7 @@ sub start_html { '\usepackage{amsmath}'. '\usepackage{amssymb}'. '\usepackage{amsfonts}'. - '\usepackage{amsthm}'. - '\usepackage{amscd}'; - - if($env{'form.pdfFormFields'} eq 'yes') { - $currentstring .= '\usepackage{hyperref}'. - '\usepackage{eforms}'. - '\usepackage{tabularx}'; - } + '\usepackage{amsthm}'; $currentstring .= '\newenvironment{choicelist}{\begin{list}{}{\setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.05in}\setlength{\itemsep}{0.022in}\setlength{\parsep}{0in}\setlength{\belowdisplayskip}{0.04in}\setlength{\abovedisplayskip}{0.05in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.04in}}}{\end{list}}'. '\renewenvironment{theindex}{\begin{list}{}{{\vskip 1mm \noindent \large\textbf{Index}} \newline \setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.01in}\setlength{\itemsep}{0.1in}\setlength{\parsep}{-0.02in}\setlength{\belowdisplayskip}{0.01in}\setlength{\abovedisplayskip}{0.01in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.01in}}}{\end{list}}'; @@ -1657,6 +1650,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; }