File:  [LON-CAPA] / loncom / xml / lontex.pm
Revision 1.5: download - view: text, annotated - select for diffs
Mon Feb 17 17:34:17 2003 UTC (21 years, 2 months ago) by www
Branches: MAIN
CVS tags: version_1_3_X, version_1_3_3, version_1_3_2, version_1_3_1, version_1_3_0, version_1_2_X, version_1_2_99_1, version_1_2_99_0, version_1_2_1, version_1_2_0, version_1_1_X, version_1_1_99_5, version_1_1_99_4, version_1_1_99_3, version_1_1_99_2, version_1_1_99_1, version_1_1_99_0, version_1_1_3, version_1_1_2, version_1_1_1, version_1_1_0, version_1_0_99_3, version_1_0_99_2, version_1_0_99_1, version_1_0_99, version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, conference_2003, HEAD
Starting work on putting "Forward", "Backward", etc, into header of pages
for textual mode.

    1: # The LearningOnline Network with CAPA
    2: # TeX Content Handler
    3: #
    4: # $Id: lontex.pm,v 1.5 2003/02/17 17:34:17 www Exp $
    5: #
    6: # Copyright Michigan State University Board of Trustees
    7: #
    8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    9: #
   10: # LON-CAPA is free software; you can redistribute it and/or modify
   11: # it under the terms of the GNU General Public License as published by
   12: # the Free Software Foundation; either version 2 of the License, or
   13: # (at your option) any later version.
   14: #
   15: # LON-CAPA is distributed in the hope that it will be useful,
   16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18: # GNU General Public License for more details.
   19: #
   20: # You should have received a copy of the GNU General Public License
   21: # along with LON-CAPA; if not, write to the Free Software
   22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23: #
   24: # /home/httpd/html/adm/gpl.txt
   25: #
   26: # http://www.lon-capa.org/
   27: #
   28: #
   29: # Copyright for TtHfunc and TtMfunc by Ian Hutchinson. 
   30: # TtHfunc and TtMfunc (the "Code") may be compiled and linked into 
   31: # binary executable programs or libraries distributed by the 
   32: # Michigan State University (the "Licensee"), but any binaries so 
   33: # distributed are hereby licensed only for use in the context
   34: # of a program or computational system for which the Licensee is the 
   35: # primary author or distributor, and which performs substantial 
   36: # additional tasks beyond the translation of (La)TeX into HTML.
   37: # The C source of the Code may not be distributed by the Licensee
   38: # to any other parties under any circumstances.
   39: #
   40: # 05/29/00,05/30,10/11 Gerd Kortemeyer
   41: 
   42: package Apache::lontex;
   43: 
   44: use strict;
   45: use Apache::File;
   46: use Apache::lontexconvert;
   47: use Apache::Constants qw(:common);
   48: use tth;
   49: 
   50: # ================================================================ Main Handler
   51: 
   52: sub handler {
   53:   my $r=shift;
   54:   my @texcontents;
   55:   my $texstring;
   56: 
   57: # ----------------------------------------------------------- Set document type
   58: 
   59:   if ($ENV{'browser.mathml'}) {
   60:     $r->content_type('text/xml');
   61:   } else {
   62:     $r->content_type('text/html');
   63:   }
   64:   $r->send_http_header;
   65: 
   66:   return OK if $r->header_only;
   67: 
   68: # ------------------------------------------------------------------- Read file
   69: 
   70:   {
   71:     my $fh=Apache::File->new($r->filename);
   72:     @texcontents=<$fh>;
   73:   }
   74: 
   75:   $texstring=join("\n",@texcontents);
   76: 
   77: # --------------------------------------------------------------- Render Output
   78:   
   79:   $r->print(&Apache::lontexconvert::header());
   80:   $r->print(
   81:     '<body bgcolor="#FFFFFF" onLoad="'.
   82:       &Apache::lonmenu::loadevents().
   83:     '" onUnload="'.
   84:       &Apache::lonmenu::unloadevents().
   85:     '">'.
   86:       &Apache::lonmenu::menubuttons(undef,'web',1)
   87:   );
   88:   $r->print(&Apache::lontexconvert::converted(\$texstring));
   89:   $r->print('</body>');
   90:   $r->print(&Apache::lontexconvert::footer());
   91: 
   92:   return OK;
   93: }
   94: 
   95: 1;
   96: __END__
   97: 
   98: 
   99: 
  100: 
  101: 
  102: 
  103: 

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