Diff for /loncom/xml/lonxml.pm between versions 1.259 and 1.266

version 1.259, 2003/05/29 18:41:04 version 1.266, 2003/07/08 14:49:30
Line 70  use Math::Cephes(); Line 70  use Math::Cephes();
 use Math::Random();  use Math::Random();
 use Opcode();  use Opcode();
   
   
 sub register {  sub register {
   my ($space,@taglist) = @_;    my ($space,@taglist) = @_;
   foreach my $temptag (@taglist) {    foreach my $temptag (@taglist) {
Line 95  use Apache::run(); Line 96  use Apache::run();
 use Apache::londefdef();  use Apache::londefdef();
 use Apache::scripttag();  use Apache::scripttag();
 use Apache::edit();  use Apache::edit();
   use Apache::inputtags();
   use Apache::outputtags();
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::File();  use Apache::File();
 use Apache::loncommon();  use Apache::loncommon();
Line 151  $Apache::lonxml::counter_changed=0; Line 154  $Apache::lonxml::counter_changed=0;
 #internal check on whether to look at style defs  #internal check on whether to look at style defs
 $Apache::lonxml::usestyle=1;  $Apache::lonxml::usestyle=1;
   
   #locations used to store the parameter string for style substitutions
   $Apache::lonxml::style_values='';
   $Apache::lonxml::style_end_values='';
   
 sub xmlbegin {  sub xmlbegin {
   my $output='';    my $output='';
   if ($ENV{'browser.mathml'}) {    if ($ENV{'browser.mathml'}) {
Line 382  sub fontsettings() { Line 389  sub fontsettings() {
     if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) {       if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) { 
  $headerstring.=   $headerstring.=
     '<meta Content-Type="text/html; charset=x-mac-roman">';      '<meta Content-Type="text/html; charset=x-mac-roman">';
     } elsif (!$ENV{'browser.mathml'}) {      } elsif (!$ENV{'browser.mathml'} && $ENV{'browser.unicode'}) {
  $headerstring.=   $headerstring.=
     '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';      '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
     }      }
Line 497  sub inner_xmlparse { Line 504  sub inner_xmlparse {
   my $dontpop=0;    my $dontpop=0;
   while ( $#$pars > -1 ) {    while ( $#$pars > -1 ) {
     while ($token = $$pars['-1']->get_token) {      while ($token = $$pars['-1']->get_token) {
       if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) {        if (($token->[0] eq 'T') || ($token->[0] eq 'C') ) {
  if ($metamode<1) {   if ($metamode<1) {
     my $text=$token->[1];      my $text=$token->[1];
     if ($token->[0] eq 'C' && $target eq 'tex') {      if ($token->[0] eq 'C' && $target eq 'tex') {
Line 506  sub inner_xmlparse { Line 513  sub inner_xmlparse {
     }      }
     $result.=$text;      $result.=$text;
  }   }
         } elsif (($token->[0] eq 'D')) {
    if ($metamode<1 && $target eq 'web') {
       my $text=$token->[1];
       $result.=$text;
    }
       } elsif ($token->[0] eq 'PI') {        } elsif ($token->[0] eq 'PI') {
  if ($metamode<1) {   if ($metamode<1 && $target eq 'web') {
   $result=$token->[2];    $result=$token->[2];
  }   }
       } elsif ($token->[0] eq 'S') {        } elsif ($token->[0] eq 'S') {
Line 1130  sub inserteditinfo { Line 1142  sub inserteditinfo {
       my ($result,$filecontents)=@_;        my ($result,$filecontents)=@_;
       $filecontents = &HTML::Entities::encode($filecontents);        $filecontents = &HTML::Entities::encode($filecontents);
 #      my $editheader='<a href="#editsection">Edit below</a><hr />';  #      my $editheader='<a href="#editsection">Edit below</a><hr />';
       my $xml_help = '<table><tr><td>'.        my $xml_help = Apache::loncommon::helpLatexCheatsheet();
   &Apache::loncommon::help_open_topic("Greek_Symbols",'Greek Symbols',  
       undef,undef,600)  
       .'</td><td>'.  
           &Apache::loncommon::help_open_topic("Other_Symbols",'Other Symbols',  
       undef,undef,600)  
       .'</td></tr></table>';  
       my $titledisplay=&display_title();        my $titledisplay=&display_title();
       my $buttons=(<<BUTTONS);        my $buttons=(<<BUTTONS);
 <input type="submit" name="attemptclean"   <input type="submit" name="attemptclean" 
Line 1240  ENDNOTFOUND Line 1246  ENDNOTFOUND
     if ($ENV{'form.attemptclean'}) {      if ($ENV{'form.attemptclean'}) {
  $filecontents=&htmlclean($filecontents,1);   $filecontents=&htmlclean($filecontents,1);
     }      }
   #
   # we are in construction space, see if edit mode forced
               &Apache::loncommon::get_unprocessed_cgi
                             ($ENV{'QUERY_STRING'},['editmode']);
  }   }
  if (!$ENV{'form.editmode'} || $ENV{'form.viewmode'}) {   if (!$ENV{'form.editmode'} || $ENV{'form.viewmode'}) {
     $result = &Apache::lonxml::xmlparse($request,$target,$filecontents,      $result = &Apache::lonxml::xmlparse($request,$target,$filecontents,
Line 1316  sub error { Line 1326  sub error {
   
 sub warning {  sub warning {
   $warningcount++;    $warningcount++;
   if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) {    
     print "<b>W</b>ARNING<b>:</b>".join('<br />',@_)."<br />\n";    if ($ENV{'form.grade_target'} ne 'tex') {
         if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) {
           print "<b>W</b>ARNING<b>:</b>".join('<br />',@_)."<br />\n";
         }
   }    }
 }  }
   
Line 1426  sub description { Line 1439  sub description {
 # calls to lonnet functions for this setup.  # calls to lonnet functions for this setup.
 # - looks for form.grade_ parameters  # - looks for form.grade_ parameters
 sub whichuser {  sub whichuser {
     my ($passedsymb)=@_;
   my ($symb,$courseid,$domain,$name,$publicuser);    my ($symb,$courseid,$domain,$name,$publicuser);
   if (defined($ENV{'form.grade_symb'})) {    if (defined($ENV{'form.grade_symb'})) {
     my $tmp_courseid=$ENV{'form.grade_courseid'};      my $tmp_courseid=$ENV{'form.grade_courseid'};
Line 1437  sub whichuser { Line 1451  sub whichuser {
       $name=$ENV{'form.grade_username'};        $name=$ENV{'form.grade_username'};
     }      }
   } else {    } else {
       $symb=&Apache::lonnet::symbread();        if (!$passedsymb) {
             $symb=&Apache::lonnet::symbread();
         } else {
             $symb=$passedsymb;
         }
       $courseid=$ENV{'request.course.id'};        $courseid=$ENV{'request.course.id'};
       $domain=$ENV{'user.domain'};        $domain=$ENV{'user.domain'};
       $name=$ENV{'user.name'};        $name=$ENV{'user.name'};

Removed from v.1.259  
changed lines
  Added in v.1.266


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