Diff for /loncom/interface/loncommon.pm between versions 1.316 and 1.317

version 1.316, 2006/03/21 18:32:19 version 1.317, 2006/03/21 20:36:15
Line 2741  Inputs: Line 2741  Inputs:
   
 =item * $notopbar, if true, keep the 'what is this' info but remove the  =item * $notopbar, if true, keep the 'what is this' info but remove the
                    navigational links                     navigational links
   
   =item * $bgcolor, used to override the bg coor on a webpage to a specific value
   
 =back  =back
   
 Returns: A uniform header for LON-CAPA web pages.    Returns: A uniform header for LON-CAPA web pages.  
Line 3056  Returns a complete <html> .. <body> sect Line 3059  Returns a complete <html> .. <body> sect
 Inputs: $title - optional title for the page  Inputs: $title - optional title for the page
         $head_extra - optional extra HTML to incude inside the <head>          $head_extra - optional extra HTML to incude inside the <head>
         $args - additional optional args supported are:          $args - additional optional args supported are:
                   only_body   -> is true will set &bodytag() onlybodytag arg on                    only_body      -> is true will set &bodytag() onlybodytag
                   no_nav_bar  -> is true will set &bodytag() notopbar arg on                                      arg on
                   add_entries -> additional attributes to add to the  <body>                    no_nav_bar     -> is true will set &bodytag() notopbar arg on
                   domain      -> force to color decorate a page for a                     add_entries    -> additional attributes to add to the  <body>
                                  specific domain                    domain         -> force to color decorate a page for a 
                   function    -> force usage of a specific rolish color scheme                                      specific domain
                   redirect    -> see &headtag()                    function       -> force usage of a specific rolish color
                   bgcolor     -> override the default page bg color                                      scheme
                  js_ready     -> return a string ready for being used in                     redirect       -> see &headtag()
                                  a javascript writeln                    bgcolor        -> override the default page bg color
                     js_ready       -> return a string ready for being used in 
                                       a javascript writeln
                     force_register -> if is true will turn on the &bodytag()
                                       $forcereg arg
   
 =back  =back
   
Line 3081  sub start_page { Line 3088  sub 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, $args->{'function'}, $args->{'add_entries'},   &bodytag($title, 
  $args->{'only_body'},   $args->{'function'},       $args->{'add_entries'},
  undef,undef,undef,$args->{'no_nav_bar'},$args->{'bgcolor'});   $args->{'only_body'},      $args->{'domain'},
    $args->{'force_register'}, undef,
    $args->{'no_nav_bar'},     $args->{'bgcolor'});
     if ($args->{'js_ready'}) {      if ($args->{'js_ready'}) {
  $result =~ s/[\n\r]/ /g;   $result = &js_ready($result);
  $result =~ s/'/\\'/g;  
     }      }
     return $result;      return $result;
 }  }
Line 3111  sub end_page { Line 3119  sub end_page {
     $env{'internal.end_page'}++;      $env{'internal.end_page'}++;
     my $result = &endbodytag()."\n</html>";      my $result = &endbodytag()."\n</html>";
     if ($args->{'js_ready'}) {      if ($args->{'js_ready'}) {
  $result =~ s/[\n\r]/ /g;   $result = &js_ready($result);
  $result =~ s/'/\\'/g;  
     }      }
     return $result;      return $result;
 }  }
   
   sub js_ready {
       my ($result) = @_;
       $result = &HTML::Entities::encode($result,'<>&"');
   
       $result =~ s/[\n\r]/ /g;
       $result =~ s/'/\\'/g;
       
       return $result;
   }
   
 sub validate_page {  sub validate_page {
     if (  exists($env{'internal.start_page'})      if (  exists($env{'internal.start_page'})
   &&     $env{'internal.start_page'} > 1) {    &&     $env{'internal.start_page'} > 1) {

Removed from v.1.316  
changed lines
  Added in v.1.317


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