Diff for /loncom/xml/lonxml.pm between versions 1.196 and 1.204

version 1.196, 2002/09/13 20:46:09 version 1.204, 2002/10/17 17:13:44
Line 99  use Apache::edit(); Line 99  use Apache::edit();
 use Apache::lonnet();  use Apache::lonnet();
 use Apache::File();  use Apache::File();
 use Apache::loncommon();  use Apache::loncommon();
   use Apache::lonfeedback();
   use Apache::lonmsg();
   
 #==================================================   Main subroutine: xmlparse    #==================================================   Main subroutine: xmlparse  
 #debugging control, to turn on debugging modify the correct handler  #debugging control, to turn on debugging modify the correct handler
Line 138  $Apache::lonxml::registered=0; Line 140  $Apache::lonxml::registered=0;
 # a pointer the the Apache request object  # a pointer the the Apache request object
 $Apache::lonxml::request='';  $Apache::lonxml::request='';
   
   # a problem number counter, and check on hether it is used
   $Apache::lonxml::counter=0;
   $Apache::lonxml::counter_changed=0;
   
 sub xmlbegin {  sub xmlbegin {
   my $output='';    my $output='';
   if ($ENV{'browser.mathml'}) {    if ($ENV{'browser.mathml'}) {
Line 232  sub xmlend { Line 238  sub xmlend {
           }            }
           if ($discussiononly) {            if ($discussiononly) {
       $discussion.=(<<ENDDISCUSS);        $discussion.=(<<ENDDISCUSS);
 <form action="/adm/feedback" method="post">  <form action="/adm/feedback" method="post" name="mailform">
 <input type="submit" name="discuss" value="Post Discussion" />  <input type="submit" name="discuss" value="Post Discussion" />
 <input type="submit" name="anondiscuss" value="Post Anonymous Discussion" />  <input type="submit" name="anondiscuss" value="Post Anonymous Discussion" />
 <input type="hidden" name="symb" value="$symb" />  <input type="hidden" name="symb" value="$symb" />
Line 243  course faculty</font><br /> Line 249  course faculty</font><br />
 <textarea name=comment cols=60 rows=10 wrap=hard></textarea>  <textarea name=comment cols=60 rows=10 wrap=hard></textarea>
 </form>  </form>
 ENDDISCUSS  ENDDISCUSS
                $discussion.=&Apache::lonfeedback::generate_preview_button();
           }            }
        }         }
     }      }
Line 363  sub registerurl { Line 370  sub registerurl {
     my $forcereg=shift;      my $forcereg=shift;
     my $target = shift;      my $target = shift;
     my $result = '';      my $result = '';
       
     if ($target eq 'edit') {      if ($target eq 'edit') {
         $result .="<script>\n".          $result .="<script>\n".
             "if (typeof menu != 'undefined') {menu.currentURL=null;}\n".              "if (typeof menu != 'undefined') {menu.currentURL=null;}\n".
Line 379  sub registerurl { Line 387  sub registerurl {
     $Apache::lonxml::registered=1;      $Apache::lonxml::registered=1;
     my $nothing='';      my $nothing='';
     if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; }      if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; }
       my $newmail='';
       if (&Apache::lonmsg::newmail()) { 
          $newmail='menu.setstatus("you have","messages");';
       }
     my $timesync='menu.syncclock(1000*'.time.');';      my $timesync='menu.syncclock(1000*'.time.');';
     if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) {      if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) {
         my $hwkadd='';          my $hwkadd='';
Line 408  ENDPARM Line 420  ENDPARM
   menu=window.open("$nothing","LONCAPAmenu","",false);    menu=window.open("$nothing","LONCAPAmenu","",false);
           menu.clearTimeout(menu.menucltim);            menu.clearTimeout(menu.menucltim);
           $timesync            $timesync
             $newmail
   menu.currentURL=window.location.pathname;    menu.currentURL=window.location.pathname;
           menu.reloadURL=window.location.pathname;            menu.reloadURL=window.location.pathname;
           menu.currentStale=0;            menu.currentStale=0;
Line 546  sub xmlparse { Line 559  sub xmlparse {
  if ($ENV{'request.uri'}) {   if ($ENV{'request.uri'}) {
     &writeallows($ENV{'request.uri'});      &writeallows($ENV{'request.uri'});
  }   }
    if ($Apache::lonxml::counter_changed) { &store_counter() }
  return $finaloutput;   return $finaloutput;
 }  }
   
Line 575  sub latex_special_symbols { Line 589  sub latex_special_symbols {
     $current_token=~s/\\/\\char92 /g;      $current_token=~s/\\/\\char92 /g;
     $current_token=~s/\^/\\char94 /g;      $current_token=~s/\^/\\char94 /g;
     $current_token=~s/\~/\\char126 /g;      $current_token=~s/\~/\\char126 /g;
     $current_token=~s/(&[^a-z#])/\\$1/g;      $current_token=~s/(&[^a-z\#])/\\$1/g;
     $current_token=~s/([^&]\#)/\\$1/g;      $current_token=~s/([^&])\#/$1\\#/g;
     $current_token=~s/(\$|_|{|})/\\$1/g;      $current_token=~s/(\$|_|{|})/\\$1/g;
     $current_token=~s/\\char92 /\\texttt{\\char92}/g;      $current_token=~s/\\char92 /\\texttt{\\char92}/g;
     $current_token=~s/>/\$>\$/g; #more      $current_token=~s/>/\$>\$/g; #more
Line 838  sub setup_globals { Line 852  sub setup_globals {
   my ($request,$target)=@_;    my ($request,$target)=@_;
   $Apache::lonxml::request=$request;    $Apache::lonxml::request=$request;
   $Apache::lonxml::registered = 0;    $Apache::lonxml::registered = 0;
     &init_counter();
   @Apache::lonxml::pwd=();    @Apache::lonxml::pwd=();
   @Apache::lonxml::extlinks=();    @Apache::lonxml::extlinks=();
   if ($target eq 'meta') {    if ($target eq 'meta') {
Line 1021  sub get_all_text_unbalanced { Line 1036  sub get_all_text_unbalanced {
  return $result   return $result
 }  }
   
   sub increment_counter {
       $Apache::lonxml::counter++;
       $Apache::lonxml::counter_changed=1;
   }
   
   sub init_counter {
       if (defined($ENV{'form.counter'})) {
    $Apache::lonxml::counter=$ENV{'form.counter'};
       } elsif (not defined($Apache::lonxml::counter)) {
    $Apache::lonxml::counter=1;
    &store_counter();
       }
       $Apache::lonxml::counter_changed=0;
   }
   
   sub store_counter {
       &Apache::lonnet::appenv(('form.counter' => $Apache::lonxml::counter));
       return '';
   }
   
 sub get_all_text {  sub get_all_text {
  my($tag,$pars)= @_;   my($tag,$pars)= @_;
  my $depth=0;   my $depth=0;
Line 1312  ENDNOTFOUND Line 1347  ENDNOTFOUND
 sub debug {  sub debug {
   if ($Apache::lonxml::debug eq 1) {    if ($Apache::lonxml::debug eq 1) {
     $|=1;      $|=1;
     print("DEBUG:".&HTML::Entities::encode($_[0])."<br />\n");      print('<font size="-2"<pre>DEBUG:'.&HTML::Entities::encode($_[0])."</pre></font>\n");
   }    }
 }  }
   

Removed from v.1.196  
changed lines
  Added in v.1.204


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