Diff for /rat/lonwrapper.pm between versions 1.12 and 1.19

version 1.12, 2003/04/15 03:53:03 version 1.19, 2006/02/10 21:44:02
Line 25 Line 25
 #  #
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
 # (Edit Handler for RAT Maps  
 # (TeX Content Handler  
 #  
 # 05/29/00,05/30 Gerd Kortemeyer)  
 # 7/1,6/30 Gerd Kortemeyer)  
 #  
 # 7/5 Gerd Kortemeyer  
   
 package Apache::lonwrapper;  package Apache::lonwrapper;
   
 use strict;  use strict;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::lonnet();  use Apache::lonnet;
 use Apache::lonxml();  use Apache::lonxml();
 use Apache::lonmenu;  use Apache::lonmenu;
   
Line 45  use Apache::lonmenu; Line 38  use Apache::lonmenu;
   
 sub handler {  sub handler {
   my $r=shift;    my $r=shift;
   $r->content_type('text/html');    &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;    $r->send_http_header;
   
   return OK if $r->header_only;    return OK if $r->header_only;
Line 54  sub handler { Line 47  sub handler {
                                           ['wrapperdisplay']);                                            ['wrapperdisplay']);
   my $orgurl=$r->uri;    my $orgurl=$r->uri;
   my $url=$orgurl;    my $url=$orgurl;
     $orgurl.=(($orgurl=~/\?/)?'&':'?').$ENV{'QUERY_STRING'};
     $orgurl.=(($orgurl=~/\?/)?'&':'?').'wrapperdisplay=menu';
   $url=~s/^\/adm\/wrapper//;    $url=~s/^\/adm\/wrapper//;
     my $is_ext = $url =~ m|^/ext/|;
   $url=~s/^\/ext\//http\:\/\//;    $url=~s/^\/ext\//http\:\/\//;
   if ($ENV{'form.wrapperdisplay'} eq 'menu') {    $url=~s|:|:|g;
     if ($env{'form.wrapperdisplay'} eq 'menu') {
 #  #
 # Producing the menu buttons  # Producing the menu buttons
 #  #
Line 66  sub handler { Line 63  sub handler {
 #  #
 # Actual URL  # Actual URL
 #  #
       if ($url=~/^\/uploaded\//) {        if ($url=~/\.(problem|exam|quiz|assess|survey|form|library)$/) {
   $url=&Apache::lonnet::tokenwrapper($url);  #
       }  # This is uploaded homework
       $url.=(($url=~/\?/)?'&':'?').$ENV{'QUERY_STRING'}; #reappend the query arguments  #
       my $events='onLoad="'.&Apache::lonmenu::loadevents.            $env{'request.state'}='uploaded';
   '" onUnload="'.&Apache::lonmenu::unloadevents.'"';            &Apache::lonhomework::renderpage($r,$url);
       my $script=&Apache::lonmenu::registerurl(1,undef);        } else {
   #
   # This is not homework
   #
     if ($is_ext) {
         $ENV{'QUERY_STRING'}=~s/(^|\&)symb=[^\&]*/$1/;
     }
     $url.=(($url=~/\?/)?'&':'?').$ENV{'QUERY_STRING'}; 
                                                    # reappend the query arguments
     my $events='onLoad="'.&Apache::lonmenu::loadevents.
         '" onUnload="'.&Apache::lonmenu::unloadevents.'"';
     my $script=&Apache::lonmenu::registerurl(1,undef);
   
       if ($ENV{'browser.interface'} eq 'textual') {    if ($env{'browser.interface'} eq 'textual') {
 #  #
 # ssi-based rendering for text-based interface  # ssi-based rendering for text-based interface
 #  #
   $r->print('<html><head>'.        $r->print('<html><head>'.
                 &Apache::lonmenu::registerurl(1).   &Apache::lonmenu::registerurl(1).
                 '</head><body bgcolor="#FFFFFF">'.   '</head><body bgcolor="#FFFFFF">'.
                 &Apache::lonmenu::menubuttons(1).   &Apache::lonmenu::menubuttons(1).
                 &Apache::lonnet::ssi_body($url).'</body></html>');   &Apache::lonnet::ssi_body($url).'</body></html>');
       } elsif ($ENV{'environment.remote'} eq 'off') {    } elsif ($env{'environment.remote'} eq 'off') {
 #  #
 # This is inline remote  # This is inline remote
 #   # 
   $r->print(<<ENDDOCUMENTINL);        $r->print(<<ENDDOCUMENTINL);
 <html>  <html>
 <head>  <head>
 $script  $script
 </head>  </head>
 <frameset rows="180,*" border=0 $events>  <frameset rows="180,*" border=0 $events>
 <frame src="$orgurl?wrapperdisplay=menu">  <frame src="$orgurl">
 <frame src="$url">  <frame src="$url">
 </frameset>  </frameset>
 </html>  </html>
 ENDDOCUMENTINL  ENDDOCUMENTINL
       } else {            } else {
 #  #
 # frame-based rendering for graphical interface  # frame-based rendering for graphical interface
 #  #
Line 113  $script Line 121  $script
 </frameset>  </frameset>
 </html>  </html>
 ENDDOCUMENT  ENDDOCUMENT
       }            }
   }        } # not homework
     } # not just the menu
   return OK;    return OK;
 }  } # handler
   
 1;  1;
 __END__  __END__

Removed from v.1.12  
changed lines
  Added in v.1.19


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