Diff for /loncom/xml/lonxml.pm between versions 1.168 and 1.171

version 1.168, 2002/05/01 21:40:25 version 1.171, 2002/05/21 02:26:53
Line 60 Line 60
   
 package Apache::lonxml;   package Apache::lonxml; 
 use vars   use vars 
 qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace);  qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $prevent_entity_encode);
 use strict;  use strict;
 use HTML::LCParser();  use HTML::LCParser();
 use HTML::TreeBuilder();  use HTML::TreeBuilder();
Line 129  $evaluate = 1; Line 129  $evaluate = 1;
 # stores the list of active tag namespaces  # stores the list of active tag namespaces
 @namespace=();  @namespace=();
   
   # if 0 all high ASCII characters will be encoded into HTML Entities
   $prevent_entity_encode=0;
   
 # has the dynamic menu been updated to know about this resource  # has the dynamic menu been updated to know about this resource
 $Apache::lonxml::registered=0;  $Apache::lonxml::registered=0;
   
Line 344  ENDSUBM Line 347  ENDSUBM
             }              }
     if (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) {      if (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) {
  $hwkadd.=(<<ENDGRDS);   $hwkadd.=(<<ENDGRDS);
                      menu.switchbutton(7,2,'pgrd.gif','problem','grades','gocmd("/adm/grades","viewgrades")');                       menu.switchbutton(7,2,'pgrd.gif','problem','grades','gocmd("/adm/grades","gradingmenu")');
 ENDGRDS  ENDGRDS
             }              }
     if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) {      if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) {
Line 624  sub inner_xmlparse { Line 627  sub inner_xmlparse {
       #evaluate variable refs in result        #evaluate variable refs in result
       if ($result ne "") {        if ($result ne "") {
  if ( $#$parstack > -1 ) {   if ( $#$parstack > -1 ) {
   if ($Apache::lonxml::redirection) {    $result=&Apache::run::evaluate($result,$safeeval,$$parstack[-1]);
     $Apache::lonxml::outputstack['-1'] .=   
       &Apache::run::evaluate($result,$safeeval,$$parstack['-1']);  
   } else {  
     $finaloutput .= &Apache::run::evaluate($result,$safeeval,  
    $$parstack['-1']);  
   }  
  } else {   } else {
   $finaloutput .= &Apache::run::evaluate($result,$safeeval,'');    $result= &Apache::run::evaluate($result,$safeeval,'');
  }   }
  $result = '';  
       }        }
         # Encode any high ASCII characters
         if (!$Apache::lonxml::prevent_entity_encode) {
    $result=&HTML::Entities::encode($result,"\200-\377");
         }
         if ($Apache::lonxml::redirection) {
    $Apache::lonxml::outputstack['-1'] .= $result;
         } else {
    $finaloutput.=$result;
         }
         $result = '';
   
       if ($token->[0] eq 'E') {         if ($token->[0] eq 'E') { 
  &end_tag($stack,$parstack,$token);   &end_tag($stack,$parstack,$token);
       }        }
Line 648  sub inner_xmlparse { Line 655  sub inner_xmlparse {
   #   $finaloutput.=&endredirection;    #   $finaloutput.=&endredirection;
   # }    # }
   
   # Encode any high ASCII characters  
   $finaloutput=&HTML::Entities::encode($finaloutput,"\200-\377");  
   if (($ENV{'QUERY_STRING'}) && ($target eq 'web')) {    if (($ENV{'QUERY_STRING'}) && ($target eq 'web')) {
     $finaloutput=&afterburn($finaloutput);      $finaloutput=&afterburn($finaloutput);
   }    }
Line 1122  BUTTONS Line 1128  BUTTONS
 <a name="editsection" />  <a name="editsection" />
 <form method="post">  <form method="post">
 <input type="hidden" name="editmode" value="Edit" />  <input type="hidden" name="editmode" value="Edit" />
 $buttons  $buttons<br />
 <textarea cols="80" rows="40" name="filecont">$filecontents</textarea>  <textarea cols="80" rows="40" name="filecont">$filecontents</textarea>
 $buttons  <br />$buttons
 <br />  <br />
 </form>  </form>
 ENDFOOTER  ENDFOOTER

Removed from v.1.168  
changed lines
  Added in v.1.171


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