Annotation of loncom/interface/lonprintout.pm, revision 1.50

1.1       www         1: # The LearningOnline Network
                      2: # Printout
                      3: #
1.50    ! albertel    4: # $Id: lonprintout.pm,v 1.49 2002/08/09 20:38:42 sakharuk Exp $
1.11      albertel    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: #
1.1       www        28: # (Internal Server Error Handler
                     29: #
                     30: # (Login Screen
                     31: # 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
                     32: # 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
                     33: #
                     34: # 3/1/1 Gerd Kortemeyer)
                     35: #
                     36: # 3/1 Gerd Kortemeyer
                     37: #
1.3       sakharuk   38: # 9/17 Alex Sakharuk
                     39: #
1.1       www        40: package Apache::lonprintout;
                     41: 
                     42: use strict;
1.10      albertel   43: use Apache::Constants qw(:common :http);
1.2       sakharuk   44: use Apache::lonxml;
                     45: use Apache::lonnet;
1.13      sakharuk   46: use Apache::inputtags;
                     47: use Apache::edit;
1.5       sakharuk   48: use Apache::File();
1.34      sakharuk   49: use POSIX qw(strftime);
1.3       sakharuk   50: 
                     51: 
                     52: sub headerform {
1.1       www        53:     my $r = shift;
1.3       sakharuk   54:     $r->print(<<ENDHEADER);
                     55: <html>
                     56: <head>
                     57: <title>LON-CAPA output for printing</title>
                     58: </head>
                     59: <body bgcolor="FFFFFF">
                     60: <form method="post" enctype="multipart/form-data" action="/adm/printout" name="printform">
1.38      www        61: <tt>$ENV{'form.postdata'}</tt><p>
1.16      sakharuk   62: <h1>What do you want to print? Make a choice.</h1><br />
1.3       sakharuk   63: ENDHEADER
                     64: }
                     65: 
1.1       www        66: 
1.3       sakharuk   67: sub menu_for_output {
                     68:     my $r = shift;
1.28      sakharuk   69:     $r->print(<<ENDMENUOUT1);
1.3       sakharuk   70: <input type="hidden" name="phase" value="two">
1.10      albertel   71: <input type="hidden" name="url" value="$ENV{'form.postdata'}">
1.25      sakharuk   72: <input type="radio" name="choice" value="Standard LaTeX output for current document" checked>  Current document
1.16      sakharuk   73: (you will print what you see on the screen)<br />
1.39      sakharuk   74: ENDMENUOUT1
1.48      sakharuk   75:     if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) {
1.39      sakharuk   76:     $r->print(<<ENDMENUOUT2);
1.19      sakharuk   77: <input type="radio" name="choice" value="Standard LaTeX output for the primary sequence">  All problems from the primary sequence<br />
1.20      sakharuk   78: <input type="radio" name="choice" value="Standard LaTeX output for whole primary sequence">  The whole primary sequence (problems plus all html and xml files)<br />
1.19      sakharuk   79: <input type="radio" name="choice" value="Standard LaTeX output for the top level sequence">  All problems from the top level sequence<br />
1.28      sakharuk   80: <br />
                     81: ENDMENUOUT2
1.44      sakharuk   82:     }
1.39      sakharuk   83:       my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
                     84:       $subdirtoprint =~ s/\/[^\/]+$//;
                     85:       if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') {
                     86: 	  $r->print(<<ENDMENUOUT4);
                     87:   <input type="radio" name="choice" value="Subdirectory print">  All problems from current subdirectory (where this particular problem is)<br />
                     88: ENDMENUOUT4
                     89:       }
                     90:     $r->print(<<ENDMENUOUT5);
1.16      sakharuk   91: <br /><hr /><br />
                     92: <h1>And what page format do you prefer?</h1>
1.36      sakharuk   93: <table>
                     94:  <tr>
                     95:    <td>
                     96:      <input type="radio" name="layout" value="CBI"> Landscape <br />
                     97:      <input type="radio" name="layout" value="CAPA" checked>  Portrait <br />
                     98:    </td>
                     99:    <td>&nbsp;</td>
                    100:    <td rawspan="2">
1.44      sakharuk  101:      Number of columns: <select name="numberofcolumns">
                    102:                          <option selected> 1 </option>
                    103:                          <option> 2 </option>
                    104:                          <option> 3 </option>
                    105:                          <option> 4 </option>
                    106:                          <option> 5 </option>
                    107:                          <option> 6 </option>
                    108:                          <option> 7 </option>
                    109:                          <option> 8 </option>
                    110:                          <option> 9 </option>
                    111:                         </select> 
1.36      sakharuk  112:    </td>
                    113:  </tr>
                    114: </table>
                    115: </br> 
1.16      sakharuk  116: <input type="submit" value="Submit your choice">
1.3       sakharuk  117: </form>
                    118: </body>
                    119: </html>
1.39      sakharuk  120: ENDMENUOUT5
1.3       sakharuk  121: }
1.2       sakharuk  122: 
                    123: 
1.16      sakharuk  124: 
                    125: 
