Diff for /loncom/xml/lonxml.pm between versions 1.358 and 1.367

version 1.358, 2005/02/28 22:17:09 version 1.367, 2005/03/23 22:02:32
Line 178  sub xmlend { Line 178  sub xmlend {
  $mode='problem';   $mode='problem';
  $status=$Apache::inputtags::status[-1];    $status=$Apache::inputtags::status[-1]; 
     }      }
     my $discussion=&Apache::lonfeedback::list_discussion($mode,$status);          my $discussion;
       &Apache::loncommon::get_unprocessed_cgi
           ($ENV{'query_string'},['LONCAPA_INTERNAL_no_discussion']);
       if (! exists($ENV{'form.LONCAPA_INTERNAL_no_discussion'}) ||
           $ENV{'form.LONCAPA_INTERNAL_no_discussion'} ne 'true') {
           $discussion=&Apache::lonfeedback::list_discussion($mode,$status);
       }
     if ($target eq 'tex') {      if ($target eq 'tex') {
  $discussion.='<tex>\keephidden{ENDOFPROBLEM}\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\end{document}</tex>';   $discussion.='<tex>\keephidden{ENDOFPROBLEM}\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\end{document}</tex>';
  &Apache::lonxml::newparser($parser,\$discussion,'');   &Apache::lonxml::newparser($parser,\$discussion,'');
  return '';   return '';
     } else {      } else {
  return $discussion.'</html>';   return $discussion.&Apache::loncommon::endbodytag();
     }      }
 }  }
   
Line 368  sub xmlparse { Line 374  sub xmlparse {
  }   }
  &do_registered_ssi();   &do_registered_ssi();
  if ($Apache::lonxml::counter_changed) { &store_counter() }   if ($Apache::lonxml::counter_changed) { &store_counter() }
    if ($ENV{'form.return_only_error_and_warning_counts'}) {
        return "$errorcount:$warningcount";
    }
  return $finaloutput;   return $finaloutput;
 }  }
   
Line 410  sub latex_special_symbols { Line 419  sub latex_special_symbols {
         $string=~s/([^\\])\#/$1\\\#/g;          $string=~s/([^\\])\#/$1\\\#/g;
     } else {      } else {
  $string=~s/\\/\\ensuremath{\\backslash}/g;   $string=~s/\\/\\ensuremath{\\backslash}/g;
  $string=~s/([^\\]|^)\%/$1\\\%/g;   $string=~s/\\\%|\%/\\\%/g;
  $string=~s/([^\\]|^)\$/$1\\\$/g;   $string=~s/\\{|{/\\{/g;
  $string=~s/([^\\])\_/$1\\_/g;   $string=~s/\\}|}/\\}/g;
  $string=~s/\$\$/\$\\\$/g;   $string=~s/\\\$|\$/\\\$/g;
  $string=~s/\_\_/\_\\\_/g;   $string=~s/\\\_|\_/\\\_/g;
  $string=~s/\#\#/\#\\\#/g;  
         $string=~s/([^\\]|^)(\~|\^)/$1\\$2\\strut /g;          $string=~s/([^\\]|^)(\~|\^)/$1\\$2\\strut /g;
  $string=~s/(>|<)/\\ensuremath\{$1\}/g; #more or less   $string=~s/(>|<)/\\ensuremath\{$1\}/g; #more or less
  $string=&Apache::lonprintout::character_chart($string);   $string=&Apache::lonprintout::character_chart($string);
  # any & or # leftover should be safe to just escape   # any & or # leftover should be safe to just escape
         $string=~s/([^\\]|^)\&/$1\\\&/g;   $string=~s/\\\&|\&/\\\&/g;
         $string=~s/([^\\]|^)\#/$1\\\#/g;   $string=~s/\\\#|\#/\\\#/g;
         $string=~s/\|/\$\\mid\$/g;          $string=~s/\|/\$\\mid\$/g;
 #single { or } How to escape?  #single { or } How to escape?
     }      }
Line 1047  sub get_all_text { Line 1055  sub get_all_text {
 sub newparser {  sub newparser {
   my ($parser,$contentref,$dir) = @_;    my ($parser,$contentref,$dir) = @_;
   push (@$parser,HTML::LCParser->new($contentref));    push (@$parser,HTML::LCParser->new($contentref));
   $$parser['-1']->xml_mode('1');    $$parser[-1]->xml_mode(1);
     $$parser[-1]->marked_sections(1);
   if ( $dir eq '' ) {    if ( $dir eq '' ) {
     push (@Apache::lonxml::pwd, $Apache::lonxml::pwd[$#Apache::lonxml::pwd]);      push (@Apache::lonxml::pwd, $Apache::lonxml::pwd[$#Apache::lonxml::pwd]);
   } else {    } else {
Line 1242  $initialize Line 1251  $initialize
 $xml_help  $xml_help
 <input type="hidden" name="editmode" value="$lt{'ed'}" />  <input type="hidden" name="editmode" value="$lt{'ed'}" />
 $buttons<br />  $buttons<br />
 <textarea cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>  <textarea style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea>
 <br />$buttons  <br />$buttons
 <br />  <br />
 </form>  </form>
Line 1288  sub handler { Line 1297  sub handler {
           
     $Apache::lonxml::debug=$ENV{'user.debug'};      $Apache::lonxml::debug=$ENV{'user.debug'};
           
     if ($ENV{'browser.mathml'}) {      &Apache::loncommon::content_type($request,'text/html');
  #&Apache::loncommon::content_type($request,'text/xml');  
  &Apache::loncommon::content_type($request,'text/html');  
     } else {  
  &Apache::loncommon::content_type($request,'text/html');  
     }  
     &Apache::loncommon::no_cache($request);      &Apache::loncommon::no_cache($request);
     $request->set_last_modified(&Apache::lonnet::metadata($request->uri,      if ($ENV{'request.state'} eq 'published') {
   'lastrevisiondate'));   $request->set_last_modified(&Apache::lonnet::metadata($request->uri,
         'lastrevisiondate'));
       }
     $request->send_http_header;      $request->send_http_header;
           
     return OK if $request->header_only;      return OK if $request->header_only;

Removed from v.1.358  
changed lines
  Added in v.1.367


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