Diff for /rat/lonwrapper.pm between versions 1.22 and 1.35

version 1.22, 2006/04/04 15:11:48 version 1.35, 2009/10/21 23:29:10
Line 26 Line 26
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
   
   
 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::lonenc();
   use Apache::lonmenu();
   
 # ================================================================ Main Handler  # ================================================================ Main Handler
   
Line 51  sub simple_menu { Line 53  sub simple_menu {
 sub wrapper {  sub wrapper {
     my ($topurl,$bottomurl) = @_;      my ($topurl,$bottomurl) = @_;
   
     if ($env{'browser.interface'} eq 'textual') {      my %layout = ('border' => 0);
 #      if ($env{'environment.remote'} eq 'off') {
 # ssi-based rendering for text-based interface          if ($env{'environment.icons'} eq 'iconsonly') {
 #             $layout{'rows'} = "100,*";
  return           } else {
     &Apache::loncommon::start_page('Menu',undef,     $layout{'rows'} = "200,*";
   {'bgcolor'        => '#FFFFFF',          }
    'force_register' => 1,      } else {
        }).   $layout{'rows'} = "1,*";
     &Apache::lonnet::ssi_body($bottomurl).   $topurl = "/adm/rat/empty.html";
     &Apache::loncommon::end_page();  
     }      }
   
     my $events='onLoad="'.&Apache::lonmenu::loadevents.      my $start_page = 
  '" onUnload="'.&Apache::lonmenu::unloadevents.'"';   &Apache::loncommon::start_page(undef,undef,
          {'force_register' => 1,
    'frameset'       => 1,
    'add_entries'    => \%layout, });
   
       my $end_page = 
    &Apache::loncommon::end_page({'frameset' => 1});
           
     my $result = &Apache::lonxml::xmlbegin().      foreach my $url ($topurl,$bottomurl) {
  &Apache::loncommon::head(undef,undef,   if ($url !~ /^https?\:/) {
  {'force_register' => 1});      $url = &Apache::lonenc::check_encrypt($url);
      }
     if ($env{'environment.remote'} eq 'off') {      }
 #  
 # This is inline remote  
 #   
  $result .= <<ENDDOCUMENTINL;  
 <frameset rows="180,*" border="0" $events>  
 <frame src="$topurl">  
 <frame src="$bottomurl">  
 </frameset>  
 ENDDOCUMENTINL  
     } else {  
 #  #
 # frame-based rendering for graphical interface  # frame-based rendering for graphical interface
 #  #
  $result .=<<ENDDOCUMENT;      my $result =<<ENDDOCUMENT;
 <frameset rows="1,*" border="0" $events>  $start_page
 <frame src="/adm/rat/empty.html">  test
 <frame src="$bottomurl">  <frame src="$topurl" />
 </frameset>  <frame src="$bottomurl" />
   $end_page
 ENDDOCUMENT  ENDDOCUMENT
     }  
   
     $result .= "\n</html>\n";      return $result;
 }  }
   
 sub handler {  sub handler {
Line 116  sub handler { Line 113  sub handler {
     $orgurl.=(($orgurl=~/\?/)?'&':'?').'wrapperdisplay=menu';      $orgurl.=(($orgurl=~/\?/)?'&':'?').'wrapperdisplay=menu';
     $url=~s/^\/adm\/wrapper//;      $url=~s/^\/adm\/wrapper//;
     my $is_ext = $url =~ m|^/ext/|;      my $is_ext = $url =~ m|^/ext/|;
     $url=~s/^\/ext\//http\:\/\//;      $url=~s{^/ext/}{http://};
       $url=~s|http://https://|https://|;
     $url=~s|&colon;|:|g;      $url=~s|&colon;|:|g;
 #  #
 # Actual URL  # Actual URL
Line 133  sub handler { Line 131  sub handler {
 #  #
  if ($is_ext) {   if ($is_ext) {
     $ENV{'QUERY_STRING'}=~s/(^|\&)symb=[^\&]*/$1/;      $ENV{'QUERY_STRING'}=~s/(^|\&)symb=[^\&]*/$1/;
               $ENV{'QUERY_STRING'} =~ s/\&$//;  
  }   }
  $url.=(($url=~/\?/)?'&':'?').$ENV{'QUERY_STRING'};           unless ($ENV{'QUERY_STRING'} eq '') {
       $url.=(($url=~/\?/)?'&':'?').$ENV{'QUERY_STRING'};
           }
  # reappend the query arguments   # reappend the query arguments
  $r->print(&wrapper($orgurl,$url));   $r->print(&wrapper($orgurl,$url));
     } # not just the menu      } # not just the menu
Line 144  sub handler { Line 145  sub handler {
 1;  1;
 __END__  __END__
   
   =pod
   
   =head1 NAME
   
   Apache::lonwrapper - External and binary file management.
   
   =head1 SYNOPSIS
   
   Wrapper for external and binary files as standalone resources. Edit handler for rat maps; TeX content handler.
   
   This is part of the LearningOnline Network with CAPA project
   described at http://www.lon-capa.org.
   
   =head1 Subroutines
   
   =over
   
   =item simple_menu()
   
   =item wrapper()
   
   =item handler()
   
   =back
   
   =cut
   
   
   
   

Removed from v.1.22  
changed lines
  Added in v.1.35


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