1.3       sakharuk  126: sub output_data {
                    127:     my $r = shift;
                    128:     $r->print(<<ENDPART);
                    129: <html>
                    130: <head>
                    131: <title>LON-CAPA output for printing</title>
                    132: </head>
                    133: <body bgcolor="FFFFFF">
                    134: <hr>
                    135: ENDPART
1.2       sakharuk  136: 
1.3       sakharuk  137:     my $choice = $ENV{'form.choice'};
1.16      sakharuk  138:     my $layout = $ENV{'form.layout'};
1.36      sakharuk  139:     my $numberofcolumns = $ENV{'form.numberofcolumns'};               
1.16      sakharuk  140:     my $laystyle = 'book';
1.2       sakharuk  141:     my $result = '';
1.34      sakharuk  142:     my $number_of_columns = 1;
1.48      sakharuk  143: #    my $number_of_columns = $ENV{'form.numberofcolumns'};    
1.36      sakharuk  144:  
1.3       sakharuk  145:     if ($choice eq 'Standard LaTeX output for current document') {
1.36      sakharuk  146:       #-- single document - problem, page, html, xml  
1.14      albertel  147:       my %moreenv;
                    148:       $moreenv{'form.grade_target'}='tex';
1.48      sakharuk  149:       if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) {
                    150: 	  $ENV{'form.url'}=~s/http:\/\/[^\/]+//;
                    151:       }
1.14      albertel  152:       $moreenv{'request.filename'}=$ENV{'form.url'};
                    153:       &Apache::lonnet::appenv(%moreenv);
                    154:       my $texversion=&Apache::lonnet::ssi($ENV{'form.url'});
                    155:       &Apache::lonnet::delenv('form.grade_target');
                    156:       $result .= $texversion;
1.29      sakharuk  157:       $result = &additional_cleanup($result);
1.40      sakharuk  158:       if ($ENV{'form.url'}=~m/\.page\s*$/) {
                    159: 	  ($result,$number_of_columns) = &page_cleanup($result);
                    160:       }
                    161:     } elsif ($choice eq 'Standard LaTeX output for the primary sequence' or 
                    162:              $choice eq 'Standard LaTeX output for whole primary sequence') {
1.36      sakharuk  163:       #-- minimal sequence to which the current document belongs
                    164:         #-- where is the primary sequence containing file?
1.18      sakharuk  165: 	my $symbolic = &Apache::lonnet::symbread($ENV{'form.url'});
                    166: 	$_ = $symbolic;
                    167: 	m/([^_]+)_/;
                    168: 	my $primary_sequence = '/res/'.$1;
1.36      sakharuk  169:         #-- open and analyses the primary sequence
1.18      sakharuk  170: 	my $sequence_file=&Apache::lonnet::filelocation("",$primary_sequence);
                    171: 	my $sequencefilecontents=&Apache::lonnet::getfile($sequence_file);
                    172: 	my @master_seq = &content_map($sequencefilecontents);
1.36      sakharuk  173:         #-- produce an output string
1.18      sakharuk  174: 	for (my $i=0;$i<=$#master_seq;$i++) {
                    175: 	    $_ = $master_seq[$i];
                    176: 	    m/\"(.*)\"/;
                    177:             $_ = $1;
1.36      sakharuk  178:             my $urlp = $1;		
1.20      sakharuk  179: 	    if ($choice eq 'Standard LaTeX output for the primary sequence') {
1.36      sakharuk  180: 		if ($urlp =~ m/\.(problem|exam|quiz|assess|survey|form|library)/) {
1.20      sakharuk  181: 		    my %moreenv;
                    182: 		    $moreenv{'form.grade_target'}='tex';
                    183: 		    &Apache::lonnet::appenv(%moreenv);
                    184: 		    my $texversion=&Apache::lonnet::ssi($urlp);
                    185: 		    &Apache::lonnet::delenv('form.grade_target');
                    186: 		    $result .= $texversion;        
                    187: 		}
                    188: 	    } else {
1.36      sakharuk  189: 		my %moreenv;
1.18      sakharuk  190: 		$moreenv{'form.grade_target'}='tex';
                    191: 		&Apache::lonnet::appenv(%moreenv);
                    192: 		my $texversion=&Apache::lonnet::ssi($urlp);
                    193: 		&Apache::lonnet::delenv('form.grade_target');
1.20      sakharuk  194: 		$result .= $texversion;    
1.16      sakharuk  195: 	    }
1.28      sakharuk  196: 	}	
                    197: 	$result = &additional_cleanup($result);
1.13      sakharuk  198:     }  elsif ($choice eq 'Standard LaTeX output for the top level sequence') {
1.47      sakharuk  199:         # where is the main sequence of the course?
1.13      sakharuk  200: 	my $main_seq = '/res/'.$ENV{'request.course.uri'};
                    201: 	my $file=&Apache::lonnet::filelocation("",$main_seq);
                    202: 	my $filecontents=&Apache::lonnet::getfile($file);
                    203: 	my @file_seq = &content_map($filecontents);
1.48      sakharuk  204: 	for (my $iu=0;$iu<=$#file_seq;$iu++) {
                    205: 	    $file_seq[$iu]=~s/^"//;
                    206: 	    $file_seq[$iu]=~s/"$//;
1.49      sakharuk  207: 	    if ($file_seq[$iu]=~m/\S+/) {
                    208: 		$file_seq[$iu]=&Apache::lonnet::filelocation("",$file_seq[$iu]);
                    209: 	    } else {
                    210: 		$file_seq[$iu]= 'REMOVE IT PLEASE';
                    211: 	    }
1.48      sakharuk  212: 	}
                    213: 	my $i=0;
1.49      sakharuk  214:         my $limit = $#file_seq;		    
                    215:         while ($i<=$limit) {	
1.48      sakharuk  216: 	    unless ($file_seq[$i]=~m/\.(problem|page)/) {
                    217: 		if ($file_seq[$i]=~m/\.sequence/) {
                    218: 		    my $filecontents=&Apache::lonnet::getfile($file_seq[$i]);
                    219: 		    my @newfile_seq = &content_map($filecontents);
1.49      sakharuk  220: 		    for (my $iu=0;$iu<=$#newfile_seq;$iu++) {
                    221: 			$newfile_seq[$iu]=~s/^"//;
                    222: 	                $newfile_seq[$iu]=~s/"$//;
                    223: 			if ($newfile_seq[$iu]=~m/\S+/) {
                    224: 			    $newfile_seq[$iu]=&Apache::lonnet::filelocation("",$newfile_seq[$iu]);
                    225: 			} else {
                    226: 			    $newfile_seq[$iu]= 'REMOVE IT PLEASE';
                    227: 			}
                    228: 		    }
                    229: 		    splice @file_seq,$i,1,@newfile_seq;
                    230: 		    $i=0;
                    231: 		    $limit = $#file_seq;
1.48      sakharuk  232: 		} else {
1.49      sakharuk  233: 		    splice @file_seq,$i,1,'REMOVE IT PLEASE';
1.48      sakharuk  234: 		}
                    235: 	    }
                    236: 	    $i++;
                    237: 	}
                    238: 	for (my $iu=0;$iu<=$#file_seq;$iu++) {
1.49      sakharuk  239: 	    if ($file_seq[$iu]=~m/REMOVE IT PLEASE/) {
                    240: 		splice @file_seq,$iu,1;
                    241: 	    }
                    242: 	}
                    243: 	if ($file_seq[-1]=~m/REMOVE IT PLEASE/) {
                    244: 	    pop @file_seq;
1.48      sakharuk  245: 	}
1.13      sakharuk  246: #-- produce an output string
1.49      sakharuk  247: 	for (my $i=0;$i<=$#file_seq;$i++) {
                    248:             my $urlp = $file_seq[$i];
                    249: 	    $urlp=~s/\/home\/httpd\/html//;	    
                    250:             if ($urlp=~m/\.(problem|exam|quiz|assess|survey|form|library)/) {
                    251: 		my %moreenv;
                    252: 		$moreenv{'form.grade_target'}='tex';
                    253: 		&Apache::lonnet::appenv(%moreenv);
                    254: 		my $texversion=&Apache::lonnet::ssi($urlp);
                    255: 		&Apache::lonnet::delenv('form.grade_target');
                    256: 		$result .= $texversion;        
                    257: 	    }
                    258: 	}	    
                    259: 	$result = &additional_cleanup($result);
1.31      sakharuk  260:     } elsif ($choice eq 'Subdirectory print') {      
                    261: 	my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
                    262: 	$subdirtoprint =~ s/\/[^\/]+$//;
                    263: 	my @list_of_files = ();
1.48      sakharuk  264: 	if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) {
1.45      sakharuk  265: 	    $subdirtoprint =~ s/^[^~]*~(\w+)\//\/home\/$1\/public_html\//;
                    266: 	} else {
                    267: 	    $subdirtoprint =~ s/.*(\/res\/)/$1/;
                    268: 	}
