--- loncom/xml/lonxml.pm 2002/10/03 15:04:29 1.198 +++ loncom/xml/lonxml.pm 2002/10/17 14:42:07 1.203 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.198 2002/10/03 15:04:29 www Exp $ +# $Id: lonxml.pm,v 1.203 2002/10/17 14:42:07 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -100,6 +100,7 @@ use Apache::lonnet(); use Apache::File(); use Apache::loncommon(); use Apache::lonfeedback(); +use Apache::lonmsg(); #================================================== Main subroutine: xmlparse #debugging control, to turn on debugging modify the correct handler @@ -382,6 +383,10 @@ sub registerurl { $Apache::lonxml::registered=1; my $nothing=''; 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.');'; if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) { my $hwkadd=''; @@ -411,6 +416,7 @@ ENDPARM menu=window.open("$nothing","LONCAPAmenu","",false); menu.clearTimeout(menu.menucltim); $timesync + $newmail menu.currentURL=window.location.pathname; menu.reloadURL=window.location.pathname; menu.currentStale=0; @@ -579,11 +585,7 @@ sub latex_special_symbols { $current_token=~s/\^/\\char94 /g; $current_token=~s/\~/\\char126 /g; $current_token=~s/(&[^a-z\#])/\\$1/g; - if ($current_token=~/ \#\w/) { - $current_token=~s/ \#(\w)/ \\#$1/; - } else { - $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/>/\$>\$/g; #more @@ -845,6 +847,14 @@ sub setup_globals { my ($request,$target)=@_; $Apache::lonxml::request=$request; $Apache::lonxml::registered = 0; + if ($ENV{'form.counter'}) { + $Apache::lonxml::counter=$ENV{'form.counter'} + } elsif (not defined $Apache::lonxml::counter) { + $Apache::lonxml::counter=1; + my %moreenv; + $moreenv{'form.counter'}=$Apache::lonxml::counter; + &Apache::lonnet::appenv(%moreenv); + } @Apache::lonxml::pwd=(); @Apache::lonxml::extlinks=(); if ($target eq 'meta') { @@ -1319,7 +1329,7 @@ ENDNOTFOUND sub debug { if ($Apache::lonxml::debug eq 1) { $|=1; - print("DEBUG:".&HTML::Entities::encode($_[0])."
\n"); + print('DEBUG:'.&HTML::Entities::encode($_[0])."\n"); } }