Diff for /loncom/publisher/Attic/lonconstruct.pm between versions 1.6 and 1.24

version 1.6, 2001/12/04 15:34:57 version 1.24, 2004/10/29 20:44:30
Line 36 Line 36
 #  #
 # 11/22,11/23,11/28,  # 11/22,11/23,11/28,
 # 03/30/01 Gerd Kortemeyer  # 03/30/01 Gerd Kortemeyer
   
 package Apache::lonconstruct;  package Apache::lonconstruct;
   
   
 use strict;  use strict;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http :methods);
   use Apache::lonnet;
   use Apache::Log ();
   use HTML::Entities();
   
   my $DEBUG = 0;
   =pod
   
   =item Debug($request, $message)
   
     If debugging is enabled puts out a debuggin message determined by the
     caller.  The debug message goes to the Apache error log file. Debugging
     is enabled by ssetting the module global DEBUG variable to nonzero (TRUE).
   
    Parameters:
   
   =over 4
    
   =item $request - The curretn request operation.
   
   =item $message - The message to put inthe log file.
   
   =back
     
    Returns:
      nothing.
   
   =cut
   
   sub Debug {
     
     # Marshall the parameters.
     
     my $r       = shift;
     my $log     = $r->log;
     my $message = shift;
     
     # Put out the indicated message butonly if DEBUG is false.
     
     if ($DEBUG) {
       $log->debug($message);
     }
   }
   
   
 # ================================================================ Main Handler  # ================================================================ Main Handler
   
Line 54  sub handler { Line 97  sub handler {
    return OK if $r->header_only;     return OK if $r->header_only;
   
    my $lowerframe=$r->path_info;     my $lowerframe=$r->path_info;
      &Debug($r, "Initial URL for lower frame: ".$lowerframe);
    $lowerframe=~s/^\//\/\~/;     $lowerframe=~s/^\//\/\~/;
      &Debug($r, "Lower frame URL afer ~ subst: ".$lowerframe);
      $lowerframe= &HTML::Entities::encode($lowerframe,'<>&"');
      &Debug($r, "Lower frame URL after quote subst: ".$lowerframe);
   
   #
   # Are we forcing edit mode?
   #
   
      &Apache::loncommon::get_unprocessed_cgi
           ($ENV{'QUERY_STRING'},['forceedit']);
      if ($ENV{'form.forceedit'}) {
          $lowerframe.='?editmode=Edit&problemmode=EditXML';
      }
      &Apache::loncommon::get_unprocessed_cgi
           ($ENV{'QUERY_STRING'},['forceColoredit']);
      if ($ENV{'form.forceColoredit'}) {
          $lowerframe.='?editmode=Edit&problemmode=Edit';
      }
   
   #
   # Checking to see if we should display the topframe
   #
      my $toprows = 0;
      my $topsrc = '';
      if ($ENV{'environment.remote'} eq 'on') {
          $toprows = '110';
          $topsrc = '/adm/localize/adm/publisher.html';
      }
    $r->print(<<ENDPAGE);     $r->print(<<ENDPAGE);
 <html>  <html>
 <head><title>LON-CAPA Construction Space</title></head>  <head><title>LON-CAPA Construction Space</title>
 <frameset rows="110,*">  <script language="JavaScript">
 <frame src='/adm/publisher.html'>  var lastknownpriv="$lowerframe";
 <frame src='$lowerframe' name="LONCAPAToBePublished">  </script>
   </head>
   <frameset rows="$toprows,*" border="0">
   <frame src='$topsrc'>
   <frame src="$lowerframe" name="LONCAPAToBePublished">
 </frameset>  </frameset>
 </html>  </html>
 ENDPAGE  ENDPAGE

Removed from v.1.6  
changed lines
  Added in v.1.24


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