--- loncom/xml/londefdef.pm 2009/03/31 10:12:45 1.399 +++ loncom/xml/londefdef.pm 2009/04/20 10:40:04 1.402 @@ -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.402 2009/04/20 10:40:04 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -558,13 +558,18 @@ sub start_body { } sub edit_controls { + my ($nochgview) = @_; my $result .= '
-
+
'; + unless ($nochgview) { + $result .= '
'. &Apache::lonxml::renderingoptions().' -
+
'; + } + $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; } @@ -4762,12 +4787,15 @@ sub is_inside_of { # sub latex_header { + my ($mode) = @_; my $currentstring = ''; $currentstring .= + "\n% &Apache::lonxml::londefdef \n" . '\documentclass[letterpaper,twoside]{article}\raggedbottom'; if (($env{'form.latex_type'}=~'batchmode') || - (!$env{'request.role.adv'})) {$currentstring .='\batchmode';} + (!$env{'request.role.adv'}) || + ($mode eq 'batchmode')) {$currentstring .='\batchmode';} $currentstring .= '\newcommand{\keephidden}[1]{}'. '\renewcommand{\deg}{$^{\circ}$}'. '\usepackage{multirow}'. @@ -4795,8 +4823,14 @@ sub latex_header '\usepackage{amssymb}'. '\usepackage{amsfonts}'. '\usepackage{amsthm}'. - '\usepackage{amscd}'; - + '\usepackage{amscd}' + .'\usepackage{picins}\usepackage{calc}'."\n". # From lonprintout.pm + '\usepackage[T1]{fontenc}'."\n". + '\usepackage{lmodern}'."\n". + '\usepackage[postscript]{ucs}'."\n". + '\usepackage[utf8x]{inputenc}'."\n". + '\usepackage{pifont}' . "\n"; + if($env{'form.pdfFormFields'} eq 'yes') { $currentstring .= '\usepackage{hyperref}'. '\usepackage{eforms}'. @@ -4805,6 +4839,7 @@ sub latex_header $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}}'; + $currentstring .= '\begin{document}'; return $currentstring;