Diff for /loncom/interface/lonprintout.pm between versions 1.107 and 1.109

version 1.107, 2003/01/28 20:36:17 version 1.109, 2003/01/30 16:57:01
Line 240  sub problem_choice_menu { Line 240  sub problem_choice_menu {
  @content_directory = &Apache::lonnet::dirlist($subdirtoprint,   @content_directory = &Apache::lonnet::dirlist($subdirtoprint,
       $domain, $user,'');        $domain, $user,'');
     } else {      } else {
  @content_directory = &Apache::lonnet::dirlist($subdirtoprint);          #local library server res space (allows to print only from the own library server)
    @content_directory = &Apache::lonnet::dirlist($subdirtoprint,$ENV{'user.domain'}, $ENV{'user.name'},'');
     }      }
     for (my $iy=0;$iy<=$#content_directory;$iy++) {      for (my $iy=0;$iy<=$#content_directory;$iy++) {
  my @tempo_array = split(/&/,$content_directory[$iy]);   my @tempo_array = split(/&/,$content_directory[$iy]);
Line 469  ENDPART Line 470  ENDPART
  $LaTeXwidth = $1;   $LaTeXwidth = $1;
     }      }
     if ($choice eq 'Standard LaTeX output for current document') {      if ($choice eq 'Standard LaTeX output for current document') {
       #-- single document - problem, page, html, xml          #-- single document - problem, page, html, xml, ...  
       $selectionmade = 1;        $selectionmade = 1;
       if ($ENV{'form.url'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {        if ($ENV{'form.url'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
         my %moreenv;          my %moreenv;
Line 646  ENDPART Line 647  ENDPART
  &Apache::lonnet::appenv(%moreenv);   &Apache::lonnet::appenv(%moreenv);
  if ($urlp =~ m|/home/([^/]+)/public_html|) {   if ($urlp =~ m|/home/([^/]+)/public_html|) {
     $urlp =~ s|/home/([^/]*)/public_html|/~$1|;      $urlp =~ s|/home/([^/]*)/public_html|/~$1|;
    } else {
       $urlp =~ s|^/home/httpd/html||;
  }   }
  my $texversion=&Apache::lonnet::ssi($urlp);   my $texversion=&Apache::lonnet::ssi($urlp);
  &Apache::lonnet::delenv('form.grade_target','form.textwidth');   &Apache::lonnet::delenv('form.grade_target','form.textwidth');
Line 1284  sub page_format_transformation { Line 1287  sub page_format_transformation {
  } else {   } else {
   ($textwidth,$textheight,$oddoffset,$evenoffset) = ($ENV{'form.width'},$ENV{'form.height'},$ENV{'form.leftmargin'},$ENV{'form.leftmargin'});    ($textwidth,$textheight,$oddoffset,$evenoffset) = ($ENV{'form.width'},$ENV{'form.height'},$ENV{'form.leftmargin'},$ENV{'form.leftmargin'});
  }   }
  my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};      my $firstname = &special_character_corrections(&Apache::lonnet::unescape($ENV{'environment.firstname'}));
  if ($layout eq 'CBI') {      my $lastname = &special_character_corrections(&Apache::lonnet::unescape($ENV{'environment.lastname'}));
     $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm} \\begin{document}\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}} \\hfill  $courseidinfo} \\vskip 5 mm /;      my $courseidinfo = &special_character_corrections(&Apache::lonnet::unescape($ENV{'course.'.$ENV{'request.course.id'}.'.description'}));
  } elsif ($layout eq 'CAPA') {      if ($layout eq 'CBI') {
      if ($choice ne 'All class print') {       $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm} \\begin{document}\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$firstname $lastname}} \\hfill  $courseidinfo} \\vskip 5 mm /;
  $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\setlength{\\topmargin}{1cm}\\setlength{\\headheight}{1cm}\\setlength{\\headsep}{0.5cm}\\markboth{}{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}} $courseidinfo - $assignment}\\pagestyle{myheadings}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}/;      } elsif ($layout eq 'CAPA') {
     } else {   if ($choice ne 'All class print') { 
    $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\setlength{\\topmargin}{1cm}\\setlength{\\headheight}{1cm}\\setlength{\\headsep}{0.5cm}\\markboth{}{\\textbf{$firstname $lastname} $courseidinfo - $assignment}\\pagestyle{myheadings}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}/;
    } else {
  $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}  \\vskip 5 mm /;   $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}  \\vskip 5 mm /;
     }  
  }   }
  return $text;      }
       return $text;
 }  }
   
   
Line 1337  sub details_for_menu { Line 1342  sub details_for_menu {
 }  }
   
   
   sub special_character_corrections {
       my $argument = shift;
       $argument =~ s/_/ /g;
       $argument =~ s/\^/ /g;
       $argument =~ s/&/\\&/g;
       return $argument;
   }
   
   
 sub latex_corrections {  sub latex_corrections {
   
     my ($number_of_columns,$result) = @_;      my ($number_of_columns,$result) = @_;

Removed from v.1.107  
changed lines
  Added in v.1.109


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>