Diff for /rat/lonpage.pm between versions 1.48 and 1.55

version 1.48, 2003/02/03 18:03:53 version 1.55, 2004/02/24 19:14:42
Line 45  use Apache::Constants qw(:common :http); Line 45  use Apache::Constants qw(:common :http);
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonxml();  use Apache::lonxml();
   use Apache::lonmenu;
 use HTML::TokeParser;  use HTML::TokeParser;
 use GDBM_File;  use GDBM_File;
 use Apache::lonsequence;  use Apache::lonsequence;
Line 144  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 157  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 238  sub handler { Line 245  sub handler {
                                }                                 }
       }        }
                               my $output=Apache::lonnet::ssi($src,%posthash);                                my $output=Apache::lonnet::ssi($src,%posthash);
         $output=~
       s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs;
                               if ($target eq 'tex') {                                if ($target eq 'tex') {
   $output =~ s/^([^&]+)\\begin{document}//;    $output =~ s/^([^&]+)\\begin{document}//;
   $output =~ s/\\end{document}//;    $output =~ s/\\end{document}//;
Line 328  sub handler { Line 337  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>');
   }    }
 # ------------------------------------------------------------------------ Head  # ------------------------------------------------------------------------ Head
   $r->print("\n<head>\n".$allmeta);    $r->print("\n<head>\n".$allmeta);
   $allscript=~  
       s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs;  
   if ($allscript) {    if ($allscript) {
       $r->print("\n<script language='JavaScript'>\n".        $r->print("\n<script language='JavaScript'>\n".
  $allscript."\n</script>\n");   $allscript."\n</script>\n");
   }    }
   $r->print(&Apache::lonxml::registerurl(1,undef));    $r->print(&Apache::lonmenu::registerurl(1,undef));
   $r->print("\n</head>\n");    $r->print("\n</head>\n");
 # ------------------------------------------------------------------ Start body  # ------------------------------------------------------------------ Start body
   if ($isxml) {    if ($isxml) {
       $r->print($xmlbody);        $r->print($xmlbody);
   } else {    } else {
       $r->print('<body bgcolor="#FFFFFF" onLoad="'.&Apache::lonxml::loadevents.'" onUnload="'.&Apache::lonxml::unloadevents.'">');        $r->print(
                  '<body bgcolor="#FFFFFF" onLoad="'.&Apache::lonmenu::loadevents.
                  '" onUnload="'.&Apache::lonmenu::unloadevents.'">'.
                                 &Apache::lonmenu::menubuttons(undef,$target,1)
    );
   }    }
 # ------------------------------------------------------------------ Start form  # ------------------------------------------------------------------ Start form
   if ($nforms) {    if ($nforms) {
Line 391  sub handler { Line 402  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='.
Line 409  sub handler { Line 422  sub handler {
  &Apache::lonnet::declutter($hash{'src_'.$rid});   &Apache::lonnet::declutter($hash{'src_'.$rid});
                                  $metainfo.=                                   $metainfo.=
                   '<a href="/adm/grades?symb='.&Apache::lonnet::escape($symb).                    '<a href="/adm/grades?symb='.&Apache::lonnet::escape($symb).
                   '&command=submission" target="LONcatInfo">'.  #                 '&command=submission" target="LONcatInfo">'.
                     '&command=submission">'.
                           '<img src="/adm/lonMisc/subm_button.gif" border=0>'.                            '<img src="/adm/lonMisc/subm_button.gif" border=0>'.
   '</img></a>'.    '</img></a>'.
                   '<a href="/adm/grades?symb='.&Apache::lonnet::escape($symb).                    '<a href="/adm/grades?symb='.&Apache::lonnet::escape($symb).
                   '&command=gradingmenu" target="LONcatInfo">'.  #                  '&command=gradingmenu" target="LONcatInfo">'.
                     '&command=gradingmenu">'.
                           '<img src="/adm/lonMisc/pgrd_button.gif" border=0>'.                            '<img src="/adm/lonMisc/pgrd_button.gif" border=0>'.
   '</img></a>'.    '</img></a>'.
                   '<a href="/adm/parmset?symb='.&Apache::lonnet::escape($symb).                    '<a href="/adm/parmset?symb='.&Apache::lonnet::escape($symb).
                           '" target="LONcatInfo">'.  #                          '" target="LONcatInfo">'.
                             '" >'.
                           '<img src="/adm/lonMisc/pprm_button.gif" border=0>'.                            '<img src="/adm/lonMisc/pprm_button.gif" border=0>'.
       '</img></a>';        '</img></a>';
                               }                                }

Removed from v.1.48  
changed lines
  Added in v.1.55


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