Annotation of loncom/xml/londefdef.pm, revision 1.104
1.1 sakharuk 1: # The LearningOnline Network with CAPA
2: # Tags Default Definition Module
3: #
1.104 ! sakharuk 4: # $Id: londefdef.pm,v 1.103 2002/11/15 16:35:23 sakharuk Exp $
1.41 sakharuk 5: #
1.34 www 6: #
7: # Copyright Michigan State University Board of Trustees
8: #
9: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
10: #
11: # LON-CAPA is free software; you can redistribute it and/or modify
12: # it under the terms of the GNU General Public License as published by
13: # the Free Software Foundation; either version 2 of the License, or
14: # (at your option) any later version.
15: #
16: # LON-CAPA is distributed in the hope that it will be useful,
17: # but WITHOUT ANY WARRANTY; without even the implied warranty of
18: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19: # GNU General Public License for more details.
20: #
21: # You should have received a copy of the GNU General Public License
22: # along with LON-CAPA; if not, write to the Free Software
23: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24: #
25: # /home/httpd/html/adm/gpl.txt
26: #
27: # http://www.lon-capa.org/
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: #
1.1 sakharuk 41: # last modified 06/26/00 by Alexander Sakharuk
1.28 www 42: # 11/6,11/30,02/01/01,5/4 Gerd Kortemeyer
1.41 sakharuk 43: # 01/18 Alex Sakharuk
1.1 sakharuk 44:
1.2 albertel 45: package Apache::londefdef;
1.1 sakharuk 46:
1.54 sakharuk 47: use Apache::lonnet;
1.1 sakharuk 48: use strict;
1.3 sakharuk 49: use Apache::lonxml;
1.57 sakharuk 50: use Apache::File();
1.70 sakharuk 51: use Image::Magick;
1.54 sakharuk 52:
1.38 harris41 53: BEGIN {
1.15 sakharuk 54:
1.88 sakharuk 55: &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','u','ul','var','wbr'));
1.15 sakharuk 56:
1.3 sakharuk 57: }
1.1 sakharuk 58:
1.35 sakharuk 59: #======================= TAG SUBROUTINES =====================
1.8 sakharuk 60: #-- <output>
1.21 albertel 61: sub start_output {
62: my ($target) = @_;
1.22 albertel 63: if ($target eq 'meta') { $Apache::lonxml::metamode--; }
1.21 albertel 64: return '';
65: }
66: sub end_output {
67: my ($target) = @_;
1.22 albertel 68: if ($target eq 'meta') { $Apache::lonxml::metamode++; }
1.21 albertel 69: return '';
70: }
1.4 sakharuk 71: #-- <m> tag
1.33 albertel 72: sub start_m {
73: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
74: my $currentstring = '';
75: if ($target eq 'web') {
1.61 albertel 76: $Apache::lonxml::prevent_entity_encode++;
1.73 albertel 77: my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
1.33 albertel 78: $inside ='\\documentstyle{article}'.$inside;
1.37 albertel 79: &Apache::lonxml::debug("M is starting with:$inside:");
1.33 albertel 80: my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval);
81: if ($eval eq 'on') {
82: $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
83: #&Apache::lonxml::debug("M is evaulated to:$inside:");
84: }
85: $currentstring = &Apache::lontexconvert::converted(\$inside);
1.37 albertel 86: if ($Apache::lontexconvert::errorstring) {
87: &Apache::lonxml::warning("tth error: ".
88: $Apache::lontexconvert::errorstring);
89: $Apache::lontexconvert::errorstring='';
90: }
1.33 albertel 91: #&Apache::lonxml::debug("M is ends with:$currentstring:");
92: } elsif ($target eq 'tex') {
1.73 albertel 93: $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
1.83 sakharuk 94: if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';}
1.73 albertel 95: } else {
96: my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser);
1.33 albertel 97: }
98: return $currentstring;
99: }
100: sub end_m {
101: my ($target,$token) = @_;
102: my $currentstring = '';
103: if ($target eq 'web') {
1.61 albertel 104: $Apache::lonxml::prevent_entity_encode--;
1.33 albertel 105: } elsif ($target eq 'tex') {
106: $currentstring = "";
107: } elsif ($target eq 'meta') {
108: }
109: return $currentstring;
110: }
1.35 sakharuk 111: #-- <html> tag
1.100 albertel 112: sub start_html {
113: my ($target,$token) = @_;
114: my $currentstring = '';
115: if ($ENV{'browser.mathml'}) {
116: &tth::ttminit();
117: if ($ENV{'browser.unicode'}) {
118: &tth::ttmoptions('-L -u1');
119: } else {
120: &tth::ttmoptions('-L -u0');
121: }
122: } else {
123: &tth::tthinit();
124: if ($ENV{'browser.unicode'}) {
125: &tth::tthoptions('-L -u1');
126: } else {
127: &tth::tthoptions('-L -u0');
128: }
129: }
130: if ($target eq 'web') {
131: $currentstring = &Apache::lonxml::xmlbegin().
132: &Apache::lonxml::fontsettings();
133: } elsif ($target eq 'tex') {
134: @Apache::londefdef::table = ();
135: $currentstring .= '\documentclass[letterpaper]{article}
1.77 sakharuk 136: \newcommand{\keephidden}[1]{}
137: \renewcommand{\deg}{$^{\circ}$}
1.44 sakharuk 138: \usepackage[dvips]{graphicx}
1.86 sakharuk 139: \usepackage{epsfig}\usepackage{calc}
140: \newenvironment{choicelist}{\begin{enumerate}}{\end{enumerate}}';
1.100 albertel 141: }
142: return $currentstring;
143: }
1.1 sakharuk 144: sub end_html {
145: my ($target,$token) = @_;
146: my $currentstring = '';
147: if ($target eq 'web') {
1.28 www 148: $currentstring = &Apache::lonxml::xmlend();
1.35 sakharuk 149: }
1.1 sakharuk 150: return $currentstring;
151: }
1.35 sakharuk 152: #-- <head> tag
1.1 sakharuk 153: sub start_head {
154: my ($target,$token) = @_;
155: my $currentstring = '';
156: if ($target eq 'web') {
157: $currentstring = $token->[4];
158: }
159: return $currentstring;
160: }
161: sub end_head {
162: my ($target,$token) = @_;
163: my $currentstring = '';
164: if ($target eq 'web') {
1.47 matthew 165: $currentstring = &Apache::lonxml::registerurl(undef,$target).
1.29 www 166: $token->[2];
1.1 sakharuk 167: }
168: return $currentstring;
169: }
1.35 sakharuk 170: #-- <map> tag
1.1 sakharuk 171: sub start_map {
172: my ($target,$token) = @_;
173: my $currentstring = '';
174: if ($target eq 'web') {
175: $currentstring = $token->[4];
176: }
177: return $currentstring;
178: }
179: sub end_map {
180: my ($target,$token) = @_;
181: my $currentstring = '';
182: if ($target eq 'web') {
183: $currentstring = $token->[2];
184: }
185: return $currentstring;
186: }
1.35 sakharuk 187: #-- <select> tag
1.1 sakharuk 188: sub start_select {
189: my ($target,$token) = @_;
190: my $currentstring = '';
191: if ($target eq 'web') {
192: $currentstring = $token->[4];
193: }
194: return $currentstring;
195: }
196: sub end_select {
197: my ($target,$token) = @_;
198: my $currentstring = '';
199: if ($target eq 'web') {
200: $currentstring = $token->[2];
201: }
202: return $currentstring;
203: }
1.35 sakharuk 204: #-- <option> tag
1.1 sakharuk 205: sub start_option {
206: my ($target,$token) = @_;
207: my $currentstring = '';
208: if ($target eq 'web') {
209: $currentstring = $token->[4];
210: }
211: return $currentstring;
212: }
213: sub end_option {
214: my ($target,$token) = @_;
215: my $currentstring = '';
216: if ($target eq 'web') {
217: $currentstring = $token->[2];
218: }
219: return $currentstring;
220: }
1.35 sakharuk 221: #-- <input> tag
1.1 sakharuk 222: sub start_input {
223: my ($target,$token) = @_;
224: my $currentstring = '';
225: if ($target eq 'web') {
226: $currentstring = $token->[4];
227: }
228: return $currentstring;
229: }
230: sub end_input {
231: my ($target,$token) = @_;
232: my $currentstring = '';
233: if ($target eq 'web') {
234: $currentstring = $token->[2];
235: }
236: return $currentstring;
237: }
1.35 sakharuk 238: #-- <textarea> tag
1.1 sakharuk 239: sub start_textarea {
240: my ($target,$token) = @_;
241: my $currentstring = '';
242: if ($target eq 'web') {
243: $currentstring = $token->[4];
244: }
245: return $currentstring;
246: }
247: sub end_textarea {
248: my ($target,$token) = @_;
249: my $currentstring = '';
250: if ($target eq 'web') {
251: $currentstring = $token->[2];
252: }
253: return $currentstring;
254: }
1.35 sakharuk 255: #-- <form> tag
1.1 sakharuk 256: sub start_form {
257: my ($target,$token) = @_;
258: my $currentstring = '';
259: if ($target eq 'web') {
260: $currentstring = $token->[4];
261: }
262: return $currentstring;
263: }
264: sub end_form {
265: my ($target,$token) = @_;
266: my $currentstring = '';
267: if ($target eq 'web') {
268: $currentstring = $token->[2];
269: }
270: return $currentstring;
271: }
1.35 sakharuk 272: #-- <title> tag
1.1 sakharuk 273: sub start_title {
274: my ($target,$token) = @_;
275: my $currentstring = '';
276: if ($target eq 'web') {
277: $currentstring = $token->[4];
1.35 sakharuk 278: } elsif ($target eq 'tex') {
279: $currentstring .= '\keephidden{'
1.1 sakharuk 280: }
1.13 www 281: if ($target eq 'meta') {
282: $currentstring='<title>';
283: &start_output();
284: }
1.1 sakharuk 285: return $currentstring;
286: }
287: sub end_title {
288: my ($target,$token) = @_;
289: my $currentstring = '';
290: if ($target eq 'web') {
291: $currentstring = $token->[2];
1.35 sakharuk 292: } elsif ($target eq 'tex') {
293: $currentstring .= '}';
294: }
1.13 www 295: if ($target eq 'meta') {
296: &end_output();
297: $currentstring='</title>';
1.1 sakharuk 298: }
299: return $currentstring;
300: }
1.35 sakharuk 301: #-- <meta> tag
1.1 sakharuk 302: sub start_meta {
1.30 albertel 303: my ($target,$token,$tagstack,$parstack,$parser) = @_;
1.1 sakharuk 304: my $currentstring = '';
305: if ($target eq 'web') {
1.25 albertel 306: my $args='';
307: if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
308: if ($args eq '') {
309: &Apache::lonxml::get_all_text("/meta",$$parser[$#$parser]);
310: } else {
311: $currentstring = $token->[4];
312: }
1.12 www 313: }
314: if ($target eq 'meta') {
315: unless ($token->[2]->{'http-equiv'}) {
316: my $name=$token->[2]->{'name'};
317: $name=~tr/A-Z/a-z/;
318: $name=~s/\s/\_/g;
319: if ($name) {
320: $currentstring='<'.$name.'>'.
321: $token->[2]->{'content'}.
322: '</'.$name.'>';
323: }
324: }
1.1 sakharuk 325: }
326: return $currentstring;
327: }
1.26 albertel 328: sub end_meta {
1.30 albertel 329: my ($target,$token,$tagstack,$parstack,$parser) = @_;
1.26 albertel 330: my $currentstring = '';
331: if ($target eq 'web') {
332: my $args='';
333: if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
334: if ($args ne '') {
335: $currentstring = $token->[4];
336: }
337: }
338: return $currentstring;
339: }
1.35 sakharuk 340: #-- <body> tag
1.1 sakharuk 341: sub start_body {
1.41 sakharuk 342: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1.1 sakharuk 343: my $currentstring = '';
344: if ($target eq 'web') {
1.31 albertel 345: if (!$Apache::lonxml::registered) {
1.47 matthew 346: $currentstring.='<head>'.
347: &Apache::lonxml::registerurl(undef,$target).'</head>';
1.31 albertel 348: }
1.32 albertel 349: my $onLoad='';
350: foreach my $key (keys(%{$token->[2]})) {
351: if ($key =~ /^onload$/i) {
352: $onLoad.=$token->[2]->{$key}.';';
353: delete($token->[2]->{$key});
354: }
355: }
1.56 albertel 356: $token->[2]->{'onLoad'}=&Apache::lonxml::loadevents().
357: ';'.$onLoad;
1.32 albertel 358: my $onUnload='';
359: foreach my $key (keys(%{$token->[2]})) {
360: if ($key =~ /^onunload$/i) {
361: $onUnload.=$token->[2]->{$key}.';';
362: delete($token->[2]->{$key});
363: }
364: }
1.56 albertel 365: $token->[2]->{'onUnload'}=&Apache::lonxml::unloadevents().
366: ';'.$onUnload;
1.31 albertel 367:
368: $currentstring .= '<'.$token->[1];
1.37 albertel 369: foreach (keys %{$token->[2]}) {
370: $currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"';
371: }
1.31 albertel 372: $currentstring.='>';
1.40 albertel 373: if ($ENV{'request.state'} ne 'published') {
374: $currentstring.=(<<EDITBUTTON);
375: <form method="post">
1.49 albertel 376: <input type="submit" name="editmode" value="Edit" />
1.40 albertel 377: </form>
378: EDITBUTTON
379: }
1.28 www 380: } elsif ($target eq 'tex') {
1.35 sakharuk 381: $currentstring = '\begin{document}';
1.1 sakharuk 382: }
383: return $currentstring;
384: }
385: sub end_body {
386: my ($target,$token) = @_;
387: my $currentstring = '';
388: if ($target eq 'web') {
389: $currentstring = $token->[2];
390: } elsif ($target eq 'tex') {
1.35 sakharuk 391: $currentstring = '\end{document}';
1.1 sakharuk 392: }
393: return $currentstring;
394: }
1.35 sakharuk 395: #-- <center> tag
1.1 sakharuk 396: sub start_center {
397: my ($target,$token) = @_;
398: my $currentstring = '';
399: if ($target eq 'web') {
400: $currentstring = $token->[4];
401: } elsif ($target eq 'tex') {
1.35 sakharuk 402: $currentstring = '\begin{center}';
1.18 sakharuk 403: } elsif ($target eq 'latexsource') {
1.35 sakharuk 404: $currentstring = '\begin{center}';
1.1 sakharuk 405: }
406: return $currentstring;
407: }
408: sub end_center {
409: my ($target,$token) = @_;
410: my $currentstring = '';
411: if ($target eq 'web') {
412: $currentstring = $token->[2];
413: } elsif ($target eq 'tex') {
1.35 sakharuk 414: $currentstring = '\end{center}';
1.18 sakharuk 415: } elsif ($target eq 'latexsource') {
1.35 sakharuk 416: $currentstring = '\end{center}';
1.1 sakharuk 417: }
418: return $currentstring;
419: }
1.35 sakharuk 420: #-- <b> tag
1.1 sakharuk 421: sub start_b {
422: my ($target,$token) = @_;
423: my $currentstring = '';
424: if ($target eq 'web') {
425: $currentstring = $token->[4];
426: } elsif ($target eq 'tex') {
1.35 sakharuk 427: $currentstring = '\textbf{';
1.18 sakharuk 428: } elsif ($target eq 'latexsource') {
1.35 sakharuk 429: $currentstring = '\textbf{';
1.1 sakharuk 430: }
431: return $currentstring;
432: }
433: sub end_b {
434: my ($target,$token) = @_;
435: my $currentstring = '';
436: if ($target eq 'web') {
437: $currentstring = $token->[2];
438: } elsif ($target eq 'tex') {
1.35 sakharuk 439: $currentstring = '}';
440:
1.18 sakharuk 441: } elsif ($target eq 'latexsource') {
1.35 sakharuk 442: $currentstring = '}';
1.1 sakharuk 443: }
444: return $currentstring;
445: }
1.35 sakharuk 446: #-- <strong> tag
1.1 sakharuk 447: sub start_strong {
448: my ($target,$token) = @_;
449: my $currentstring = '';
450: if ($target eq 'web') {
451: $currentstring = $token->[4];
452: } elsif ($target eq 'tex') {
1.35 sakharuk 453: $currentstring = '\textbf{';
1.18 sakharuk 454: } elsif ($target eq 'latexsource') {
1.35 sakharuk 455: $currentstring = '\textbf{';
1.1 sakharuk 456: }
457: return $currentstring;
458: }
459: sub end_strong {
460: my ($target,$token) = @_;
461: my $currentstring = '';
462: if ($target eq 'web') {
463:
464: $currentstring = $token->[2];
465: } elsif ($target eq 'tex') {
1.35 sakharuk 466: $currentstring = '}';
1.18 sakharuk 467: } elsif ($target eq 'latexsource') {
1.35 sakharuk 468: $currentstring = '}';
1.1 sakharuk 469: }
470: return $currentstring;
471: }
1.35 sakharuk 472: #-- <h1> tag
1.1 sakharuk 473: sub start_h1 {
474: my ($target,$token) = @_;
475: my $currentstring = '';
476: if ($target eq 'web') {
477: $currentstring .= $token->[4];
478: } elsif ($target eq 'tex') {
1.87 sakharuk 479: $currentstring .= '{\large \textbf{';
1.13 www 480: } elsif ($target eq 'meta') {
481: $currentstring='<subject>';
482: &start_output();
483: }
1.1 sakharuk 484: return $currentstring;
485: }
486: sub end_h1 {
487: my ($target,$token) = @_;
488: my $currentstring = '';
489: if ($target eq 'web') {
490: $currentstring .= $token->[2];
491: } elsif ($target eq 'tex') {
1.35 sakharuk 492: $currentstring .= '}}';
1.13 www 493: } elsif ($target eq 'meta') {
494: &end_output();
495: $currentstring='</subject>';
496: }
1.1 sakharuk 497: return $currentstring;
498: }
1.35 sakharuk 499: #-- <h2> tag
1.1 sakharuk 500: sub start_h2 {
501: my ($target,$token) = @_;
502: my $currentstring = '';
503: if ($target eq 'web') {
504: $currentstring .= $token->[4];
505: } elsif ($target eq 'tex') {
1.87 sakharuk 506: $currentstring .= '{\large \textbf{';
1.1 sakharuk 507: }
508: return $currentstring;
509: }
510: sub end_h2 {
511: my ($target,$token) = @_;
512: my $currentstring = '';
513: if ($target eq 'web') {
514: $currentstring .= $token->[2];
515: } elsif ($target eq 'tex') {
1.35 sakharuk 516: $currentstring .= '}}';
1.1 sakharuk 517: }
518: return $currentstring;
519: }
1.35 sakharuk 520: #-- <h3> tag
1.1 sakharuk 521: sub start_h3 {
522: my ($target,$token) = @_;
523: my $currentstring = '';
524: if ($target eq 'web') {
525: $currentstring .= $token->[4];
526: } elsif ($target eq 'tex') {
1.87 sakharuk 527: $currentstring .= '{\large \textbf{';
1.1 sakharuk 528: }
529: return $currentstring;
530: }
531: sub end_h3 {
532: my ($target,$token) = @_;
533: my $currentstring = '';
534: if ($target eq 'web') {
535: $currentstring .= $token->[2];
536: } elsif ($target eq 'tex') {
1.35 sakharuk 537: $currentstring .= '}}';
1.1 sakharuk 538: }
539: return $currentstring;
540: }
1.35 sakharuk 541: #-- <h4> tag
1.1 sakharuk 542: sub start_h4 {
543: my ($target,$token) = @_;
544: my $currentstring = '';
545: if ($target eq 'web') {
546: $currentstring .= $token->[4];
547: } elsif ($target eq 'tex') {
1.87 sakharuk 548: $currentstring .= '{\large \textbf{';
1.1 sakharuk 549: }
550: return $currentstring;
551: }
552: sub end_h4 {
553: my ($target,$token) = @_;
554: my $currentstring = '';
555: if ($target eq 'web') {
556: $currentstring .= $token->[2];
557: } elsif ($target eq 'tex') {
1.35 sakharuk 558: $currentstring .= '}}';
1.1 sakharuk 559: }
560: return $currentstring;
561: }
1.35 sakharuk 562: #-- <h5> tag
1.1 sakharuk 563: sub start_h5 {
564: my ($target,$token) = @_;
565: my $currentstring = '';
566: if ($target eq 'web') {
567: $currentstring .= $token->[4];
568: } elsif ($target eq 'tex') {
1.87 sakharuk 569: $currentstring .= '{\large \textbf{';
1.1 sakharuk 570: }
571: return $currentstring;
572: }
573: sub end_h5 {
574: my ($target,$token) = @_;
575: my $currentstring = '';
576: if ($target eq 'web') {
577: $currentstring .= $token->[2];
578: } elsif ($target eq 'tex') {
1.35 sakharuk 579: $currentstring .= '}}';
1.1 sakharuk 580: }
581: return $currentstring;
582: }
1.35 sakharuk 583: #-- <h6> tag
1.1 sakharuk 584: sub start_h6 {
585: my ($target,$token) = @_;
586: my $currentstring = '';
587: if ($target eq 'web') {
588: $currentstring .= $token->[4];
589: } elsif ($target eq 'tex') {
1.87 sakharuk 590: $currentstring .= '{\large \textbf{';
1.1 sakharuk 591: }
592: return $currentstring;
593: }
594: sub end_h6 {
595: my ($target,$token) = @_;
596: my $currentstring = '';
597: if ($target eq 'web') {
598: $currentstring .= $token->[2];
599: } elsif ($target eq 'tex') {
1.35 sakharuk 600: $currentstring .= '}}';
1.1 sakharuk 601: }
602: return $currentstring;
603: }
1.35 sakharuk 604: #--- <cite> tag
1.1 sakharuk 605: sub start_cite {
606: my ($target,$token) = @_;
607: my $currentstring = '';
608: if ($target eq 'web') {
609: $currentstring .= $token->[4];
610: } elsif ($target eq 'tex') {
1.18 sakharuk 611: $currentstring .= "\\textit{";
612: } elsif ($target eq 'latexsource') {
613: $currentstring .= "\\textit{";
1.1 sakharuk 614: }
615: return $currentstring;
616: }
617: sub end_cite {
618: my ($target,$token) = @_;
619: my $currentstring = '';
620: if ($target eq 'web') {
621: $currentstring .= $token->[2];
622: } elsif ($target eq 'tex') {
623: $currentstring .= "}";
1.18 sakharuk 624: } elsif ($target eq 'latexsource') {
625: $currentstring .= "}";
1.1 sakharuk 626: }
627: return $currentstring;
628: }
1.35 sakharuk 629: #-- <i> tag
1.1 sakharuk 630: sub start_i {
631: my ($target,$token) = @_;
632: my $currentstring = '';
633: if ($target eq 'web') {
634: $currentstring .= $token->[4];
635: } elsif ($target eq 'tex') {
1.35 sakharuk 636: $currentstring .= '\textit{';
1.18 sakharuk 637: } elsif ($target eq 'latexsource') {
1.35 sakharuk 638: $currentstring .= '\textit{';
1.1 sakharuk 639: }
640: return $currentstring;
641: }
642: sub end_i {
643: my ($target,$token) = @_;
644: my $currentstring = '';
645: if ($target eq 'web') {
646: $currentstring .= $token->[2];
647: } elsif ($target eq 'tex') {
1.35 sakharuk 648: $currentstring .= '}';
1.18 sakharuk 649: } elsif ($target eq 'latexsource') {
1.35 sakharuk 650: $currentstring .= '}';
1.1 sakharuk 651: }
652: return $currentstring;
653: }
1.35 sakharuk 654: #-- <address> tag
1.1 sakharuk 655: sub start_address {
656: my ($target,$token) = @_;
657: my $currentstring = '';
658: if ($target eq 'web') {
659: $currentstring .= $token->[4];
660: } elsif ($target eq 'tex') {
1.18 sakharuk 661: $currentstring .= "\\textit{";
662: } elsif ($target eq 'latexsource') {
663: $currentstring .= "\\textit{";
1.1 sakharuk 664: }
665: return $currentstring;
666: }
667: sub end_address {
668: my ($target,$token) = @_;
669: my $currentstring = '';
670: if ($target eq 'web') {
671: $currentstring .= $token->[2];
672: } elsif ($target eq 'tex') {
673: $currentstring .= "}";
1.18 sakharuk 674: } elsif ($target eq 'latexsource') {
675: $currentstring .= "}";
1.1 sakharuk 676: }
677: return $currentstring;
678: }
1.35 sakharuk 679: #-- <dfn> tag
1.1 sakharuk 680: sub start_dfn {
681: my ($target,$token) = @_;
682: my $currentstring = '';
683: if ($target eq 'web') {
684: $currentstring .= $token->[4];
685: } elsif ($target eq 'tex') {
1.18 sakharuk 686: $currentstring .= "\\textit{";
687: } elsif ($target eq 'latexsource') {
688: $currentstring .= "\\textit{";
1.1 sakharuk 689: }
690: return $currentstring;
691: }
692: sub end_dfn {
693: my ($target,$token) = @_;
694: my $currentstring = '';
695: if ($target eq 'web') {
696: $currentstring .= $token->[2];
697: } elsif ($target eq 'tex') {
698: $currentstring .= "}";
1.18 sakharuk 699: } elsif ($target eq 'latexsource') {
700: $currentstring .= "}";
1.1 sakharuk 701: }
702: return $currentstring;
703: }
1.35 sakharuk 704: #-- <tt> tag
1.1 sakharuk 705: sub start_tt {
706: my ($target,$token) = @_;
707: my $currentstring = '';
708: if ($target eq 'web') {
709: $currentstring .= $token->[4];
710: } elsif ($target eq 'tex') {
1.35 sakharuk 711: $currentstring .= '\texttt{';
1.18 sakharuk 712: } elsif ($target eq 'latexsource') {
1.35 sakharuk 713: $currentstring .= '\texttt{';
1.1 sakharuk 714: }
715: return $currentstring;
716: }
717: sub end_tt {
718: my ($target,$token) = @_;
719: my $currentstring = '';
720: if ($target eq 'web') {
721: $currentstring .= $token->[2];
722: } elsif ($target eq 'tex') {
1.35 sakharuk 723: $currentstring .= '}';
1.18 sakharuk 724: } elsif ($target eq 'latexsource') {
1.35 sakharuk 725: $currentstring .= '}';
1.18 sakharuk 726: }
1.1 sakharuk 727: return $currentstring;
728: }
1.35 sakharuk 729: #-- <kbd> tag
1.1 sakharuk 730: sub start_kbd {
731: my ($target,$token) = @_;
732: my $currentstring = '';
733: if ($target eq 'web') {
734: $currentstring .= $token->[4];
735: } elsif ($target eq 'tex') {
1.18 sakharuk 736: $currentstring .= "\\texttt";
737: } elsif ($target eq 'latexsource') {
738: $currentstring .= "\\texttt{";
1.1 sakharuk 739: }
740: return $currentstring;
741: }
742: sub end_kbd {
743: my ($target,$token) = @_;
744: my $currentstring = '';
745: if ($target eq 'web') {
746: $currentstring .= $token->[2];
747: } elsif ($target eq 'tex') {
748: $currentstring .= "}";
1.18 sakharuk 749: } elsif ($target eq 'latexsource') {
750: $currentstring .= "}";
1.1 sakharuk 751: }
752: return $currentstring;
753: }
1.35 sakharuk 754: #-- <code> tag
1.1 sakharuk 755: sub start_code {
756: my ($target,$token) = @_;
757: my $currentstring = '';
758: if ($target eq 'web') {
759: $currentstring .= $token->[4];
760: } elsif ($target eq 'tex') {
1.35 sakharuk 761: $currentstring .= '\texttt{';
1.1 sakharuk 762: }
763: return $currentstring;
764: }
765: sub end_code {
766: my ($target,$token) = @_;
767: my $currentstring = '';
768: if ($target eq 'web') {
769: $currentstring .= $token->[2];
770: } elsif ($target eq 'tex') {
1.35 sakharuk 771: $currentstring .= '}';
1.1 sakharuk 772: }
773: return $currentstring;
774: }
1.35 sakharuk 775: #-- <em> tag
1.1 sakharuk 776: sub start_em {
777: my ($target,$token) = @_;
778: my $currentstring = '';
779: if ($target eq 'web') {
780: $currentstring .= $token->[4];
781: } elsif ($target eq 'tex') {
1.35 sakharuk 782: $currentstring .= '\emph{';
1.18 sakharuk 783: } elsif ($target eq 'latexsource') {
1.35 sakharuk 784: $currentstring .= '\emph{';
1.1 sakharuk 785: }
786: return $currentstring;
787: }
788: sub end_em {
789: my ($target,$token) = @_;
790: my $currentstring = '';
791: if ($target eq 'web') {
792: $currentstring .= $token->[2];
793: } elsif ($target eq 'tex') {
1.35 sakharuk 794: $currentstring .= '}';
1.18 sakharuk 795: } elsif ($target eq 'latexsource') {
1.35 sakharuk 796: $currentstring .= '}';
1.18 sakharuk 797: }
1.1 sakharuk 798: return $currentstring;
799: }
1.35 sakharuk 800: #-- <q> tag
1.1 sakharuk 801: sub start_q {
802: my ($target,$token) = @_;
803: my $currentstring = '';
804: if ($target eq 'web') {
805: $currentstring .= $token->[4];
806: } elsif ($target eq 'tex') {
1.18 sakharuk 807: $currentstring .= "\\emph{";
808: } elsif ($target eq 'latexsource') {
809: $currentstring .= "\\emph{";
810: }
1.1 sakharuk 811: return $currentstring;
812: }
813: sub end_q {
814: my ($target,$token) = @_;
815: my $currentstring = '';
816: if ($target eq 'web') {
817: $currentstring .= $token->[2];
818: } elsif ($target eq 'tex') {
819: $currentstring .= "}";
1.18 sakharuk 820: } elsif ($target eq 'latexsource') {
821: $currentstring .= "}";
822: }
1.1 sakharuk 823: return $currentstring;
824: }
1.35 sakharuk 825: #-- <p> tag
1.1 sakharuk 826: sub start_p {
827: my ($target,$token) = @_;
828: my $currentstring = '';
829: if ($target eq 'web') {
830: $currentstring .= $token->[4];
831: } elsif ($target eq 'tex') {
1.35 sakharuk 832: $currentstring .= '{\par ';
1.18 sakharuk 833: } elsif ($target eq 'latexsource') {
1.35 sakharuk 834: $currentstring .= '{\par ';
1.1 sakharuk 835: }
836: return $currentstring;
837: }
838: sub end_p {
839: my ($target,$token) = @_;
840: my $currentstring = '';
841: if ($target eq 'web') {
842: $currentstring .= $token->[2];
843: } elsif ($target eq 'tex') {
1.35 sakharuk 844: $currentstring .= '}';
1.18 sakharuk 845: } elsif ($target eq 'latexsource') {
1.35 sakharuk 846: $currentstring .= '}';
1.1 sakharuk 847: }
848: return $currentstring;
849: }
1.35 sakharuk 850: #-- <br> tag
1.1 sakharuk 851: sub start_br {
1.75 sakharuk 852: my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
1.1 sakharuk 853: my $currentstring = '';
854: if ($target eq 'web') {
855: $currentstring .= $token->[4];
856: } elsif ($target eq 'tex') {
1.76 sakharuk 857: if ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') {
1.96 sakharuk 858: $currentstring .= '\vskip 0.2 mm';
1.75 sakharuk 859: }
1.18 sakharuk 860: } elsif ($target eq 'latexsource') {
1.35 sakharuk 861: $currentstring .= '\\';
1.1 sakharuk 862: }
863: return $currentstring;
864: }
865: sub end_br {
866: my ($target,$token) = @_;
867: my $currentstring = '';
868: if ($target eq 'web') {
869: $currentstring .= $token->[2];
870: }
871: return $currentstring;
872: }
1.35 sakharuk 873: #-- <big> tag
1.1 sakharuk 874: sub start_big {
875: my ($target,$token) = @_;
876: my $currentstring = '';
877: if ($target eq 'web') {
878: $currentstring .= $token->[4];
879: } elsif ($target eq 'tex') {
1.36 albertel 880: $currentstring .= '\large{';
1.18 sakharuk 881: } elsif ($target eq 'latexsource') {
1.41 sakharuk 882: $currentstring .= '{\Large ';
1.18 sakharuk 883: }
1.1 sakharuk 884: return $currentstring;
885: }
886: sub end_big {
887: my ($target,$token) = @_;
888: my $currentstring = '';
889: if ($target eq 'web') {
890: $currentstring .= $token->[2];
891: } elsif ($target eq 'tex') {
1.35 sakharuk 892: $currentstring .= '}';
1.18 sakharuk 893: } elsif ($target eq 'latexsource') {
1.35 sakharuk 894: $currentstring .= '}';
1.1 sakharuk 895: }
896: return $currentstring;
897: }
1.35 sakharuk 898: #-- <small> tag
1.1 sakharuk 899: sub start_small {
900: my ($target,$token) = @_;
901: my $currentstring = '';
902: if ($target eq 'web') {
903: $currentstring .= $token->[4];
904: } elsif ($target eq 'tex') {
1.41 sakharuk 905: $currentstring .= '{\footnotesize ';
1.18 sakharuk 906: } elsif ($target eq 'latexsource') {
1.41 sakharuk 907: $currentstring .= '{\footnotesize ';
1.1 sakharuk 908: }
909: return $currentstring;
910: }
911: sub end_small {
912: my ($target,$token) = @_;
913: my $currentstring = '';
914: if ($target eq 'web') {
915: $currentstring .= $token->[2];
916: } elsif ($target eq 'tex') {
1.35 sakharuk 917: $currentstring .= '}';
1.18 sakharuk 918: } elsif ($target eq 'latexsource') {
1.35 sakharuk 919: $currentstring .= '}';
1.1 sakharuk 920: }
921: return $currentstring;
922: }
1.35 sakharuk 923: #-- <basefont> tag
1.1 sakharuk 924: sub start_basefont {
1.14 albertel 925: my ($target,$token) = @_;
926: my $currentstring = '';
927: if ($target eq 'web') {
928: $currentstring = $token->[4];
929: }
930: return $currentstring;
931: }
932: sub end_basefont {
933: my ($target,$token) = @_;
934: my $currentstring = '';
935: if ($target eq 'web') {
936: $currentstring = $token->[4];
937: }
938: return $currentstring;
939: }
1.35 sakharuk 940: #-- <font> tag
1.1 sakharuk 941: sub start_font {
1.61 albertel 942: my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
1.1 sakharuk 943: my $currentstring = '';
944: if ($target eq 'web') {
1.61 albertel 945: my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
946: if ($face=~/symbol/i) {$Apache::lonxml::prevent_entity_encode++;}
1.1 sakharuk 947: $currentstring = $token->[4];
948: }
949: return $currentstring;
950: }
951: sub end_font {
1.61 albertel 952: my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
1.1 sakharuk 953: my $currentstring = '';
954: if ($target eq 'web') {
1.61 albertel 955: my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval);
956: if ($face=~/symbol/i) {$Apache::lonxml::prevent_entity_encode--;}
1.1 sakharuk 957: $currentstring = $token->[2];
958: }
959: return $currentstring;
960: }
1.35 sakharuk 961: #-- <strike> tag
1.1 sakharuk 962: sub start_strike {
963: my ($target,$token) = @_;
964: my $currentstring = '';
965: if ($target eq 'web') {
966: $currentstring .= $token->[4];
967: } elsif ($target eq 'tex') {
1.76 sakharuk 968: $currentstring .= '\underline{';
1.1 sakharuk 969: }
970: return $currentstring;
971: }
972: sub end_strike {
973: my ($target,$token) = @_;
974: my $currentstring = '';
975: if ($target eq 'web') {
976: $currentstring .= $token->[2];
977: } elsif ($target eq 'tex') {
1.76 sakharuk 978: $currentstring .= '}';
1.1 sakharuk 979: }
980: return $currentstring;
981: }
1.35 sakharuk 982: #-- <s> tag
1.1 sakharuk 983: sub start_s {
984: my ($target,$token) = @_;
985: my $currentstring = '';
986: if ($target eq 'web') {
987: $currentstring .= $token->[4];
988: } elsif ($target eq 'tex') {
1.76 sakharuk 989: $currentstring .= '\underline{';
1.1 sakharuk 990: }
991: return $currentstring;
992: }
993: sub end_s {
994: my ($target,$token) = @_;
995: my $currentstring = '';
996: if ($target eq 'web') {
997: $currentstring .= $token->[2];
998: } elsif ($target eq 'tex') {
1.76 sakharuk 999: $currentstring .= '}';
1.1 sakharuk 1000: }
1001: return $currentstring;
1002: }
1.35 sakharuk 1003: #-- <sub> tag
1.1 sakharuk 1004: sub start_sub {
1005: my ($target,$token) = @_;
1006: my $currentstring = '';
1007: if ($target eq 'web') {
1008: $currentstring .= $token->[4];
1009: } elsif ($target eq 'tex') {
1010: $currentstring .= "\$_{ ";
1011: }
1012: return $currentstring;
1013: }
1014: sub end_sub {
1015: my ($target,$token) = @_;
1016: my $currentstring = '';
1017: if ($target eq 'web') {
1018: $currentstring .= $token->[2];
1019: } elsif ($target eq 'tex') {
1020: $currentstring .= " }\$";
1021: }
1022: return $currentstring;
1023: }
1.35 sakharuk 1024: #-- <sup> tag
1.1 sakharuk 1025: sub start_sup {
1026: my ($target,$token) = @_;
1027: my $currentstring = '';
1028: if ($target eq 'web') {
1029: $currentstring .= $token->[4];
1030: } elsif ($target eq 'tex') {
1031: $currentstring .= "\$^{ ";
1032: }
1033: return $currentstring;
1034: }
1035: sub end_sup {
1036: my ($target,$token) = @_;
1037: my $currentstring = '';
1038: if ($target eq 'web') {
1039: $currentstring .= $token->[2];
1040: } elsif ($target eq 'tex') {
1041: $currentstring .= " }\$";
1042: }
1043: return $currentstring;
1044: }
1.35 sakharuk 1045: #-- <hr> tag
1.1 sakharuk 1046: sub start_hr {
1047: my ($target,$token) = @_;
1048: my $currentstring = '';
1049: if ($target eq 'web') {
1050: $currentstring .= $token->[4];
1051: } elsif ($target eq 'tex') {
1.85 sakharuk 1052: $currentstring .= '\vskip 0 mm \noindent\makebox[\textwidth/2 ][b]{\hrulefill}\vskip 0 mm ';
1.6 sakharuk 1053: }
1054: return $currentstring;
1055: }
1056: sub end_hr {
1057: my ($target,$token) = @_;
1058: my $currentstring = '';
1059: if ($target eq 'web') {
1060: $currentstring .= $token->[2];
1061: } elsif ($target eq 'tex') {
1.85 sakharuk 1062: }
1063: return $currentstring;
1064: }
1065: #-- <div> tag
1066: sub start_div {
1067: my ($target,$token) = @_;
1068: my $currentstring = '';
1069: if ($target eq 'web') {
1070: $currentstring .= $token->[4];
1071: }
1072: return $currentstring;
1073: }
1074: sub end_div {
1075: my ($target,$token) = @_;
1076: my $currentstring = '';
1077: if ($target eq 'web') {
1078: $currentstring .= $token->[2];
1.1 sakharuk 1079: }
1080: return $currentstring;
1081: }
1.35 sakharuk 1082: #-- <a> tag
1.1 sakharuk 1083: sub start_a {
1084: my ($target,$token) = @_;
1085: my $currentstring = '';
1086: if ($target eq 'web') {
1087: $currentstring .= $token->[4];
1088: } elsif ($target eq 'tex') {
1089: }
1090: return $currentstring;
1091: }
1092: sub end_a {
1.30 albertel 1093: my ($target,$token,$tagstack,$stackref) = @_;
1.1 sakharuk 1094: my $currentstring = '';
1095: if ($target eq 'web') {
1096: $currentstring .= $token->[2];
1097: } elsif ($target eq 'tex') {
1098: my $tempor_var = $stackref->[$#$stackref];
1099: if (index($tempor_var,'name') != -1 ) {
1100: $tempor_var =~ s/name=([^,]*),/$1/g;
1101: } elsif (index($tempor_var,'href') != -1 ) {
1102: $tempor_var =~ s/href=([^,]*),/$1/g;
1103: $currentstring .= " \\ref{$tempor_var}";
1104: }
1105: }
1106: return $currentstring;
1107: }
1.35 sakharuk 1108: #-- <li> tag
1.1 sakharuk 1109: sub start_li {
1.30 albertel 1110: my ($target,$token,$tagstack,$stackref) = @_;
1.1 sakharuk 1111: my $currentstring = '';
1112: if ($target eq 'web') {
1113: $currentstring = $token->[4];
1114: } elsif ($target eq 'tex') {
1.15 sakharuk 1115: my $tempor_var = $stackref->[$#$stackref];
1.1 sakharuk 1116: if (index($tempor_var,'circle') != -1 ) {
1117: $currentstring .= " \\item[o] ";
1118: } elsif (index($tempor_var,'square') != -1 ) {
1119: $currentstring .= " \\item[$\Box$] ";
1.15 sakharuk 1120: } elsif ($tempor_var ne '') {
1121: $_ = $tempor_var;
1122: m/my\s*([^=]*)=/;
1123: $currentstring .= " \\item[$1] ";
1124: } else {
1.1 sakharuk 1125: $currentstring .= " \\item ";
1126: }
1127: }
1128: return $currentstring;
1129: }
1130: sub end_li {
1131: my ($target,$token) = @_;
1132: my $currentstring = '';
1133: if ($target eq 'web') {
1134: $currentstring = $token->[2];
1135: }
1136: return $currentstring;
1137: }
1.35 sakharuk 1138: #-- <u> tag
1.1 sakharuk 1139: sub start_u {
1140: my ($target,$token) = @_;
1141: my $currentstring = '';
1142: if ($target eq 'web') {
1143: $currentstring .= $token->[4];
1144: } elsif ($target eq 'tex') {
1.76 sakharuk 1145: $currentstring .= '\underline{';
1.1 sakharuk 1146: }
1147: return $currentstring;
1148: }
1149: sub end_u {
1150: my ($target,$token) = @_;
1151: my $currentstring = '';
1152: if ($target eq 'web') {
1153: $currentstring .= $token->[2];
1154: } elsif ($target eq 'tex') {
1.76 sakharuk 1155: $currentstring .= '}';
1.1 sakharuk 1156: }
1157: return $currentstring;
1158: }
1.35 sakharuk 1159: #-- <ul> tag
1.1 sakharuk 1160: sub start_ul {
1161: my ($target,$token) = @_;
1162: my $currentstring = '';
1163: if ($target eq 'web') {
1164: $currentstring = $token->[4];
1165: } elsif ($target eq 'tex') {
1.41 sakharuk 1166: $currentstring = '\begin{itemize}';
1.1 sakharuk 1167: }
1168: return $currentstring;
1169: }
1170: sub end_ul {
1171: my ($target,$token) = @_;
1172: my $currentstring = '';
1173: if ($target eq 'web') {
1174: $currentstring = $token->[2];
1175: } elsif ($target eq 'tex') {
1.41 sakharuk 1176: $currentstring = '\end{itemize}';
1.1 sakharuk 1177: }
1178: return $currentstring;
1179: }
1.35 sakharuk 1180: #-- <menu> tag
1.1 sakharuk 1181: sub start_menu {
1182: my ($target,$token) = @_;
1183: my $currentstring = '';
1184: if ($target eq 'web') {
1185: $currentstring = $token->[4];
1186: } elsif ($target eq 'tex') {
1187: $currentstring = " \\begin{itemize} ";
1188: }
1189: return $currentstring;
1190: }
1191: sub end_menu {
1192: my ($target,$token) = @_;
1193: my $currentstring = '';
1194: if ($target eq 'web') {
1195: $currentstring = $token->[2];
1196: } elsif ($target eq 'tex') {
1197: $currentstring = " \\end{itemize}";
1198: }
1199: return $currentstring;
1200: }
1.35 sakharuk 1201: #-- <dir> tag
1.1 sakharuk 1202: sub start_dir {
1203: my ($target,$token) = @_;
1204: my $currentstring = '';
1205: if ($target eq 'web') {
1206: $currentstring = $token->[4];
1207: } elsif ($target eq 'tex') {
1208: $currentstring = " \\begin{itemize} ";
1209: }
1210: return $currentstring;
1211: }
1212: sub end_dir {
1213: my ($target,$token) = @_;
1214: my $currentstring = '';
1215: if ($target eq 'web') {
1216: $currentstring = $token->[2];
1217: } elsif ($target eq 'tex') {
1218: $currentstring = " \\end{itemize}";
1219: }
1220: return $currentstring;
1221: }
1.35 sakharuk 1222: #-- <ol> tag
1.1 sakharuk 1223: sub start_ol {
1224: my ($target,$token) = @_;
1225: my $currentstring = '';
1226: if ($target eq 'web') {
1227: $currentstring = $token->[4];
1228: } elsif ($target eq 'tex') {
1.41 sakharuk 1229: $currentstring = '\begin{enumerate}';
1.1 sakharuk 1230: }
1231: return $currentstring;
1232: }
1233: sub end_ol {
1234: my ($target,$token) = @_;
1235: my $currentstring = '';
1236: if ($target eq 'web') {
1237: $currentstring = $token->[2];
1238: } elsif ($target eq 'tex') {
1.41 sakharuk 1239: $currentstring = '\end{enumerate}';
1.1 sakharuk 1240: }
1241: return $currentstring;
1242: }
1.35 sakharuk 1243: #-- <dl> tag
1.1 sakharuk 1244: sub start_dl {
1245: my ($target,$token) = @_;
1246: my $currentstring = '';
1247: if ($target eq 'web') {
1248: $currentstring = $token->[4];
1249: } elsif ($target eq 'tex') {
1.41 sakharuk 1250: $currentstring = '\begin{description}';
1.1 sakharuk 1251: }
1252: return $currentstring;
1253: }
1254: sub end_dl {
1255: my ($target,$token) = @_;
1256: my $currentstring = '';
1257: if ($target eq 'web') {
1258: $currentstring = $token->[2];
1259: } elsif ($target eq 'tex') {
1.41 sakharuk 1260: $currentstring = '\end{description}';
1.1 sakharuk 1261: }
1262: return $currentstring;
1263: }
1.35 sakharuk 1264: #-- <dt> tag
1.1 sakharuk 1265: sub start_dt {
1266: my ($target,$token) = @_;
1267: my $currentstring = '';
1268: if ($target eq 'web') {
1269: $currentstring = $token->[4];
1270: } elsif ($target eq 'tex') {
1.41 sakharuk 1271: $currentstring = '\item[';
1.1 sakharuk 1272: }
1273: return $currentstring;
1274: }
1275: sub end_dt {
1276: my ($target,$token) = @_;
1277: my $currentstring = '';
1278: if ($target eq 'web') {
1279: $currentstring = $token->[2];
1280: } elsif ($target eq 'tex') {
1.41 sakharuk 1281: $currentstring = ']';
1.1 sakharuk 1282: }
1283: return $currentstring;
1284: }
1.35 sakharuk 1285: #-- <dd> tag
1.1 sakharuk 1286: sub start_dd {
1287: my ($target,$token) = @_;
1288: my $currentstring = '';
1289: if ($target eq 'web') {
1290: $currentstring = $token->[4];
1291: }
1292: return $currentstring;
1293: }
1294: sub end_dd {
1295: my ($target,$token) = @_;
1296: my $currentstring = '';
1297: if ($target eq 'web') {
1298: $currentstring = $token->[2];
1299: }
1300: return $currentstring;
1301: }
1.35 sakharuk 1302: #-- <table> tag
1.91 sakharuk 1303: sub start_table {
1304: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1305: my $currentstring = '';
1306: if ($target eq 'web') {
1307: $currentstring = $token->[4];
1308: } elsif ($target eq 'tex') {
1309: my $aa = {};
1310: push @Apache::londefdef::table, $aa;
1311: $Apache::londefdef::table[-1]{'row_number'} = -1;
1312: $Apache::londefdef::table[-1]{'output'} = ' \noindent \begin{tabular} ';
1.101 sakharuk 1313: my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval,undef,1);
1.91 sakharuk 1314: unless (defined $border) { $border = 0; }
1315: if ($border) {
1316: $Apache::londefdef::table[-1]{'hinc'} = '\hline ';
1317: $Apache::londefdef::table[-1]{'vinc'} = '&';
1318: $Apache::londefdef::table[-1]{'vvinc'} = '|';
1319: } else {
1320: $Apache::londefdef::table[-1]{'hinc'} = '';
1321: $Apache::londefdef::table[-1]{'vinc'} = '&';
1322: $Apache::londefdef::table[-1]{'vvinc'} = '';
1323: }
1324: my $width;
1325: foreach my $key (keys(%{$token->[2]})) {
1326: if ($key =~ /^width$/i) {
1.101 sakharuk 1327: $width = &Apache::lonxml::get_param($key,$parstack,$safeeval,undef,1);
1.91 sakharuk 1328: }
1.51 sakharuk 1329: }
1.91 sakharuk 1330: if (defined($width)) { $Apache::londefdef::table[-1]{'width'}=$width; }
1331: }
1332: return $currentstring;
1333: }
1.51 sakharuk 1334: sub end_table {
1.79 sakharuk 1335: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1.51 sakharuk 1336: my $currentstring = '';
1337: if ($target eq 'web') {
1338: $currentstring = $token->[2];
1339: } elsif ($target eq 'tex') {
1.53 sakharuk 1340: my $inmemory = '';
1.52 sakharuk 1341: my $output = '';
1.79 sakharuk 1342: #construct header of the table
1.53 sakharuk 1343: my $header_of_table = '{'.$Apache::londefdef::table[-1]{'vvinc'};
1.50 sakharuk 1344: my $in;
1.53 sakharuk 1345: for ($in=0;$in<=$Apache::londefdef::table[-1]{'counter_columns'};$in++) {
1346: $header_of_table .= $Apache::londefdef::table[-1]{'columns'}[$in].$Apache::londefdef::table[-1]{'vvinc'};
1347: }
1348: $header_of_table .= '}';
1.79 sakharuk 1349: #fill the table
1.53 sakharuk 1350: for ($in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
1351: $output .= $Apache::londefdef::table[-1]{'rowdata'}[$in];
1.52 sakharuk 1352: chop $output;
1353: $output .= ' \\\\ ';
1.50 sakharuk 1354: }
1.79 sakharuk 1355: #define the length of the table cells
1356: my @lengthforoutput = split(/,/,$Apache::londefdef::table[-1]{'lengthrow'}[0]);
1.91 sakharuk 1357: my $how_many_columns = $#lengthforoutput + 1; #total number of columns in the table
1358: my $filled_columns = 0; #number of columns with information about width
1359: my $available_space = ' ';
1.79 sakharuk 1360: foreach my $tempo_length (@{ $Apache::londefdef::table[-1]{'lengthrow'} }) {
1361: my @length = split(/,/,$tempo_length);
1362: for (my $ico=0;$ico<=$#lengthforoutput;$ico++) {
1363: $lengthforoutput[$ico] =~ m/(\d*\.?\d*)\s*(\w+)/;
1364: my $old_value = $1;
1365: my $old_unit = $2;
1366: if ($old_unit eq 'cm') {
1367: $old_value = $old_value * 10;
1368: } elsif ($old_unit eq 'in') {
1369: $old_value = $old_value * 25.4;
1370: } elsif ($old_unit eq 'pt') {
1371: $old_value = $old_value * 25.4/72.27;
1372: } elsif ($old_unit eq 'pc') {
1373: $old_value = $old_value * 25.4/6.022;
1374: }
1375: $old_unit = 'mm';
1376: $length[$ico] =~ m/(\d*\.?\d*)\s*(\w+)/;
1377: my $new_value = $1;
1378: my $new_unit = $2;
1379: if ($new_unit eq 'cm') {
1380: $new_value = $new_value * 10;
1381: } elsif ($old_unit eq 'in') {
1382: $new_value = $new_value * 25.4;
1383: } elsif ($old_unit eq 'pt') {
1384: $new_value = $new_value * 25.4/72.27;
1385: } elsif ($old_unit eq 'pc') {
1386: $new_value = $new_value * 25.4/6.022;
1387: }
1388: $new_unit = 'mm';
1389: if ($old_value < $new_value) {
1390: $lengthforoutput[$ico] = $new_value.' mm';
1391: } else {
1392: $lengthforoutput[$ico] = $old_value.' mm';
1393: }
1394: }
1395: }
1.91 sakharuk 1396: for (my $ico=0;$ico<=$#lengthforoutput;$ico++) {
1397: if (not $lengthforoutput[$ico]=~m/^\s*0\s*\w*\s*$/) {
1398: $filled_columns++;
1399: $available_space = $available_space.' - '.$lengthforoutput[$ico];
1400: }
1.71 sakharuk 1401: }
1.91 sakharuk 1402: my $temp_file;
1403: my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.tbl";
1404: if (-e $filename) {
1405: $temp_file = Apache::File->new($filename);
1406: my @tbl_file_content = <$temp_file>;
1407: my ($one,$two,$three) = split(/,/,$tbl_file_content[0]);
1408: $how_many_columns+=$one-1;
1409: $filled_columns+=$two;
1410: if($three=~/\S/) {$available_space = $available_space.' - '.$three;}
1411: } else {
1412: $temp_file = Apache::File->new('>>'.$filename);
1413: }
1414: print $temp_file "$how_many_columns,$filled_columns,$available_space\n";
1415: $output =~ s/\\parbox{TOBECHANGEDONNUMBER}{}/\\parbox{1 mm}{}/g;
1416: $output =~ s/\\parbox{TOBECHANGEDONNUMBER}/\\parbox{\$SpacePerColumn}/g;
1.79 sakharuk 1417: my @tagar = @$tagstack;
1418: my $signature = 1;
1419: for (my $ico=0;$ico<$#tagar;$ico++) {
1420: if ($tagar[$ico] eq 'table') { $signature = 0; }
1421: }
1422: if ($signature) {
1.91 sakharuk 1423: my $NumberEmptyLength = $how_many_columns - $filled_columns;
1424: my $SpacePerColumn = '(\textwidth '.$available_space.')/'.$NumberEmptyLength;
1.101 sakharuk 1425: my $shorthand = ($filled_columns+1)*4;
1.97 sakharuk 1426: $output =~ s/\$SpacePerColumn/$SpacePerColumn - $shorthand mm/g;
1.91 sakharuk 1427: }
1.70 sakharuk 1428: $Apache::londefdef::table[-1]{'output'} .= $header_of_table.$output.$Apache::londefdef::table[-1]{'hinc'}.'\end{tabular}\vskip 0 mm ';
1.53 sakharuk 1429: if ($#Apache::londefdef::table > 0) {
1430: $inmemory = $Apache::londefdef::table[-1]{'output'};
1431: pop @Apache::londefdef::table;
1.91 sakharuk 1432: $Apache::londefdef::table[-1]{'rowdata'}[$Apache::londefdef::table[-1]{'row_number'}] .= $inmemory
1.53 sakharuk 1433: } else {
1434: $currentstring = $Apache::londefdef::table[-1]{'output'};
1435: $currentstring =~ s/\\\\\s+\\\\/\\\\/g;
1436: pop @Apache::londefdef::table;
1.81 sakharuk 1437: if (-e $filename) {
1438: unlink $filename;
1439: }
1.53 sakharuk 1440: }
1.51 sakharuk 1441: }
1442: return $currentstring;
1443: }
1444: #-- <tr> tag
1445: sub start_tr {
1446: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1447: my $currentstring = '';
1448: if ($target eq 'web') {
1449: $currentstring = $token->[4];
1450: } elsif ($target eq 'tex') {
1.53 sakharuk 1451: $Apache::londefdef::table[-1]{'row_number'}++;
1.101 sakharuk 1452: my $alignchar = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1),0,1);
1.53 sakharuk 1453: if ($alignchar ne '') {
1454: push @ {$Apache::londefdef::table[-1]{'rows'} }, $alignchar;
1.51 sakharuk 1455: } else {
1.69 sakharuk 1456: push @ {$Apache::londefdef::table[-1]{'rows'} }, 'l';
1.51 sakharuk 1457: }
1.53 sakharuk 1458: push ( @{ $Apache::londefdef::table[-1]{'rowdata'} }, $Apache::londefdef::table[-1]{'hinc'});
1459: $Apache::londefdef::table[-1]{'counter_columns'} = -1;
1.78 sakharuk 1460: $Apache::londefdef::table[-1]{'length'} = '';
1.1 sakharuk 1461: }
1462: return $currentstring;
1.51 sakharuk 1463: }
1464: sub end_tr {
1465: my ($target,$token) = @_;
1466: my $currentstring = '';
1467: if ($target eq 'web') {
1468: $currentstring = $token->[2];
1469: } elsif ($target eq 'tex') {
1.79 sakharuk 1470: push @{ $Apache::londefdef::table[-1]{'lengthrow'} },$Apache::londefdef::table[-1]{'length'};
1471:
1.51 sakharuk 1472: }
1473: return $currentstring;
1.1 sakharuk 1474: }
1.51 sakharuk 1475: #-- <td> tag
1476: sub start_td {
1477: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1478: my $currentstring = '';
1479: if ($target eq 'web') {
1480: $currentstring = $token->[4];
1.91 sakharuk 1481: } elsif ($target eq 'tex') {
1.101 sakharuk 1482: my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1),0,1);
1.51 sakharuk 1483: if ($what_to_push eq '') {
1.53 sakharuk 1484: $what_to_push = substr($Apache::londefdef::table[-1]{'rows'}[0],0,1);;
1.51 sakharuk 1485: }
1.53 sakharuk 1486: push @{ $Apache::londefdef::table[-1]{'columns'} }, $what_to_push;
1487: $Apache::londefdef::table[-1]{'counter_columns'}++;
1.52 sakharuk 1488: &Apache::lonxml::startredirection();
1489: ;
1.51 sakharuk 1490: }
1491: return $currentstring;
1492: }
1493: sub end_td {
1.59 sakharuk 1494: my ($target,$token) = @_;
1495: my $currentstring = '';
1.82 sakharuk 1496: my $tempolen = '';
1.59 sakharuk 1497: if ($target eq 'web') {
1498: $currentstring = $token->[2];
1499: } elsif ($target eq 'tex') {
1500: my $current_row = $Apache::londefdef::table[-1]{'row_number'};
1501: my $data=&Apache::lonxml::endredirection();
1.91 sakharuk 1502: if ($data=~m/width\s*=\s*(\d+\.?\d*\s*(mm|cm|in|pc|pt))/) {
1.82 sakharuk 1503: $Apache::londefdef::table[-1]{'length'} .= $1.',';
1504: $tempolen = $1;
1.78 sakharuk 1505: } else {
1.82 sakharuk 1506: if (length($data)<5) {
1.91 sakharuk 1507: $Apache::londefdef::table[-1]{'length'} .= '0 mm,';
1.82 sakharuk 1508: $tempolen = '5 mm';
1509: } else {
1510: $Apache::londefdef::table[-1]{'length'} .= '0 mm,';
1.91 sakharuk 1511: $tempolen = 'TOBECHANGEDONNUMBER';
1.82 sakharuk 1512: }
1.79 sakharuk 1513: }
1.82 sakharuk 1514: @{ $Apache::londefdef::table[-1]{'rowdata'} }[$current_row] .= '\parbox{'.$tempolen.'}{'.$data.'} '.$Apache::londefdef::table[-1]{'vinc'};
1.59 sakharuk 1515: }
1516: return $currentstring;
1517: }
1518: #-- <th> tag
1519: sub start_th {
1520: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1521: my $currentstring = '';
1522: if ($target eq 'web') {
1523: $currentstring = $token->[4];
1524: } elsif ($target eq 'tex') {
1.101 sakharuk 1525: my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1),0,1);
1.59 sakharuk 1526: if ($what_to_push eq '') {
1527: $what_to_push = substr($Apache::londefdef::table[-1]{'rows'}[0],0,1);;
1528: }
1529: push @{ $Apache::londefdef::table[-1]{'columns'} }, $what_to_push;
1530: $Apache::londefdef::table[-1]{'counter_columns'}++;
1531: &Apache::lonxml::startredirection();
1532: ;
1533: }
1534: return $currentstring;
1535: }
1536: sub end_th {
1.1 sakharuk 1537: my ($target,$token) = @_;
1538: my $currentstring = '';
1539: if ($target eq 'web') {
1.51 sakharuk 1540: $currentstring = $token->[2];
1541: } elsif ($target eq 'tex') {
1.53 sakharuk 1542: my $current_row = $Apache::londefdef::table[-1]{'row_number'};
1.52 sakharuk 1543: my $data=&Apache::lonxml::endredirection();
1.78 sakharuk 1544: if ($data=~m/width\s*=\s*(\d+\.*\d*\s*(mm|cm))/) {
1545: $Apache::londefdef::table[-1]{'length'} .= $1.',';
1546: } else {
1547: $Apache::londefdef::table[-1]{'length'} .= '0 mm,';
1548: }
1.72 sakharuk 1549: @{ $Apache::londefdef::table[-1]{'rowdata'} }[$current_row] .= '\parbox{'.$1.'}{\textbf{'.$data.'}} '.$Apache::londefdef::table[-1]{'vinc'};
1.44 sakharuk 1550: }
1.1 sakharuk 1551: return $currentstring;
1552: }
1.35 sakharuk 1553: #-- <img> tag
1.10 www 1554: sub start_img {
1.41 sakharuk 1555: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1.99 albertel 1556: my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,
1557: undef,1);
1558: $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=$src;
1.10 www 1559: my $currentstring = '';
1.58 sakharuk 1560: my $width_param = '';
1.69 sakharuk 1561: my $height_param = '';
1.90 sakharuk 1562: my $scaling = .3;
1.44 sakharuk 1563:
1.42 albertel 1564: if ($target eq 'web') {
1.99 albertel 1565: $currentstring = $token->[4];
1.10 www 1566: } elsif ($target eq 'tex') {
1.99 albertel 1567: &image_replication($src);
1.54 sakharuk 1568: $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
1.102 sakharuk 1569: #if original gif/jpg/png file exist do following:
1.84 sakharuk 1570: if (-e $src) {
1571: #defines the default size of image
1.80 sakharuk 1572: my $image = Image::Magick->new;
1573: my $current_figure = $image->Read($src);
1574: $width_param = $image->Get('width') * $scaling;;
1575: $height_param = $image->Get('height') * $scaling;;
1576: undef $image;
1577: #do we have any specified size of the picture?
1.104 ! sakharuk 1578: my $TeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval);
! 1579: my $TeXheight = &Apache::lonxml::get_param('TeXheight',$parstack,$safeeval);
1.101 sakharuk 1580: my $width = &Apache::lonxml::get_param('width',$parstack,$safeeval,
1581: undef,1);
1.90 sakharuk 1582: if ($TeXwidth ne '') {
1583: if ($TeXwidth=~/(\d+)\s*\%/) {
1584: $width_param = $1*$ENV{'form.textwidth'}/100;
1585: } else {
1586: $width_param = $TeXwidth;
1587: }
1588: } elsif ($TeXheight ne '') {
1589: $width_param = $TeXheight/$height_param*$width_param;
1.80 sakharuk 1590: } elsif ($width ne '') {
1591: $width_param = $width*$scaling;
1592: }
1.84 sakharuk 1593: my $file;
1594: my $path;
1595: if ($src =~ m!(.*)/([^/]*)$!) {
1596: $file = $2;
1597: $path = $1.'/';
1598: }
1599: my $newsrc = $src;
1.103 sakharuk 1600: $newsrc =~ s/\.(gif|jpg|png)$/.eps/i;
1601: $file=~s/\.(gif|jpg|png)$/.eps/i;
1.80 sakharuk 1602: #where can we find the picture?
1603: if (-e $newsrc) {
1.84 sakharuk 1604: #eps counterpart for image exist
1.80 sakharuk 1605: if ($path) {
1.96 sakharuk 1606: $currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} ';
1.62 sakharuk 1607: }
1.80 sakharuk 1608: } else {
1.84 sakharuk 1609: #there is no eps counterpart for image - check for ps one
1610: $newsrc =~ s/\.eps$/\.ps/;
1611: if (-e $newsrc) {
1612: #ps counterpart for image exist
1613: $file =~ s/\.eps$/\.ps/;
1614: if ($path) {
1.96 sakharuk 1615: $currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} ';
1.84 sakharuk 1616: }
1617: } else {
1618: #there aren't eps or ps - so create eps
1619: my $temp_file;
1620: my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat";
1621: $temp_file = Apache::File->new('>>'.$filename);
1622: print $temp_file "$src\n";
1.96 sakharuk 1623: $currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool/}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} ';
1.84 sakharuk 1624: }
1.62 sakharuk 1625: }
1.80 sakharuk 1626: } else {
1.84 sakharuk 1627: #original image file doesn't exist so check the alt attribute
1.101 sakharuk 1628: my $alt = &Apache::lonxml::get_param('alt',$parstack,$safeeval,undef,1);
1.80 sakharuk 1629: if ($alt) {
1630: $currentstring .= ' '.$alt.' ';
1.62 sakharuk 1631: } else {
1.92 sakharuk 1632: #<allow> tag will care about replication
1.57 sakharuk 1633: }
1.42 albertel 1634: }
1635: }
1636: return $currentstring;
1.10 www 1637: }
1638: sub end_img {
1639: my ($target,$token) = @_;
1640: my $currentstring = '';
1641: if ($target eq 'web') {
1.44 sakharuk 1642: $currentstring = $token->[2];
1.10 www 1643: } elsif ($target eq 'tex') {
1.44 sakharuk 1644: $currentstring = '';
1645: }
1.10 www 1646: return $currentstring;
1647: }
1.35 sakharuk 1648: #-- <applet> tag
1.10 www 1649:
1650: sub start_applet {
1651: my ($target,$token) = @_;
1652: $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
1653: $token->[2]->{'code'};
1.44 sakharuk 1654: $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
1.10 www 1655: $token->[2]->{'archive'};
1656: my $currentstring = '';
1657: if ($target eq 'web') {
1.44 sakharuk 1658: $currentstring = $token->[4];
1.10 www 1659: } elsif ($target eq 'tex') {
1.44 sakharuk 1660: $currentstring = " \\begin{figure} ";
1.10 www 1661: }
1662: return $currentstring;
1663: }
1.44 sakharuk 1664: sub end_applet {
1665: my ($target,$token) = @_;
1666: my $currentstring = '';
1667: if ($target eq 'web') {
1668: $currentstring = $token->[2];
1669: } elsif ($target eq 'tex') {
1670: $currentstring = " \\end{figure}";
1671: }
1672: return $currentstring;
1673: }
1.10 www 1674:
1.35 sakharuk 1675: #-- <embed> tag
1.10 www 1676:
1.45 sakharuk 1677: sub start_embed {
1.44 sakharuk 1678: my ($target,$token) = @_;
1679: $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
1680: $token->[2]->{'src'};
1681: my $currentstring = '';
1682: if ($target eq 'web') {
1683: $currentstring = $token->[4];
1684: } elsif ($target eq 'tex') {
1685: $currentstring = " \\begin{figure} ";
1686: }
1687: return $currentstring;
1688: }
1.10 www 1689: sub end_embed {
1690: my ($target,$token) = @_;
1691: my $currentstring = '';
1692: if ($target eq 'web') {
1693: $currentstring = $token->[2];
1694: } elsif ($target eq 'tex') {
1695: $currentstring = " \\end{figure}";
1696: }
1697: return $currentstring;
1698: }
1699:
1.35 sakharuk 1700: #-- <param> tag
1.10 www 1701:
1.11 www 1702: sub start_param {
1.10 www 1703: my ($target,$token) = @_;
1704: if ($token->[2]->{'name'} eq 'cabbase') {
1705: $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
1706: $token->[2]->{'value'};
1707: }
1.20 www 1708: $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
1.10 www 1709: $token->[2]->{'src'};
1710: my $currentstring = '';
1711: if ($target eq 'web') {
1712: $currentstring = $token->[4];
1713: } elsif ($target eq 'tex') {
1714: $currentstring = " \\begin{figure} ";
1715: }
1716: return $currentstring;
1717: }
1.11 www 1718: sub end_param {
1.10 www 1719: my ($target,$token) = @_;
1720: my $currentstring = '';
1721: if ($target eq 'web') {
1722: $currentstring = $token->[2];
1723: } elsif ($target eq 'tex') {
1724: $currentstring = " \\end{figure}";
1725: }
1726: return $currentstring;
1727: }
1.35 sakharuk 1728: #-- <allow> tag
1.98 albertel 1729: sub start_allow {
1730: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1731: $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
1732: $token->[2]->{'src'};
1.101 sakharuk 1733: my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1);
1.98 albertel 1734: &image_replication($src);
1735: my $result;
1736: if ($target eq 'edit') {
1737: $result .=&Apache::edit::tag_start($target,$token);
1738: $result .=&Apache::edit::text_arg('File Spec:','src',$token,70);
1739: $result .=&Apache::edit::end_row();#.&Apache::edit::start_spanning_row();
1740: } elsif ($target eq 'modified') {
1741: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
1742: $safeeval,'src');
1743: if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
1744: }
1745: return $result;
1746: }
1747:
1748: sub end_allow {
1749: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1750: if ( $target eq 'edit') { return (&Apache::edit::end_table()); }
1751: return '';
1752: }
1.35 sakharuk 1753: #-- Frames
1.31 albertel 1754: sub start_frameset {
1755: my ($target,$token) = @_;
1756: my $currentstring = '';
1757: if ($target eq 'web') {
1758: if (!$Apache::lonxml::registered) {
1.47 matthew 1759: $currentstring.='<head>'.
1760: &Apache::lonxml::registerurl(undef,$target).'</head>';
1.31 albertel 1761: }
1762: $currentstring .= $token->[4];
1763: }
1764: return $currentstring;
1765: }
1766: sub end_frameset {
1767: my ($target,$token) = @_;
1768: my $currentstring = '';
1769: if ($target eq 'web') {
1770: $currentstring = $token->[2];
1771: }
1772: return $currentstring;
1.41 sakharuk 1773: }
1774: #-- <pre>
1775: sub start_pre {
1776: my ($target,$token) = @_;
1777: my $currentstring = '';
1778: if ($target eq 'web') {
1779: $currentstring .= $token->[4];
1780: } elsif ($target eq 'tex') {
1781: $currentstring .= '\begin{verbatim}';
1782: }
1783: return $currentstring;
1784: }
1785: sub end_pre {
1786: my ($target,$token) = @_;
1787: my $currentstring = '';
1788: if ($target eq 'web') {
1789: $currentstring .= $token->[2];
1790: } elsif ($target eq 'tex') {
1791: $currentstring .= '\end{verbatim}';
1.44 sakharuk 1792: }
1793: return $currentstring;
1794: }
1795: #-- <insert>
1796: sub start_insert {
1.46 sakharuk 1797: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1.44 sakharuk 1798: my $currentstring = '';
1799: if ($target eq 'web') {
1.101 sakharuk 1800: my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval,undef,1);
1.46 sakharuk 1801: $currentstring .= '<b>'.$display.'</b>';;
1.44 sakharuk 1802: }
1803: return $currentstring;
1804: }
1805: sub end_insert {
1.48 sakharuk 1806: my ($target,$token) = @_;
1807: my $currentstring = '';
1808: if ($target eq 'web') {
1809: $currentstring .= '';
1810: }
1811: return $currentstring;
1812: }
1813: #-- <externallink>
1814: sub start_externallink {
1815: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1816: my $currentstring = '';
1817: if ($target eq 'web') {
1.101 sakharuk 1818: my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval,undef,1);
1.48 sakharuk 1819: $currentstring .= '<b>'.$display.'</b>';;
1820: }
1821: return $currentstring;
1822: }
1823: sub end_externallink {
1.44 sakharuk 1824: my ($target,$token) = @_;
1825: my $currentstring = '';
1826: if ($target eq 'web') {
1827: $currentstring .= '';
1.65 sakharuk 1828: }
1829: return $currentstring;
1830: }
1831: #-- <blankspace heigth="">
1832: sub start_blankspace {
1833: my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
1834: my $currentstring = '';
1835: if ($target eq 'tex') {
1.101 sakharuk 1836: my $howmuch = &Apache::lonxml::get_param('heigth',$parstack,$safeeval,undef,1);
1.65 sakharuk 1837: $currentstring .= '\vskip '.$howmuch.' ';
1838: }
1839: return $currentstring;
1840: }
1841: sub end_blankspace {
1842: my ($target,$token) = @_;
1843: my $currentstring = '';
1844: if ($target eq 'tex') {
1845: $currentstring .= '';
1846: }
1847: return $currentstring;
1848: }
1.88 sakharuk 1849: #-- <abbr> tag
1850: sub start_abbr {
1851: my ($target,$token) = @_;
1852: my $currentstring = '';
1853: if ($target eq 'web') {
1854: $currentstring = $token->[4];
1855: }
1856: return $currentstring;
1857: }
1858: sub end_abbr {
1859: my ($target,$token) = @_;
1860: my $currentstring = '';
1861: if ($target eq 'web') {
1862: $currentstring = $token->[2];
1863: }
1864: return $currentstring;
1865: }
1866: #-- <acronym> tag
1867: sub start_acronym {
1868: my ($target,$token) = @_;
1869: my $currentstring = '';
1870: if ($target eq 'web') {
1871: $currentstring = $token->[4];
1872: }
1873: return $currentstring;
1874: }
1875: sub end_acronym {
1876: my ($target,$token) = @_;
1877: my $currentstring = '';
1878: if ($target eq 'web') {
1879: $currentstring = $token->[2];
1880: }
1881: return $currentstring;
1882: }
1883: #-- <area> tag
1884: sub start_area {
1885: my ($target,$token) = @_;
1886: my $currentstring = '';
1887: if ($target eq 'web') {
1888: $currentstring = $token->[4];
1889: }
1890: return $currentstring;
1891: }
1892: sub end_area {
1893: my ($target,$token) = @_;
1894: my $currentstring = '';
1895: if ($target eq 'web') {
1896: $currentstring = $token->[2];
1897: }
1898: return $currentstring;
1899: }
1900: #-- <base> tag
1901: sub start_base {
1902: my ($target,$token) = @_;
1903: my $currentstring = '';
1904: if ($target eq 'web') {
1905: $currentstring = $token->[4];
1906: }
1907: return $currentstring;
1908: }
1909: sub end_base {
1910: my ($target,$token) = @_;
1911: my $currentstring = '';
1912: if ($target eq 'web') {
1913: $currentstring = $token->[2];
1914: }
1915: return $currentstring;
1916: }
1917: #-- <bdo> tag
1918: sub start_bdo {
1919: my ($target,$token) = @_;
1920: my $currentstring = '';
1921: if ($target eq 'web') {
1922: $currentstring = $token->[4];
1923: }
1924: return $currentstring;
1925: }
1926: sub end_bdo {
1927: my ($target,$token) = @_;
1928: my $currentstring = '';
1929: if ($target eq 'web') {
1930: $currentstring = $token->[2];
1931: }
1932: return $currentstring;
1933: }
1934: #-- <bgsound> tag
1935: sub start_bgsound {
1936: my ($target,$token) = @_;
1937: my $currentstring = '';
1938: if ($target eq 'web') {
1939: $currentstring = $token->[4];
1940: }
1941: return $currentstring;
1942: }
1943: sub end_bgsound {
1944: my ($target,$token) = @_;
1945: my $currentstring = '';
1946: if ($target eq 'web') {
1947: $currentstring = $token->[2];
1948: }
1949: return $currentstring;
1950: }
1951: #-- <blink> tag
1952: sub start_blink {
1953: my ($target,$token) = @_;
1954: my $currentstring = '';
1955: if ($target eq 'web') {
1956: $currentstring = $token->[4];
1957: }
1958: return $currentstring;
1959: }
1960: sub end_blink {
1961: my ($target,$token) = @_;
1962: my $currentstring = '';
1963: if ($target eq 'web') {
1964: $currentstring = $token->[2];
1965: }
1966: return $currentstring;
1967: }
1968: #-- <blockquote> tag
1969: sub start_blockquote {
1970: my ($target,$token) = @_;
1971: my $currentstring = '';
1972: if ($target eq 'web') {
1973: $currentstring = $token->[4];
1974: }
1975: return $currentstring;
1976: }
1977: sub end_blockquote {
1978: my ($target,$token) = @_;
1979: my $currentstring = '';
1980: if ($target eq 'web') {
1981: $currentstring = $token->[2];
1982: }
1983: return $currentstring;
1984: }
1985: #-- <button> tag
1986: sub start_button {
1987: my ($target,$token) = @_;
1988: my $currentstring = '';
1989: if ($target eq 'web') {
1990: $currentstring = $token->[4];
1991: }
1992: return $currentstring;
1993: }
1994: sub end_button {
1995: my ($target,$token) = @_;
1996: my $currentstring = '';
1997: if ($target eq 'web') {
1998: $currentstring = $token->[2];
1999: }
2000: return $currentstring;
2001: }
2002: #-- <caption> tag
2003: sub start_caption {
2004: my ($target,$token) = @_;
2005: my $currentstring = '';
2006: if ($target eq 'web') {
2007: $currentstring = $token->[4];
2008: }
2009: return $currentstring;
2010: }
2011: sub end_caption {
2012: my ($target,$token) = @_;
2013: my $currentstring = '';
2014: if ($target eq 'web') {
2015: $currentstring = $token->[2];
2016: }
2017: return $currentstring;
2018: }
2019: #-- <col> tag
2020: sub start_col {
2021: my ($target,$token) = @_;
2022: my $currentstring = '';
2023: if ($target eq 'web') {
2024: $currentstring = $token->[4];
2025: }
2026: return $currentstring;
2027: }
2028: sub end_col {
2029: my ($target,$token) = @_;
2030: my $currentstring = '';
2031: if ($target eq 'web') {
2032: $currentstring = $token->[2];
2033: }
2034: return $currentstring;
2035: }
2036: #-- <colgroup> tag
2037: sub start_colgroup {
2038: my ($target,$token) = @_;
2039: my $currentstring = '';
2040: if ($target eq 'web') {
2041: $currentstring = $token->[4];
2042: }
2043: return $currentstring;
2044: }
2045: sub end_colgroup {
2046: my ($target,$token) = @_;
2047: my $currentstring = '';
2048: if ($target eq 'web') {
2049: $currentstring = $token->[2];
2050: }
2051: return $currentstring;
2052: }
2053: #-- <del> tag
2054: sub start_del {
2055: my ($target,$token) = @_;
2056: my $currentstring = '';
2057: if ($target eq 'web') {
2058: $currentstring = $token->[4];
2059: }
2060: return $currentstring;
2061: }
2062: sub end_del {
2063: my ($target,$token) = @_;
2064: my $currentstring = '';
2065: if ($target eq 'web') {
2066: $currentstring = $token->[2];
2067: }
2068: return $currentstring;
2069: }
2070: #-- <fieldset> tag
2071: sub start_fieldset {
2072: my ($target,$token) = @_;
2073: my $currentstring = '';
2074: if ($target eq 'web') {
2075: $currentstring = $token->[4];
2076: }
2077: return $currentstring;
2078: }
2079: sub end_fieldset {
2080: my ($target,$token) = @_;
2081: my $currentstring = '';
2082: if ($target eq 'web') {
2083: $currentstring = $token->[2];
2084: }
2085: return $currentstring;
2086: }
2087: #-- <frame> tag
2088: sub start_frame {
2089: my ($target,$token) = @_;
2090: my $currentstring = '';
2091: if ($target eq 'web') {
2092: $currentstring = $token->[4];
2093: }
2094: return $currentstring;
2095: }
2096: sub end_frame {
2097: my ($target,$token) = @_;
2098: my $currentstring = '';
2099: if ($target eq 'web') {
2100: $currentstring = $token->[2];
2101: }
2102: return $currentstring;
2103: }
2104: #-- <iframe> tag
2105: sub start_iframe {
2106: my ($target,$token) = @_;
2107: my $currentstring = '';
2108: if ($target eq 'web') {
2109: $currentstring = $token->[4];
2110: }
2111: return $currentstring;
2112: }
2113: sub end_iframe {
2114: my ($target,$token) = @_;
2115: my $currentstring = '';
2116: if ($target eq 'web') {
2117: $currentstring = $token->[2];
2118: }
2119: return $currentstring;
2120: }
2121: #-- <ins> tag
2122: sub start_ins {
2123: my ($target,$token) = @_;
2124: my $currentstring = '';
2125: if ($target eq 'web') {
2126: $currentstring = $token->[4];
2127: }
2128: return $currentstring;
2129: }
2130: sub end_ins {
2131: my ($target,$token) = @_;
2132: my $currentstring = '';
2133: if ($target eq 'web') {
2134: $currentstring = $token->[2];
2135: }
2136: return $currentstring;
2137: }
2138: #-- <isindex> tag
2139: sub start_isindex {
2140: my ($target,$token) = @_;
2141: my $currentstring = '';
2142: if ($target eq 'web') {
2143: $currentstring = $token->[4];
2144: }
2145: return $currentstring;
2146: }
2147: sub end_isindex {
2148: my ($target,$token) = @_;
2149: my $currentstring = '';
2150: if ($target eq 'web') {
2151: $currentstring = $token->[2];
2152: }
2153: return $currentstring;
2154: }
2155: #-- <keygen> tag
2156: sub start_keygen {
2157: my ($target,$token) = @_;
2158: my $currentstring = '';
2159: if ($target eq 'web') {
2160: $currentstring = $token->[4];
2161: }
2162: return $currentstring;
2163: }
2164: sub end_keygen {
2165: my ($target,$token) = @_;
2166: my $currentstring = '';
2167: if ($target eq 'web') {
2168: $currentstring = $token->[2];
2169: }
2170: return $currentstring;
2171: }
2172: #-- <label> tag
2173: sub start_label {
2174: my ($target,$token) = @_;
2175: my $currentstring = '';
2176: if ($target eq 'web') {
2177: $currentstring = $token->[4];
2178: }
2179: return $currentstring;
2180: }
2181: sub end_label {
2182: my ($target,$token) = @_;
2183: my $currentstring = '';
2184: if ($target eq 'web') {
2185: $currentstring = $token->[2];
2186: }
2187: return $currentstring;
2188: }
2189: #-- <layer> tag
2190: sub start_layer {
2191: my ($target,$token) = @_;
2192: my $currentstring = '';
2193: if ($target eq 'web') {
2194: $currentstring = $token->[4];
2195: }
2196: return $currentstring;
2197: }
2198: sub end_layer {
2199: my ($target,$token) = @_;
2200: my $currentstring = '';
2201: if ($target eq 'web') {
2202: $currentstring = $token->[2];
2203: }
2204: return $currentstring;
2205: }
2206: #-- <legend> tag
2207: sub start_legend {
2208: my ($target,$token) = @_;
2209: my $currentstring = '';
2210: if ($target eq 'web') {
2211: $currentstring = $token->[4];
2212: }
2213: return $currentstring;
2214: }
2215: sub end_legend {
2216: my ($target,$token) = @_;
2217: my $currentstring = '';
2218: if ($target eq 'web') {
2219: $currentstring = $token->[2];
2220: }
2221: return $currentstring;
2222: }
2223: #-- <link> tag
2224: sub start_link {
2225: my ($target,$token) = @_;
2226: my $currentstring = '';
2227: if ($target eq 'web') {
2228: $currentstring = $token->[4];
2229: }
2230: return $currentstring;
2231: }
2232: sub end_link {
2233: my ($target,$token) = @_;
2234: my $currentstring = '';
2235: if ($target eq 'web') {
2236: $currentstring = $token->[2];
2237: }
2238: return $currentstring;
2239: }
2240: #-- <marquee> tag
2241: sub start_marquee {
2242: my ($target,$token) = @_;
2243: my $currentstring = '';
2244: if ($target eq 'web') {
2245: $currentstring = $token->[4];
2246: }
2247: return $currentstring;
2248: }
2249: sub end_marquee {
2250: my ($target,$token) = @_;
2251: my $currentstring = '';
2252: if ($target eq 'web') {
2253: $currentstring = $token->[2];
2254: }
2255: return $currentstring;
2256: }
2257: #-- <malticol> tag
2258: sub start_malticol {
2259: my ($target,$token) = @_;
2260: my $currentstring = '';
2261: if ($target eq 'web') {
2262: $currentstring = $token->[4];
2263: }
2264: return $currentstring;
2265: }
2266: sub end_malticol {
2267: my ($target,$token) = @_;
2268: my $currentstring = '';
2269: if ($target eq 'web') {
2270: $currentstring = $token->[2];
2271: }
2272: return $currentstring;
2273: }
2274: #-- <nobr> tag
2275: sub start_nobr {
2276: my ($target,$token) = @_;
2277: my $currentstring = '';
2278: if ($target eq 'web') {
2279: $currentstring = $token->[4];
2280: }
2281: return $currentstring;
2282: }
2283: sub end_nobr {
2284: my ($target,$token) = @_;
2285: my $currentstring = '';
2286: if ($target eq 'web') {
2287: $currentstring = $token->[2];
2288: }
2289: return $currentstring;
2290: }
2291: #-- <noembed> tag
2292: sub start_noembed {
2293: my ($target,$token) = @_;
2294: my $currentstring = '';
2295: if ($target eq 'web') {
2296: $currentstring = $token->[4];
2297: }
2298: return $currentstring;
2299: }
2300: sub end_noembed {
2301: my ($target,$token) = @_;
2302: my $currentstring = '';
2303: if ($target eq 'web') {
2304: $currentstring = $token->[2];
2305: }
2306: return $currentstring;
2307: }
2308: #-- <noframes> tag
2309: sub start_noframes {
2310: my ($target,$token) = @_;
2311: my $currentstring = '';
2312: if ($target eq 'web') {
2313: $currentstring = $token->[4];
2314: }
2315: return $currentstring;
2316: }
2317: sub end_noframes {
2318: my ($target,$token) = @_;
2319: my $currentstring = '';
2320: if ($target eq 'web') {
2321: $currentstring = $token->[2];
2322: }
2323: return $currentstring;
2324: }
2325: #-- <nolayer> tag
2326: sub start_nolayer {
2327: my ($target,$token) = @_;
2328: my $currentstring = '';
2329: if ($target eq 'web') {
2330: $currentstring = $token->[4];
2331: }
2332: return $currentstring;
2333: }
2334: sub end_nolayer {
2335: my ($target,$token) = @_;
2336: my $currentstring = '';
2337: if ($target eq 'web') {
2338: $currentstring = $token->[2];
2339: }
2340: return $currentstring;
2341: }
2342: #-- <noscript> tag
2343: sub start_noscript {
2344: my ($target,$token) = @_;
2345: my $currentstring = '';
2346: if ($target eq 'web') {
2347: $currentstring = $token->[4];
2348: }
2349: return $currentstring;
2350: }
2351: sub end_noscript {
2352: my ($target,$token) = @_;
2353: my $currentstring = '';
2354: if ($target eq 'web') {
2355: $currentstring = $token->[2];
2356: }
2357: return $currentstring;
2358: }
2359: #-- <object> tag
2360: sub start_object {
2361: my ($target,$token) = @_;
2362: my $currentstring = '';
2363: if ($target eq 'web') {
2364: $currentstring = $token->[4];
2365: }
2366: return $currentstring;
2367: }
2368: sub end_object {
2369: my ($target,$token) = @_;
2370: my $currentstring = '';
2371: if ($target eq 'web') {
2372: $currentstring = $token->[2];
2373: }
2374: return $currentstring;
2375: }
2376: #-- <optgroup> tag
2377: sub start_optgroup {
2378: my ($target,$token) = @_;
2379: my $currentstring = '';
2380: if ($target eq 'web') {
2381: $currentstring = $token->[4];
2382: }
2383: return $currentstring;
2384: }
2385: sub end_optgroup {
2386: my ($target,$token) = @_;
2387: my $currentstring = '';
2388: if ($target eq 'web') {
2389: $currentstring = $token->[2];
2390: }
2391: return $currentstring;
2392: }
2393: #-- <samp> tag
2394: sub start_samp {
2395: my ($target,$token) = @_;
2396: my $currentstring = '';
2397: if ($target eq 'web') {
2398: $currentstring = $token->[4];
2399: }
2400: return $currentstring;
2401: }
2402: sub end_samp {
2403: my ($target,$token) = @_;
2404: my $currentstring = '';
2405: if ($target eq 'web') {
2406: $currentstring = $token->[2];
2407: }
2408: return $currentstring;
2409: }
2410: #-- <server> tag
2411: sub start_server {
2412: my ($target,$token) = @_;
2413: my $currentstring = '';
2414: if ($target eq 'web') {
2415: $currentstring = $token->[4];
2416: }
2417: return $currentstring;
2418: }
2419: sub end_server {
2420: my ($target,$token) = @_;
2421: my $currentstring = '';
2422: if ($target eq 'web') {
2423: $currentstring = $token->[2];
2424: }
2425: return $currentstring;
2426: }
2427: #-- <spacer> tag
2428: sub start_spacer {
2429: my ($target,$token) = @_;
2430: my $currentstring = '';
2431: if ($target eq 'web') {
2432: $currentstring = $token->[4];
2433: }
2434: return $currentstring;
2435: }
2436: sub end_spacer {
2437: my ($target,$token) = @_;
2438: my $currentstring = '';
2439: if ($target eq 'web') {
2440: $currentstring = $token->[2];
2441: }
2442: return $currentstring;
2443: }
2444: #-- <span> tag
2445: sub start_span {
2446: my ($target,$token) = @_;
2447: my $currentstring = '';
2448: if ($target eq 'web') {
2449: $currentstring = $token->[4];
2450: }
2451: return $currentstring;
2452: }
2453: sub end_span {
2454: my ($target,$token) = @_;
2455: my $currentstring = '';
2456: if ($target eq 'web') {
2457: $currentstring = $token->[2];
2458: }
2459: return $currentstring;
2460: }
2461: #-- <tbody> tag
2462: sub start_tbody {
2463: my ($target,$token) = @_;
2464: my $currentstring = '';
2465: if ($target eq 'web') {
2466: $currentstring = $token->[4];
2467: }
2468: return $currentstring;
2469: }
2470: sub end_tbody {
2471: my ($target,$token) = @_;
2472: my $currentstring = '';
2473: if ($target eq 'web') {
2474: $currentstring = $token->[2];
2475: }
2476: return $currentstring;
2477: }
2478: #-- <tfoot> tag
2479: sub start_tfoot {
2480: my ($target,$token) = @_;
2481: my $currentstring = '';
2482: if ($target eq 'web') {
2483: $currentstring = $token->[4];
2484: }
2485: return $currentstring;
2486: }
2487: sub end_tfoot {
2488: my ($target,$token) = @_;
2489: my $currentstring = '';
2490: if ($target eq 'web') {
2491: $currentstring = $token->[2];
2492: }
2493: return $currentstring;
2494: }
2495: #-- <thead> tag
2496: sub start_thead {
2497: my ($target,$token) = @_;
2498: my $currentstring = '';
2499: if ($target eq 'web') {
2500: $currentstring = $token->[4];
2501: }
2502: return $currentstring;
2503: }
2504: sub end_thead {
2505: my ($target,$token) = @_;
2506: my $currentstring = '';
2507: if ($target eq 'web') {
2508: $currentstring = $token->[2];
2509: }
2510: return $currentstring;
2511: }
2512: #-- <var> tag
2513: sub start_var {
2514: my ($target,$token) = @_;
2515: my $currentstring = '';
2516: if ($target eq 'web') {
2517: $currentstring = $token->[4];
2518: }
2519: return $currentstring;
2520: }
2521: sub end_var {
2522: my ($target,$token) = @_;
2523: my $currentstring = '';
2524: if ($target eq 'web') {
2525: $currentstring = $token->[2];
2526: }
2527: return $currentstring;
2528: }
2529: #-- <wbr> tag
2530: sub start_wbr {
2531: my ($target,$token) = @_;
2532: my $currentstring = '';
2533: if ($target eq 'web') {
2534: $currentstring = $token->[4];
2535: }
2536: return $currentstring;
2537: }
2538: sub end_wbr {
2539: my ($target,$token) = @_;
2540: my $currentstring = '';
2541: if ($target eq 'web') {
2542: $currentstring = $token->[2];
2543: }
2544: return $currentstring;
2545: }
1.94 sakharuk 2546:
2547: sub image_replication {
2548: my $src = shift;
2549: if (not -e '/home/httpd/html'.$src) {
2550: #replicates image itself
2551: &Apache::lonnet::repcopy('/home/httpd/html'.$src);
2552: #replicates eps or ps
2553: my $newsrc = $src;
1.103 sakharuk 2554: $newsrc =~ s/(.gif|.jpg|.png)$/.eps/;
1.94 sakharuk 2555: if (not-e $newsrc && &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc) ne 'OK') {
2556: $newsrc =~ s/\.ps$/\.eps/;
2557: &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc);
2558: }
2559: }
2560: return '';
2561: }
2562:
1.1 sakharuk 2563: 1;
2564: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>