Diff for /loncom/interface/loncommon.pm between versions 1.327 and 1.330

version 1.327, 2006/04/07 21:56:00 version 1.330, 2006/04/11 18:43:46
Line 2768  sub bodytag { Line 2768  sub bodytag {
     my $vlink=&designparm($function.'.vlink',$domain);      my $vlink=&designparm($function.'.vlink',$domain);
     my $sidebg=&designparm($function.'.sidebg',$domain);      my $sidebg=&designparm($function.'.sidebg',$domain);
 # Accessibility font enhance  # Accessibility font enhance
     unless ($addentries) { $addentries=''; }  
     my $addstyle='';      my $addstyle='';
     if ($env{'browser.fontenhance'} eq 'on') {      if ($env{'browser.fontenhance'} eq 'on') {
  $addstyle=' font-size: x-large;';   $addstyle=' font-size: x-large;';
Line 2787  sub bodytag { Line 2786  sub bodytag {
 # Port for miniserver  # Port for miniserver
     my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'};      my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'};
     if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; }      if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; }
   
       my $extra_body_attr = &make_attr_string($forcereg,$addentries);
   
 # construct main body tag  # construct main body tag
     my $bodytag = <<END;      my $bodytag = <<END;
 <style type="text/css">  <style type="text/css">
Line 2799  form, .inline { display: inline; } Line 2801  form, .inline { display: inline; }
 .filename {font-family: monospace;}  .filename {font-family: monospace;}
 </style>  </style>
 <body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link"  <body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link"
 style="margin-top: 0px;$addstyle" $addentries>  style="margin-top: 0px;$addstyle" $extra_body_attr>
 END  END
     &Apache::lontexconvert::jsMath_reset();  
     if ($env{'environment.texengine'} eq 'jsMath' ||      $bodytag .= &Apache::lontexconvert::init_math_support();
  $env{'form.texengine'}        eq 'jsMath' ) {  
  $bodytag.=&Apache::lontexconvert::jsMath_header();  
     }  
   
     my $upperleft='<img src="http://'.$ENV{'HTTP_HOST'}.':'.      my $upperleft='<img src="http://'.$ENV{'HTTP_HOST'}.':'.
                    $lonhttpdPort.$img.'" alt="'.$function.'" />';                     $lonhttpdPort.$img.'" alt="'.$function.'" />';
Line 2934  $titleinfo $dc_info $menu Line 2933  $titleinfo $dc_info $menu
 ENDBODY  ENDBODY
 }  }
   
   sub make_attr_string {
       my ($register,$attr_ref) = @_;
   
       if ($attr_ref && !ref($attr_ref)) {
    die("addentries Must be a hash ref ".
       join(':',caller(1))." ".
       join(':',caller(0))." ");
       }
   
       if ($register) {
    $attr_ref->{'onload'}   = &Apache::lonmenu::loadevents().
       $attr_ref->{'onload'};
    $attr_ref->{'onunload'} = &Apache::lonmenu::unloadevents().
       $attr_ref->{'onunload'};
       }
       my $attr_string;
       foreach my $attr (keys(%$attr_ref)) {
    $attr_string .= " $attr=\"".$attr_ref->{$attr}.'" ';
       }
       return $attr_string;
   }
   
   
 ###############################################  ###############################################
 ###############################################  ###############################################
   
Line 3086  Inputs: $title - optional title for the Line 3108  Inputs: $title - optional title for the
                   body_title     -> alternate text to use instead of $title                    body_title     -> alternate text to use instead of $title
                                     in the title box that appears, this text                                      in the title box that appears, this text
                                     is not auto translated like the $title is                                      is not auto translated like the $title is
                     frameset       -> if true will start with a <frameset>
                                       rather than <body>
 =back  =back
   
 =cut  =cut
Line 3104  sub start_page { Line 3127  sub start_page {
     $env{'internal.start_page'}++;      $env{'internal.start_page'}++;
     my $result =       my $result = 
  &Apache::lonxml::xmlbegin().   &Apache::lonxml::xmlbegin().
  &headtag($title,$head_extra,\%head_args).&endheadtag().   &headtag($title,$head_extra,\%head_args).&endheadtag();
  &bodytag($title,       if ($args->{'frameset'}) {
  $args->{'function'},       $args->{'add_entries'},   my $attr_string = &make_attr_string($args->{'force_register'},
  $args->{'only_body'},      $args->{'domain'},      $args->{'add_entries'});
  $args->{'force_register'}, $args->{'body_title'},   $result .= "\n<frameset $attr_string>\n";
  $args->{'no_nav_bar'},     $args->{'bgcolor'});      } else {
    $result .=
       &bodytag($title, 
        $args->{'function'},       $args->{'add_entries'},
        $args->{'only_body'},      $args->{'domain'},
        $args->{'force_register'}, $args->{'body_title'},
        $args->{'no_nav_bar'},     $args->{'bgcolor'});
       }
     if ($args->{'js_ready'}) {      if ($args->{'js_ready'}) {
  $result = &js_ready($result);   $result = &js_ready($result);
     }      }
Line 3119  sub start_page { Line 3149  sub start_page {
     return $result;      return $result;
 }  }
   
   
 =pod  =pod
   
 =over 4  =over 4
Line 3132  Inputs:         $args - additional optio Line 3163  Inputs:         $args - additional optio
                                  a javascript writeln                                   a javascript writeln
                  html_encode  -> return a string ready for being used in                    html_encode  -> return a string ready for being used in 
                                  a html attribute                                   a html attribute
                    frameset     -> if true will start with a <frameset>
                                    rather than <body>
 =back  =back
   
 =cut  =cut
Line 3140  sub end_page { Line 3173  sub end_page {
     my ($args) = @_;      my ($args) = @_;
     #&Apache::lonnet::logthis("end_page ".join(':',caller(0)));      #&Apache::lonnet::logthis("end_page ".join(':',caller(0)));
     $env{'internal.end_page'}++;      $env{'internal.end_page'}++;
     my $result = &endbodytag()."\n</html>";      my $result;
       if ($args->{'frameset'}) {
    $result .= '</frameset>';
       } else {
    $result .= &endbodytag();
       }
       $result .= "\n</html>";
   
     if ($args->{'js_ready'}) {      if ($args->{'js_ready'}) {
  $result = &js_ready($result);   $result = &js_ready($result);
     }      }
Line 3689  sub get_posted_cgi { Line 3729  sub get_posted_cgi {
     }      }
  }   }
     }      }
   #
   # Digested POSTed values
   #
   # Remember the way this was originally done (GET or POST)
   #
     $env{'request.method'}=$ENV{'REQUEST_METHOD'};      $env{'request.method'}=$ENV{'REQUEST_METHOD'};
     $r->method_number(M_GET);  #
   # There may also be stuff in the query string
   # Tell subsequent handlers that this was GET, not POST, so they can access query string.
   # Also, unset POSTed content length to cover all tracks.
   #
   
   # This does not work, because M_GET is not defined (if it's defined, it is just 0). 
   # Commenting out for now ... not sure if harm is done.
   #    $r->method_number(M_GET);
   
     $r->method('GET');      $r->method('GET');
     $r->headers_in->unset('Content-length');      $r->headers_in->unset('Content-length');
 }  }

Removed from v.1.327  
changed lines
  Added in v.1.330


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