1.46      sakharuk  269: 	my @content_directory = ();
1.48      sakharuk  270: 	if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) {
1.46      sakharuk  271: 	    @content_directory = &Apache::lonnet::dirlist($subdirtoprint,$ENV{'user.domain'}, $ENV{'user.name'},'');
1.45      sakharuk  272: 	} else {
1.46      sakharuk  273: 	    @content_directory = &Apache::lonnet::dirlist($subdirtoprint);
                    274: 	}
                    275: 	for (my $iy=0;$iy<=$#content_directory;$iy++) {
                    276: 	    my @tempo_array = split(/&/,$content_directory[$iy]);
                    277: 	    if ($tempo_array[0] =~ m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/) {
                    278: 		push(@list_of_files,$tempo_array[0]);
1.28      sakharuk  279: 	    }
1.13      sakharuk  280: 	}
1.45      sakharuk  281: 	$subdirtoprint =~ s/\/$//;
1.31      sakharuk  282: 	for (my $i=0;$i<=$#list_of_files;$i++) {
1.45      sakharuk  283: 	    my $urlp = $subdirtoprint.'/'.$list_of_files[$i];
1.31      sakharuk  284: 	    my %moreenv;
                    285: 	    $moreenv{'form.grade_target'}='tex';
                    286: 	    &Apache::lonnet::appenv(%moreenv);
1.48      sakharuk  287: 	    if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) { 
                    288: 		$urlp =~ s/\/home\/([^\/]*)\/public_html/\/~$1/; 
                    289: 	    }
1.31      sakharuk  290: 	    my $texversion=&Apache::lonnet::ssi($urlp);
                    291: 	    &Apache::lonnet::delenv('form.grade_target');
                    292: 	    $texversion =~ s/(\\begin{document})/$1 {\\tiny\\begin{verbatim}$urlp\\end{verbatim}}/;
                    293: 	    $result .= $texversion;   
                    294: 	}
                    295: 	$result = &additional_cleanup($result);
                    296: 	
                    297: 	
1.28      sakharuk  298: 
                    299: 
                    300: 
1.31      sakharuk  301: 	
1.7       sakharuk  302:     }
1.16      sakharuk  303: #-- corrections for the different page formats
1.36      sakharuk  304:     if ($layout eq 'CBI' and $numberofcolumns eq '1') {
                    305:     } elsif ($layout eq 'CBI' and $numberofcolumns eq '2') {
1.16      sakharuk  306: 	$result =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{-40pt}\\setlength{\\evensidemargin}{-60pt}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{4\.4in}\\setlength{\\textheight}{6\.8in}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt} \\begin{document}/;
                    307:         $laystyle = 'album';
                    308:     } elsif ($layout eq 'CAPA') {
                    309:         my $courseidinfo = $ENV{'request.role'};
                    310:         $_ = $courseidinfo;
                    311:         m/.*\/(.*)/;
                    312:         $courseidinfo = $ENV{'course.physnet_'.$1.'.description'};
1.34      sakharuk  313: #	$result =~ s/\\documentclass\[letterpaper\]{article}/\\documentclass\[twocolumn\]{article}/;
                    314: 	$result =~ s/\\documentclass\[letterpaper\]{article}/\\documentclass{article}/;
                    315: 	$result =~ s/\\begin{document}/\\textheight 25\.9cm\\oddsidemargin = -0\.57in\\evensidemargin = -0\.57in\\textwidth= 9cm\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}}\\hskip 1\.4in $courseidinfo} \\vskip 5 mm /;	
