Diff for /rat/lonpage.pm between versions 1.52 and 1.56

version 1.52, 2003/07/19 13:11:41 version 1.56, 2004/03/22 20:37:06
Line 145  sub handler { Line 145  sub handler {
   
   if ($r->header_only) {    if ($r->header_only) {
        if ($ENV{'browser.mathml'}) {         if ($ENV{'browser.mathml'}) {
            $r->content_type('text/xml');             &Apache::loncommon::content_type($r,'text/xml');
        } else {         } else {
            $r->content_type('text/html');              &Apache::loncommon::content_type($r,'text/html'); 
        }         }
        $r->send_http_header;         $r->send_http_header;
        return OK;         return OK;
Line 158  sub handler { Line 158  sub handler {
   my $number_of_columns = 1;    my $number_of_columns = 1;
   my $requrl=$r->uri;      my $requrl=$r->uri;  
   my $target = $ENV{'form.grade_target'};    my $target = $ENV{'form.grade_target'};
   #  &Apache::lonnet::logthis("Got a target of $target");
     if ($target eq 'meta') {
         &Apache::loncommon::content_type($r,'text/html');
         $r->send_http_header;
         return OK;
     }
 # ----------------------------------------------------------------- Tie db file  # ----------------------------------------------------------------- Tie db file
   if (($ENV{'request.course.fn'}) && (!$ENV{'form.forceselect'})) {    if (($ENV{'request.course.fn'}) && (!$ENV{'form.forceselect'})) {
       my $fn=$ENV{'request.course.fn'};        my $fn=$ENV{'request.course.fn'};
Line 228  sub handler { Line 234  sub handler {
 # --------------------------------------------------------- This is an SSI cell  # --------------------------------------------------------- This is an SSI cell
       my $prefix=$_.'_';        my $prefix=$_.'_';
                               my %posthash=('request.prefix' => $prefix);                                my %posthash=('request.prefix' => $prefix);
         if ($ENV{'form.grade_target'} eq 'tex') {
     $posthash{'grade_target'}=$ENV{'form.grade_target'};
     $posthash{'textwidth'}=$ENV{'form.textwidth'};
     $posthash{'problem_split'}=$ENV{'form.problem_split'};
     $posthash{'latex_type'}=$ENV{'form.latex_type'};
     $posthash{'rndseed'}=$ENV{'form.rndseed'};
         }
                               if (($ENV{'form.'.$prefix.'submit'})                                 if (($ENV{'form.'.$prefix.'submit'}) 
                                || ($ENV{'form.all_submit'})) {                                 || ($ENV{'form.all_submit'})) {
                                foreach (keys %ENV) {                                 foreach (keys %ENV) {
Line 331  sub handler { Line 344  sub handler {
                      }                        } 
                   }                    }
                   unless ($contents) {                    unless ($contents) {
                       $r->content_type('text/html');                        &Apache::loncommon::content_type($r,'text/html');
                       $r->send_http_header;                        $r->send_http_header;
                       $r->print('<html><body>Empty page.</body></html>');                        $r->print('<html><body>'.&mt('Empty page').'.</body></html>');
                   } else {                    } else {
 # ------------------------------------------------------------------ Build page  # ------------------------------------------------------------------ Build page
   
 # ---------------------------------------------------------------- Send headers  # ---------------------------------------------------------------- Send headers
       unless ($target eq 'tex') {        unless ($target eq 'tex') {
   if ($isxml) {    if ($isxml) {
       $r->content_type('text/xml');        &Apache::loncommon::content_type($r,'text/xml');
       $r->send_http_header;        $r->send_http_header;
       $r->print($xmlheader);        $r->print($xmlheader);
   } else {    } else {
       $r->content_type('text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
       $r->print('<html>');        $r->print('<html>');
   }    }
Line 371  sub handler { Line 384  sub handler {
       $r->print('<form method="post" action="'.        $r->print('<form method="post" action="'.
  $requrl.'">');   $requrl.'">');
   }    }
       } else {        } elsif ($target eq 'tex') {
   $r->print('\documentclass{article}    $r->print('\documentclass{article}
                                  \newcommand{\keephidden}[1]{}                                              \newcommand{\keephidden}[1]{}           
                                  \usepackage[dvips]{graphicx}                                   \usepackage[dvips]{graphicx}
Line 396  sub handler { Line 409  sub handler {
                           my $avespan=$lcm/($#colcont+1);                            my $avespan=$lcm/($#colcont+1);
                           for ($j=0;$j<=$#colcont;$j++) {                            for ($j=0;$j<=$#colcont;$j++) {
                               my $rid=$colcont[$j];                                my $rid=$colcont[$j];
                               my $metainfo='<a href="'.                                my $metainfo='<a name="'.
     &Apache::lonnet::escape(&Apache::lonnet::declutter($hash{'src_'.$rid})).'" />'.
     '<a href="'.
                                     $metalink{$rid}.'" target="LONcatInfo">'.                                      $metalink{$rid}.'" target="LONcatInfo">'.
                           '<img src="/adm/lonMisc/cat_button.gif" border=0>'.                            '<img src="/adm/lonMisc/cat_button.gif" border=0>'.
   '</img></a><a href="/adm/evaluate?postdata='.    '</img></a><a href="/adm/evaluate?postdata='.

Removed from v.1.52  
changed lines
  Added in v.1.56


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