1.27      sakharuk  316: 	$result =~ s/\\includegraphics{/\\includegraphics\[width=9\.0 cm\]{/g;
1.37      sakharuk  317: #	$result =~ s/\\includegraphics{/\\includegraphics\[width=\\textwidth\]{/g;
                    318: #	$result =~ s/(\\end{document})/\\newline\\noindent\\makebox\[9.0cm\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Dept\. of Physics and Astronomy, MSU\\makebox\[1.5cm\]\[b\]{\\hfill}LON-CAPA\\copyright MSU GNU\/GPL $1/;
1.50    ! albertel  319: 	$result =~ s/(\\end{document})/\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny \\makebox\[1.5cm\]\[b\]{\\hfill}LON-CAPA\\copyright Michigan State University Board of Trustees $1/;
1.37      sakharuk  320: #        $result =~ s/(\\end{longtable}\s*)(\\newline\\noindent\\makebox\[9\.0cm\]\[b\]{\\hrulefill})/$2$1/g;
                    321:         $result =~ s/(\\end{longtable}\s*)(\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g;
1.34      sakharuk  322:         $result =~ s/(\\end{longtable}\s*)\\newline/$1/g;
1.37      sakharuk  323: 	$result =~ s/\$number_of_columns/$number_of_columns/g;
1.16      sakharuk  324:     }
1.23      sakharuk  325: #-- LaTeX corrections     
                    326:     my $first_comment = index($result,'<!--',0);
                    327:     while ($first_comment != -1) {
                    328: 	my $end_comment = index($result,'-->',$first_comment);
                    329: 	substr($result,$first_comment,$end_comment-$first_comment+3) = '';
                    330: 	$first_comment = index($result,'<!--',$first_comment);
                    331:     }
1.17      sakharuk  332:     $result =~ s/^\s+$//gm; #remove empty lines
1.47      sakharuk  333:     $result =~ s/\s%/\\%/g;   #corrects %
1.20      sakharuk  334:     $result =~ s/(\s)+/$1/g; #removes more than one empty space
1.23      sakharuk  335:     $result =~ s/\\\\\s*\\vskip/\\vskip/gm;
1.24      sakharuk  336:     $result =~ s/\\\\\s*\\noindent\s*(\\\\)+/\\\\\\noindent /g;
1.23      sakharuk  337:     $result =~ s/{\\par }\s*\\\\/\\\\/gm;
1.24      sakharuk  338: 	$result =~ s/\\\\\s+\[/ \[/g;
                    339:     $result =~ s/&#952;/\$\\theta\$/g; #converts theta from html into tex
1.41      sakharuk  340:     $result =~ s/\b__+\b/\\makebox\[1 cm\]\[b\]{\\hrulefill}/g;
1.37      sakharuk  341:     #conversion of html characters to LaTeX equivalents
                    342:     if ($result =~ m/&(\w+|#\d+);/) {
                    343: 	$result = &character_chart($result);
                    344:     }
1.42      sakharuk  345:     $result =~ s/(\\end{tabular})\s*\\vskip 0 mm/$1/g;
                    346:     $result =~ s/(\\begin{enumerate})\s*\\noindent/$1/g;
1.7       sakharuk  347: #-- writing .tex file in prtspool 
1.16      sakharuk  348:     my $temp_file;
1.33      sakharuk  349:     my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout_".time."_".rand(10000000).".tex";
1.16      sakharuk  350:     unless ($temp_file = Apache::File->new('>'.$filename)) {
                    351: 	$r->log_error("Couldn't open $filename for output $!");
                    352: 	return SERVER_ERROR; 
                    353:     } 
                    354:     print $temp_file $result;
1.3       sakharuk  355: $r->print(<<FINALEND);
1.26      sakharuk  356: <meta http-equiv="Refresh" content="0; url=/cgi-bin/printout.pl?$filename&$laystyle">
1.3       sakharuk  357: </body>
                    358: </html>
                    359: FINALEND
                    360: }
1.2       sakharuk  361: 
1.37      sakharuk  362: sub character_chart {
                    363:     my $result = shift;	
1.41      sakharuk  364:     $result =~ s/&#0?0?7;//g;
1.40      sakharuk  365:     $result =~ s/&#0?0?9;//g;
                    366:     $result =~ s/&#0?10;//g;
                    367:     $result =~ s/&#0?13;//g;
                    368:     $result =~ s/&#0?32;/ /g;
                    369:     $result =~ s/&#0?33;/!/g;
                    370:     $result =~ s/&#0?34;/"/g;
1.39      sakharuk  371:     $result =~ s/&quot;/"/g; 
1.40      sakharuk  372:     $result =~ s/&#0?35;/\\#/g;
                    373: #    $result =~ s/&#0?36;/\\\$/g;
                    374:     $result =~ s/&#0?37;/\\%/g; 
                    375:     $result =~ s/&#0?38;/\\&/g; 
1.37      sakharuk  376:     $result =~ s/&amp;/\\&/g;
1.40      sakharuk  377:     $result =~ s/&#0?39;/'/g;
                    378:     $result =~ s/&#0?40;/(/g;
                    379:     $result =~ s/&#0?41;/)/g;
                    380:     $result =~ s/&#0?42;/\*/g;
                    381:     $result =~ s/&#0?43;/\+/g;
                    382:     $result =~ s/&#0?44;/,/g;
                    383:     $result =~ s/&#0?45;/-/g;
                    384:     $result =~ s/&#0?46;/\./g;
                    385:     $result =~ s/&#0?47;/\//g;
                    386:     $result =~ s/&#0?48;/0/g;
                    387:     $result =~ s/&#0?49;/1/g;
                    388:     $result =~ s/&#0?50;/2/g;
                    389:     $result =~ s/&#0?51;/3/g;
                    390:     $result =~ s/&#0?52;/4/g;
                    391:     $result =~ s/&#0?53;/5/g;
                    392:     $result =~ s/&#0?54;/6/g;
                    393:     $result =~ s/&#0?55;/7/g;
                    394:     $result =~ s/&#0?56;/8/g;
                    395:     $result =~ s/&#0?57;/9/g;
                    396:     $result =~ s/&#0?58;/:/g;
                    397:     $result =~ s/&#0?59;/;/g;
                    398:     $result =~ s/&#0?60;/\$<\$/g;
1.37      sakharuk  399:     $result =~ s/&lt;/\$<\$/g;
1.40      sakharuk  400:     $result =~ s/&#0?61;/\$=\$/g;
                    401:     $result =~ s/&#0?62;/\$>\$/g;
1.37      sakharuk  402:     $result =~ s/&gt;/\$>\$/g;
1.40      sakharuk  403:     $result =~ s/&#0?63;/?/g;
                    404: #    $result =~ s/&#0?64;//g;
                    405:     $result =~ s/&#0?65;/A/g;
                    406:     $result =~ s/&#0?66;/B/g;
                    407:     $result =~ s/&#0?67;/C/g;
                    408:     $result =~ s/&#0?68;/D/g;
                    409:     $result =~ s/&#0?69;/E/g;
                    410:     $result =~ s/&#0?70;/F/g;
                    411:     $result =~ s/&#0?71;/G/g;
                    412:     $result =~ s/&#0?72;/H/g;
                    413:     $result =~ s/&#0?73;/I/g;
                    414:     $result =~ s/&#0?74;/J/g;
                    415:     $result =~ s/&#0?75;/K/g;
                    416:     $result =~ s/&#0?76;/L/g;
                    417:     $result =~ s/&#0?77;/M/g;
                    418:     $result =~ s/&#0?78;/N/g;
                    419:     $result =~ s/&#0?79;/O/g;
                    420:     $result =~ s/&#0?80;/P/g;
                    421:     $result =~ s/&#0?81;/Q/g;
                    422:     $result =~ s/&#0?82;/R/g;
                    423:     $result =~ s/&#0?83;/S/g;
                    424:     $result =~ s/&#0?84;/T/g;
                    425:     $result =~ s/&#0?85;/U/g;
                    426:     $result =~ s/&#0?86;/V/g;
                    427:     $result =~ s/&#0?87;/W/g;
                    428:     $result =~ s/&#0?88;/X/g;
                    429:     $result =~ s/&#0?89;/Y/g;
                    430:     $result =~ s/&#0?90;/Z/g;
                    431:     $result =~ s/&#0?91;/[/g;
                    432:     $result =~ s/&#0?92;/\\/g;
                    433:     $result =~ s/&#0?93;/]/g;
                    434: #    $result =~ s/&#0?94;//g;
                    435: #    $result =~ s/&#0?95;//g;
                    436:     $result =~ s/&#0?96;/`/g;
                    437:     $result =~ s/&#0?97;/a/g;
                    438:     $result =~ s/&#0?98;/b/g;
                    439:     $result =~ s/&#0?99;/c/g;
1.37      sakharuk  440:     $result =~ s/&#100;/d/g;
                    441:     $result =~ s/&#101;/e/g;
                    442:     $result =~ s/&#102;/f/g;
                    443:     $result =~ s/&#103;/g/g;
                    444:     $result =~ s/&#104;/h/g;
                    445:     $result =~ s/&#105;/i/g;
                    446:     $result =~ s/&#106;/j/g;
                    447:     $result =~ s/&#107;/k/g;
                    448:     $result =~ s/&#108;/l/g;
                    449:     $result =~ s/&#109;/m/g;
                    450:     $result =~ s/&#110;/n/g;
                    451:     $result =~ s/&#111;/o/g;
                    452:     $result =~ s/&#112;/p/g;
                    453:     $result =~ s/&#113;/q/g;
                    454:     $result =~ s/&#114;/r/g;
                    455:     $result =~ s/&#115;/s/g;
                    456:     $result =~ s/&#116;/t/g;
                    457:     $result =~ s/&#117;/u/g;
                    458:     $result =~ s/&#118;/v/g;
                    459:     $result =~ s/&#119;/w/g;
                    460:     $result =~ s/&#120;/x/g;
                    461:     $result =~ s/&#121;/y/g;
                    462:     $result =~ s/&#122;/z/g;
                    463:     $result =~ s/&#123;/\\{/g;
                    464:     $result =~ s/&#124;/\|/g;
                    465:     $result =~ s/&#125;/\\}/g;
                    466:     $result =~ s/&#126;/\~/g;
                    467:     $result =~ s/&#130;/,/g;
                    468: #    $result =~ s/&#131;//g;
                    469:     $result =~ s/&#132;/''/g;
                    470:     $result =~ s/&#133;/\$\\ldots\$/g;
                    471:     $result =~ s/&#134;/\$\\dagger\$/g;
                    472:     $result =~ s/&#135;/\$\\ddagger\$/g;
                    473: #    $result =~ s/&#136;//g;
                    474: #    $result =~ s/&#137;//g;
                    475: #    $result =~ s/&#138;//g;
                    476:     $result =~ s/&#139;/\$<\$/g;
                    477: #    $result =~ s/&#140;//g;
                    478:     $result =~ s/&#145;/`/g;
                    479:     $result =~ s/&#146;/'/g;
                    480:     $result =~ s/&#147;/``/g;
                    481:     $result =~ s/&#148;/''/g;
                    482:     $result =~ s/&#149;/\$\\bullet\$/g;
                    483: #    $result =~ s/&#150;//g;
                    484: #    $result =~ s/&#151;//g;
                    485:     $result =~ s/&#152;/~/g;
                    486: #    $result =~ s/&#153;//g;
                    487: #    $result =~ s/&#154;//g;
                    488:     $result =~ s/&#155;/\$>\$/g;
                    489:     $result =~ s/&#156;/\\{\\oe\\}/g;
                    490:     $result =~ s/&#159;/\\"\\{Y\\}/g;
                    491:     $result =~ s/&#160;//g;
                    492:     $result =~ s/&nbsp;//g;
                    493:     $result =~ s/&#161;/!`/g;
                    494:     $result =~ s/&iexcl;/!`/g; #`
                    495: #    $result =~ s/&#162;//g;
                    496: #    $result =~ s/&cent;//g;
                    497:     $result =~ s/&#163;/\\pounds/g; 
                    498:     $result =~ s/&pound;/\\pounds/g;
                    499: #    $result =~ s/&#164;//g;
                    500: #    $result =~ s/&curren;//g;
                    501: #    $result =~ s/&#165;//g;
                    502: #    $result =~ s/&yen;//g;
                    503: #    $result =~ s/&#166;//g;
                    504: #    $result =~ s/&brvbar;//g;
                    505: #    $result =~ s/&#167;//g;
                    506: #    $result =~ s/&sect;//g;
                    507: #    $result =~ s/&#168;//g;
                    508: #    $result =~ s/&uml;//g;
                    509:     $result =~ s/&#169;/\\copyright/g;
                    510:     $result =~ s/&copy;/\\copyright/g;
                    511: #    $result =~ s/&#170;//g;
                    512: #    $result =~ s/&ordf;//g;
                    513: #    $result =~ s/&#171;//g;
                    514: #    $result =~ s/&laquo;//g;
                    515:     $result =~ s/&#172;/\$\\neg\$/g;
                    516:     $result =~ s/&not;/\$\\neg\$/g;
                    517: #    $result =~ s/&#173;//g;
                    518: #    $result =~ s/&shy;//g;
                    519: #    $result =~ s/&#174;//g;
                    520: #    $result =~ s/&reg;//g;
                    521: #    $result =~ s/&#175;//g;
                    522: #    $result =~ s/&macr;//g;
1.42      sakharuk  523:     $result =~ s/&#176;/\$^{\\circ}\$/g;
                    524:     $result =~ s/&deg;/\$^{\\circ}\$/g;
1.37      sakharuk  525:     $result =~ s/&#177;/\$\\pm\$/g;
                    526:     $result =~ s/&plusmn;/\$\\pm\$/g;
                    527:     $result =~ s/&#178;/\$^2\$/g;
                    528:     $result =~ s/&sup2;/\$^2\$/g;
                    529:     $result =~ s/&#179;/\$^3\$/g;
                    530:     $result =~ s/&sup3;/\$^3\$/g;
                    531: #    $result =~ s/&#180;//g;
                    532: #    $result =~ s/&acute;//g;
                    533:     $result =~ s/&#181;/\$\\mu\$/g;
                    534:     $result =~ s/&micro;/\$\\mu\$/g;
                    535:     $result =~ s/&#182;/\\P/g;
                    536:     $result =~ s/&para;/\\P/g;
                    537:     $result =~ s/&#183;/\$\\cdot\$/g;
                    538:     $result =~ s/&middot;/\$\\cdot\$/g;
                    539: #    $result =~ s/&#184;//g;
                    540: #    $result =~ s/&cedil;//g;
                    541:     $result =~ s/&#185;/\$^1\$/g;
                    542:     $result =~ s/&sup1;/\$^1\$/g;
                    543: #    $result =~ s/&#186;//g;
                    544: #    $result =~ s/&ordm;//g;
                    545: #    $result =~ s/&#187;//g;
                    546: #    $result =~ s/&raquo;//g;
                    547: #    $result =~ s/&#188;//g;
                    548: #    $result =~ s/&frac14;//g;
                    549: #    $result =~ s/&#189;//g;
                    550: #    $result =~ s/&frac12;//g;
                    551: #    $result =~ s/&#190;//g;
                    552: #    $result =~ s/&frac34;//g;
                    553:     $result =~ s/&#191;/?`/g;
                    554:     $result =~ s/&iquest;/?`/g; 
                    555:     $result =~ s/&#192;/\\`{A}/g;
                    556:     $result =~ s/&Agrave;/\\`{A}/g; 
                    557:     $result =~ s/&#193;/\\'{A}/g; 
                    558:     $result =~ s/&Aacute;/\\'{A}/g; 
                    559:     $result =~ s/&#194;/\\^{A}/g;
                    560:     $result =~ s/&Acirc;/\\^{A}/g;
                    561:     $result =~ s/&#195;/\\~{A}/g;
                    562:     $result =~ s/&Atilde;/\\~{A}/g;
                    563:     $result =~ s/&#196;/\\"{A}/g; 
                    564:     $result =~ s/&Auml;/\\"{A}/g; 
                    565:     $result =~ s/&#197;/{\\AA}/g;
                    566:     $result =~ s/&Aring;/{\\AA}/g;
                    567:     $result =~ s/&#198;/{\\AE}/g;
                    568:     $result =~ s/&AElig;/{\\AE}/g;
                    569: #    $result =~ s/&#199;//g;
                    570: #    $result =~ s/&Ccedil;//g;
                    571:     $result =~ s/&#200;/\\`{E}/g;
                    572:     $result =~ s/&Egrave;/\\`{E}/g;
                    573:     $result =~ s/&#201;/\\'{E}/g;
                    574:     $result =~ s/&Eacute;/\\'{E}/g;
                    575:     $result =~ s/&#202;/\\^{E}/g;
                    576:     $result =~ s/&Ecirc;/\\^{E}/g;
                    577:     $result =~ s/&#203;/\\`{E}/g;
                    578:     $result =~ s/&Euml;/\\`{E}/g;
                    579:     $result =~ s/&#204;/\\`{I}/g;
                    580:     $result =~ s/&Igrave;/\\`{I}/g; 
                    581:     $result =~ s/&#205;/\\'{I}/g; 
                    582:     $result =~ s/&Iacute;/\\'{I}/g; 
                    583:     $result =~ s/&#206;/\\^{I}/g;
                    584:     $result =~ s/&Icirc;/\\^{I}/g;
                    585:     $result =~ s/&#207;/\\"{I}/g; 
                    586:     $result =~ s/&Iuml;/\\"{I}/g; 
                    587: #    $result =~ s/&#208;//g;
                    588: #    $result =~ s/&ETH;//g;
                    589:     $result =~ s/&#209;/\\~{N}/g;
                    590:     $result =~ s/&Ntilde;/\\~{N}/g;
                    591:     $result =~ s/&#210;/\\`{O}/g;
                    592:     $result =~ s/&Ograve;/\\`{O}/g; 
                    593:     $result =~ s/&#211;/\\'{O}/g;
                    594:     $result =~ s/&Oacute;/\\'{O}/g; 
                    595:     $result =~ s/&#212;/\\^{O}/g;
                    596:     $result =~ s/&Ocirc;/\\^{O}/g;
                    597:     $result =~ s/&#213;/\\~{O}/g;
                    598:     $result =~ s/&Otilde;/\\~{O}/g;
                    599:     $result =~ s/&#214;/\\"{O}/g;
                    600:     $result =~ s/&Ouml;/\\"{O}/g; 
                    601:     $result =~ s/&#215;/\$\\times\$/g;
                    602:     $result =~ s/&times;/\$\\times\$/g;
                    603:     $result =~ s/&#216;/{\\O}/g;
                    604:     $result =~ s/&Oslash;/{\\O}/g;
                    605:     $result =~ s/&#217;/\\`{U}/g;
                    606:     $result =~ s/&Ugrave;/\\`{U}/g;
                    607:     $result =~ s/&#218;/\\'{U}/g;
                    608:     $result =~ s/&Uacute;/\\'{U}/g;
                    609:     $result =~ s/&#219;/\\^{U}/g;
                    610:     $result =~ s/&Ucirc;/\\^{U}/g;
                    611:     $result =~ s/&#220;/\\"{U}/g;
                    612:     $result =~ s/&Uuml;/\\"{U}/g;
                    613:     $result =~ s/&#221;/\\'{Y}/g;
                    614:     $result =~ s/&Yacute;/\\'{Y}/g;
                    615: #    $result =~ s/&#222;//g;
                    616: #    $result =~ s/&THORN;//g;
                    617: #    $result =~ s/&#223;//g;
                    618: #    $result =~ s/&szlig;//g;
                    619:     $result =~ s/&#224;/\\`{a}/g;
                    620:     $result =~ s/&agrave;/\\`{a}/g;
                    621:     $result =~ s/&#225;/\\'{a}/g;
                    622:     $result =~ s/&aacute;/\\'{a}/g;
                    623:     $result =~ s/&#226;/\\^{a}/g;
                    624:     $result =~ s/&acirc;/\\^{a}/g;
                    625:     $result =~ s/&#227;/\\~{a}/g;
                    626:     $result =~ s/&atilde;/\\~{a}/g;
                    627:     $result =~ s/&#228;/\\"{a}/g;
                    628:     $result =~ s/&auml;/\\"{a}/g;
                    629:     $result =~ s/&#229;/{\\aa}/g;
                    630:     $result =~ s/&aring;/{\\aa}/g;
                    631:     $result =~ s/&#230;/{\\ae}/g;
                    632:     $result =~ s/&aelig;/{\\ae}/g;
                    633: #    $result =~ s/&#231;//g;
                    634: #    $result =~ s/&ccedil;//g;
                    635:     $result =~ s/&#232;/\\`{e}/g;
                    636:     $result =~ s/&egrave;/\\`{e}/g;
                    637:     $result =~ s/&#233;/\\'{e}/g;
                    638:     $result =~ s/&eacute;/\\'{e}/g;
                    639:     $result =~ s/&#234;/\\^{e}/g;
                    640:     $result =~ s/&ecirc;/\\^{e}/g;
                    641:     $result =~ s/&#235;/\\"{e}/g;
                    642:     $result =~ s/&euml;/\\"{e}/g;
                    643:     $result =~ s/&#236;/\\`{i}/g;
                    644:     $result =~ s/&igrave;/\\`{i}/g;
                    645:     $result =~ s/&#237;/\\'{i}/g;
                    646:     $result =~ s/&iacute;/\\'{i}/g;
                    647:     $result =~ s/&#238;/\\^{i}/g;
                    648:     $result =~ s/&icirc;/\\^{i}/g;
                    649:     $result =~ s/&#239;/\\"{i}/g;
                    650:     $result =~ s/&iuml;/\\"{i}/g;
                    651: #    $result =~ s/&#240;//g;
                    652: #    $result =~ s/&eth;//g;
                    653:     $result =~ s/&#241;/\\~{n}/g;
                    654:     $result =~ s/&ntilde;/\\~{n}/g;
                    655:     $result =~ s/&#242;/\\`{o}/g;
                    656:     $result =~ s/&ograve;/\\`{o}/g;
                    657:     $result =~ s/&#243;/\\'{o}/g;
                    658:     $result =~ s/&oacute;/\\'{o}/g;
                    659:     $result =~ s/&#244;/\\^{o}/g;
                    660:     $result =~ s/&ocirc;/\\^{o}/g;
                    661:     $result =~ s/&#245;/\\~{o}/g;
                    662:     $result =~ s/&otilde;/\\~{o}/g;
                    663:     $result =~ s/&#246;/\\"{o}/g;
                    664:     $result =~ s/&ouml;/\\"{o}/g;
                    665:     $result =~ s/&#247;/\$\\div\$/g;
                    666:     $result =~ s/&divide;/\$\\div\$/g;
                    667:     $result =~ s/&#248;/{\\o}/g;
                    668:     $result =~ s/&oslash;/{\\o}/g;
                    669:     $result =~ s/&#249;/\\`{u}/g; 
                    670:     $result =~ s/&ugrave;/\\`{u}/g;
                    671:     $result =~ s/&#250;/\\'{u}/g;
                    672:     $result =~ s/&uacute;/\\'{u}/g;
                    673:     $result =~ s/&#251;/\\^{u}/g;
                    674:     $result =~ s/&ucirc;/\\^{u}/g;
                    675:     $result =~ s/&#252;/\\"{u}/g;
                    676:     $result =~ s/&uuml;/\\"{u}/g;
                    677:     $result =~ s/&#253;/\\'{y}/g;
                    678:     $result =~ s/&yacute;/\\'{y}/g;
                    679: #    $result =~ s/&#254;//g;
                    680: #    $result =~ s/&thorn;//g;
                    681:     $result =~ s/&#255;/\\"{y}/g;
                    682:     $result =~ s/&yuml;/\\"{y}/g;
                    683:     return $result;
                    684: }
1.41      sakharuk  685: 
                    686: 
                    687: #'"`
1.37      sakharuk  688: 
1.28      sakharuk  689: sub additional_cleanup {
                    690:     my $result = shift;	
                    691:     my $first_app = index($result,'\documentclass',0);
                    692:     $first_app = index($result,'\documentclass',$first_app+5);
                    693:     while ($first_app != -1) {
                    694: 	my $second_app = index($result,'begin{document}',$first_app);
                    695: 	$first_app = rindex($result,'\end{document}',$first_app);
                    696: 	substr($result,$first_app,$second_app-$first_app+15) = '\vskip 3 mm';
                    697: 	$first_app = index($result,'\documentclass',$first_app+5);
                    698:     }
                    699:     return $result;
                    700: }
1.33      sakharuk  701: sub page_cleanup {
                    702:     my $result = shift;	
                    703:     $_ = $result;
                    704:     m/\\end{document}(\d*)$/;
1.34      sakharuk  705:     my $number_of_columns = $1;
1.33      sakharuk  706:     my $insert = '{';
1.34      sakharuk  707:     for (my $id=1;$id<=$number_of_columns;$id++) { $insert .='l'; }
1.33      sakharuk  708:     $insert .= '}';
1.34      sakharuk  709:     $result =~ s/(\\begin{longtable})INSERTTHEHEADOFLONGTABLE/$1$insert/g;
                    710:     $result =~ s/&\s*REMOVETHEHEADOFLONGTABLE\\\\/\\\\/g;
                    711:     $result =~ s/(\\vskip\s*\d+\s*mm)/}\\\\\\parbox{\\minipagewidth}{/g;
1.35      sakharuk  712:     $result =~ s/\\parbox{\\minipagewidth}{}\s*\\\\\s*(\\parbox{\\minipagewidth})/$1/g;
1.37      sakharuk  713:     $result =~ s/\\parbox{\\minipagewidth}{\s*\\\\\\\\/\\parbox{\\minipagewidth}{/g;
1.34      sakharuk  714:     return $result,$number_of_columns;
1.33      sakharuk  715: }
1.6       sakharuk  716: 
1.3       sakharuk  717: sub content_map {
1.7       sakharuk  718: #-- find a list of files to print
1.3       sakharuk  719:     my $map_string = shift;
1.5       sakharuk  720:     my @number_seq = ();
1.7       sakharuk  721:     my @file_seq = ();
1.5       sakharuk  722:     my $startlink = index($map_string,'<link',0);
1.7       sakharuk  723:     my $endlink = index($map_string,'</link>',$startlink);
                    724:     my $chunk = substr($map_string,$startlink,$endlink-$startlink+7);
                    725:     $_ = $chunk;
                    726:     m/from=\"(\d+)\"/;
                    727:     push @number_seq,$1;
1.5       sakharuk  728:     while ($startlink != -1) {
1.7       sakharuk  729: 	$endlink = index($map_string,'</link>',$startlink);
                    730: 	$chunk = substr($map_string,$startlink,$endlink-$startlink+7);
1.5       sakharuk  731: 	substr($map_string,$startlink,$endlink-$startlink+7) = '';
                    732: 	$_ = $chunk;
                    733:         m/to=\"(\d+)\"/;
                    734: 	push @number_seq,$1;
1.44      sakharuk  735: 	$startlink = index($map_string,'from="'.$1.'"',0);
1.18      sakharuk  736: 	$startlink = rindex($map_string,'<link ',$startlink);
1.5       sakharuk  737:     }
1.45      sakharuk  738:     my $stalink = index($map_string,' to="'.$number_seq[0].'"',0);
1.7       sakharuk  739:     while ($stalink != -1) {
                    740: 	$startlink = rindex($map_string,'<link ',$stalink);
                    741: 	$endlink = index($map_string,'</link>',$startlink);
                    742: 	$chunk = substr($map_string,$startlink,$endlink-$startlink+7);
                    743: 	substr($map_string,$startlink,$endlink-$startlink+7) = '';
                    744: 	$_ = $chunk;
                    745:         m/from=\"(\d+)\"/;
                    746: 	unshift @number_seq,$1;
                    747: 	$stalink = index($map_string,' to="'.$number_seq[0].'"',0);
                    748:     }
                    749:     for (my $i=0;$i<=$#number_seq;$i++) {
                    750: 	$stalink = index($map_string,' id="'.$number_seq[$i].'"',0);
1.13      sakharuk  751:         {    
                    752: 	    my $ahed1 = index($map_string,'src="',$stalink);
                    753: 	    my $ahed2 = index($map_string,'</resource>',$stalink);
                    754: 	    if ($ahed1 != -1) {
                    755: 		if ($ahed1 < $ahed2) {
                    756: 		    $startlink = $ahed1;
                    757: 		} else {
                    758: 		    $startlink = rindex($map_string,'src="',$stalink);
                    759: 		}
                    760: 	    } else {
                    761: 		$startlink = rindex($map_string,'src="',$stalink);
                    762: 	    }
                    763: 
                    764: 	}
1.7       sakharuk  765: 	$startlink = index($map_string,'"',$startlink);
                    766: 	$endlink = index($map_string,'"',$startlink+1);
                    767: 	$chunk = substr($map_string,$startlink,$endlink-$startlink+1);
                    768: 	push @file_seq,$chunk;
                    769:     }
                    770:     return @file_seq;
                    771: }
1.5       sakharuk  772: 
1.3       sakharuk  773: 
                    774: 
                    775: sub handler {
                    776: 
                    777:     my $r = shift;
                    778:     $r->content_type('text/html');
                    779:     $r->send_http_header;
                    780: 
                    781: #-- start form
                    782:     &headerform($r);
                    783: #-- menu for output
1.16      sakharuk  784:     unless  ($ENV{'form.phase'}) {
1.3       sakharuk  785: 	&menu_for_output($r);
                    786:     }
                    787: #-- core part 
                    788:     if ($ENV{'form.phase'} eq 'two') {
                    789: 	&output_data($r);
                    790:     }
1.2       sakharuk  791:     return OK;
                    792: 
1.1       www       793: } 
                    794: 
                    795: 1;
                    796: __END__
1.6       sakharuk  797: 
                    798: 
1.13      sakharuk  799: 
                    800: 
                    801: #### Test block
1.6       sakharuk  802: #    my $ere;
                    803: #    foreach $ere (%ENV) {
1.13      sakharuk  804: #	$result .= ' SS '.$ere.' => '.$ENV{$ere}.' FF '."\n\n";
1.6       sakharuk  805: #    }
1.13      sakharuk  806: ####

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