Annotation of rat/lonpage.pm, revision 1.111.2.6
1.1 www 1: # The LearningOnline Network with CAPA
2: # Page Handler
3: #
1.111.2.6! raeburn 4: # $Id: lonpage.pm,v 1.111.2.5 2018/03/01 13:25:46 raeburn Exp $
1.29 www 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.30 harris41 28: ###
1.1 www 29:
1.88 jms 30:
31:
32:
1.1 www 33: package Apache::lonpage;
34:
35: use strict;
36: use Apache::Constants qw(:common :http);
1.70 albertel 37: use Apache::lonnet;
1.30 harris41 38: use Apache::loncommon();
1.102 raeburn 39: use Apache::lonhtmlcommon;
1.21 www 40: use Apache::lonxml();
1.57 raeburn 41: use Apache::lonlocal;
1.49 www 42: use Apache::lonmenu;
1.111 raeburn 43: use Apache::lonhomework;
1.111.2.6! raeburn 44: use Apache::lonenc();
1.6 www 45: use HTML::TokeParser;
1.1 www 46: use GDBM_File;
1.39 www 47: use Apache::lonsequence;
1.75 www 48: use lib '/home/httpd/lib/perl/';
49: use LONCAPA;
50:
1.1 www 51:
1.2 www 52: # -------------------------------------------------------------- Module Globals
53: my %hash;
54: my @rows;
1.6 www 55:
56: # ------------------------------------------------------------------ Euclid gcd
57:
58: sub euclid {
59: my ($e,$f)=@_;
60: my $a; my $b; my $r;
61: if ($e>$f) { $b=$e; $r=$f; } else { $r=$e; $b=$f; }
62: while ($r!=0) {
63: $a=$b; $b=$r;
64: $r=$a%$b;
65: }
66: return $b;
67: }
1.2 www 68:
69: # ------------------------------------------------------------ Build page table
70:
71: sub tracetable {
72: my ($sofar,$rid,$beenhere)=@_;
73: my $further=$sofar;
1.57 raeburn 74: my $randomout=0;
1.70 albertel 75: unless ($env{'request.role.adv'}) {
1.57 raeburn 76: $randomout = $hash{'randomout_'.$rid};
77: }
1.2 www 78: unless ($beenhere=~/\&$rid\&/) {
1.57 raeburn 79: $beenhere.=$rid.'&';
80: unless ($randomout) {
81: if (defined($hash{'is_map_'.$rid})) {
82: if ((defined($hash{'map_start_'.$hash{'src_'.$rid}})) &&
83: (defined($hash{'map_finish_'.$hash{'src_'.$rid}}))) {
84: my $frid=$hash{'map_finish_'.$hash{'src_'.$rid}};
85: $sofar=
86: &tracetable($sofar,$hash{'map_start_'.$hash{'src_'.$rid}},
1.87 albertel 87: '&'.$frid.$beenhere);
1.57 raeburn 88: $sofar++;
89: if ($hash{'src_'.$frid}) {
90: my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$frid});
91: if (($brepriv eq '2') || ($brepriv eq 'F')) {
92: if (defined($rows[$sofar])) {
93: $rows[$sofar].='&'.$frid;
94: } else {
95: $rows[$sofar]=$frid;
96: }
97: }
98: }
99: }
100: } else {
101: $sofar++;
102: if ($hash{'src_'.$rid}) {
103: my $brepriv=&Apache::lonnet::allowed('bre',$hash{'src_'.$rid});
104: if (($brepriv eq '2') || ($brepriv eq 'F')) {
105: if (defined($rows[$sofar])) {
106: $rows[$sofar].='&'.$rid;
107: } else {
108: $rows[$sofar]=$rid;
109: }
110: }
111: }
112: }
113: }
114:
115: if (defined($hash{'to_'.$rid})) {
116: my $mincond=1;
117: my $next='';
118: foreach (split(/\,/,$hash{'to_'.$rid})) {
119: my $thiscond=
1.11 www 120: &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$_}});
1.57 raeburn 121: if ($thiscond>=$mincond) {
122: if ($next) {
123: $next.=','.$_.':'.$thiscond;
124: } else {
125: $next=$_.':'.$thiscond;
126: }
127: if ($thiscond>$mincond) { $mincond=$thiscond; }
128: }
129: }
130: foreach (split(/\,/,$next)) {
131: my ($linkid,$condval)=split(/\:/,$_);
132: if ($condval>=$mincond) {
133: my $now=&tracetable($sofar,$hash{'goesto_'.$linkid},$beenhere);
134: if ($now>$further) { $further=$now; }
135: }
136: }
137: }
1.2 www 138: }
139: return $further;
140: }
141:
1.1 www 142: # ================================================================ Main Handler
143:
144: sub handler {
145: my $r=shift;
146:
1.3 www 147: # ------------------------------------------- Set document type for header only
1.1 www 148:
1.3 www 149: if ($r->header_only) {
1.70 albertel 150: if ($env{'browser.mathml'}) {
1.53 www 151: &Apache::loncommon::content_type($r,'text/xml');
1.3 www 152: } else {
1.53 www 153: &Apache::loncommon::content_type($r,'text/html');
1.3 www 154: }
155: $r->send_http_header;
156: return OK;
157: }
1.43 sakharuk 158:
1.39 www 159: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
160: ['forceselect','launch']);
1.43 sakharuk 161: my $number_of_columns = 1;
1.37 sakharuk 162: my $requrl=$r->uri;
1.70 albertel 163: my $target = $env{'form.grade_target'};
1.94 raeburn 164:
165: # Short term solution: define target as 'tex_answer' when retrieving answers
166: # for resources in a .page when generating printouts.
167: # A better long-term fix would be to modify the way problem rendering, and
168: # answer rendering are retrieved for individual resources when printing a .page,
169: # so rendered problem and answer are sequential for individual resources in
170: # the .page
171: #
172: if ($target eq 'answer') {
173: if ($env{'form.answer_output_mode'} eq 'tex') {
174: $target = 'tex_answer';
175: }
176: }
1.55 www 177: # &Apache::lonnet::logthis("Got a target of $target");
1.54 albertel 178: if ($target eq 'meta') {
179: &Apache::loncommon::content_type($r,'text/html');
180: $r->send_http_header;
181: return OK;
182: }
1.1 www 183: # ----------------------------------------------------------------- Tie db file
1.70 albertel 184: if (($env{'request.course.fn'}) && (!$env{'form.forceselect'})) {
185: my $fn=$env{'request.course.fn'};
1.1 www 186: if (-e "$fn.db") {
1.111.2.3 raeburn 187: my %buttonshide;
1.44 albertel 188: if (tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640)) {
1.1 www 189: # ------------------------------------------------------------------- Hash tied
190: my $firstres=$hash{'map_start_'.$requrl};
191: my $lastres=$hash{'map_finish_'.$requrl};
192: if (($firstres) && ($lastres)) {
1.111 raeburn 193: # ------------------------------------------------------------- Countdown Timer
194: my $now = time;
195: my ($pagefirstaccess,%hastimeleft,%countdowndisp);
196: my ($pagesymb,$courseid,$domain,$name)=&Apache::lonnet::whichuser();
1.111.2.2 raeburn 197: if ($pagesymb && ($courseid ne '') && ($domain ne '') && ($name ne '')) {
1.111 raeburn 198: my %times=&Apache::lonnet::get('firstaccesstimes',
199: [$courseid."\0".$pagesymb],
200: $domain,$name);
201: if ($times{$courseid."\0".$pagesymb} =~ /^\d+$/) {
202: $pagefirstaccess = $times{$courseid."\0".$pagesymb};
203: }
204: }
1.1 www 205: # ----------------------------------------------------------------- Render page
206:
1.3 www 207: @rows=();
1.2 www 208:
1.45 www 209: &tracetable(0,$firstres,'&');
1.2 www 210:
1.9 www 211: # ------------------------------------------------------------ Add to symb list
212:
1.2 www 213: my $i;
1.9 www 214: my %symbhash=();
215: for ($i=0;$i<=$#rows;$i++) {
216: if ($rows[$i]) {
217: my @colcont=split(/\&/,$rows[$i]);
1.73 albertel 218: foreach my $rid (@colcont) {
219: my ($mapid,$resid)=split(/\./,$rid);
220: $symbhash{$hash{'src_'.$rid}}=
221: [$hash{'src_'.$rid},$resid];
1.30 harris41 222: }
1.9 www 223: }
224: }
225: &Apache::lonnet::symblist($requrl,%symbhash);
226:
227: # ------------------------------------------------------------------ Page parms
228:
1.4 www 229: my $j;
1.6 www 230: my $lcm=1;
231: my $contents=0;
1.7 www 232: my $nforms=0;
1.96 raeburn 233: my $nuploads=0;
1.110 raeburn 234: my $ntimers=0;
1.96 raeburn 235: my %turninpaths;
236: my %multiresps;
237: my $turninparent;
1.6 www 238:
239: my %ssibody=();
240: my %ssibgcolor=();
241: my %ssitext=();
242: my %ssilink=();
243: my %ssivlink=();
244: my %ssialink=();
1.14 www 245:
1.6 www 246: my %cellemb=();
1.99 raeburn 247: my %cellexternal=();
1.3 www 248:
1.7 www 249: my $allscript='';
250: my $allmeta='';
251:
252: my $isxml=0;
253: my $xmlheader='';
254: my $xmlbody='';
255:
1.3 www 256: # --------------------------------------------- Get SSI output, post parameters
257:
1.2 www 258: for ($i=0;$i<=$#rows;$i++) {
1.4 www 259: if ($rows[$i]) {
1.6 www 260: $contents++;
1.3 www 261: my @colcont=split(/\&/,$rows[$i]);
1.6 www 262: $lcm*=($#colcont+1)/euclid($lcm,($#colcont+1));
1.30 harris41 263: foreach (@colcont) {
1.3 www 264: my $src=$hash{'src_'.$_};
1.111.2.3 raeburn 265: my $plainsrc = $src;
1.99 raeburn 266: my ($extension)=($src=~/\.(\w+)$/);
267: $cellexternal{$_}=($hash{'ext_'.$_} eq 'true:');
1.61 albertel 268: if ($hash{'encrypted_'.$_}) {
269: $src=&Apache::lonenc::encrypted($src);
270: }
1.111.2.3 raeburn 271: my ($mapid,$resid)=split(/\./,$_);
272: my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$src);
273: unless ($env{'request.role.adv'}) {
274: $buttonshide{$symb} = &Apache::lonnet::EXT("resource.0.buttonshide",$symb);
275: }
1.61 albertel 276: $cellemb{$_}=
277: &Apache::loncommon::fileembstyle($extension);
1.99 raeburn 278: if ($cellexternal{$_}) {
279: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
280: $ssibody{$_} = <<ENDEXT;
281: <iframe src="$src" width="100%">No iframe support!</iframe>
282: ENDEXT
283: }
284: } elsif ($cellemb{$_} eq 'ssi') {
1.3 www 285: # --------------------------------------------------------- This is an SSI cell
1.111.2.5 raeburn 286: my $prefix='p_'.$_.'_';
287: my $idprefix='p_'.join('_',($mapid,$resid,''));
1.64 albertel 288: my %posthash=('request.prefix' => $prefix,
1.71 albertel 289: 'LONCAPA_INTERNAL_no_discussion' => 'true',
1.64 albertel 290: 'symb' => $symb);
1.94 raeburn 291: if (($env{'form.grade_target'} eq 'tex') ||
292: ($env{'form.answer_output_mode'} eq 'tex')) {
1.70 albertel 293: $posthash{'grade_target'}=$env{'form.grade_target'};
294: $posthash{'textwidth'}=$env{'form.textwidth'};
295: $posthash{'problem_split'}=$env{'form.problem_split'};
296: $posthash{'latex_type'}=$env{'form.latex_type'};
297: $posthash{'rndseed'}=$env{'form.rndseed'};
1.94 raeburn 298: $posthash{'answer_output_mode'} = $env{'form.answer_output_mode'};
1.56 sakharuk 299: }
1.72 albertel 300: my $submitted=exists($env{'form.all_submit'});
301: if (!$submitted) {
302: foreach my $key (keys(%env)) {
303: if ($key=~/^form.\Q$prefix\Esubmit_/) {
304: $submitted=1;last;
305: }
306: }
307: }
308: if ($submitted) {
309: foreach my $key (keys(%env)) {
310: if ($key=~/^form.\Q$prefix\E/) {
311: my $name=$key;
312: $name=~s/^form.\Q$prefix\E//;
313: $posthash{$name}=$env{$key};
314: }
315: }
316: if (exists($env{'form.all_submit'})) {
317: $posthash{'all_submit'}='yes';
318: }
1.7 www 319: }
1.111.2.4 raeburn 320: if ($env{'environment.remote'} eq 'on') {
321: $posthash{'inhibitmenu'} = 'yes';
322: }
1.5 www 323: my $output=Apache::lonnet::ssi($src,%posthash);
1.77 albertel 324: $output=~s|//(\s*<!--)? BEGIN LON-CAPA Internal.+?// END LON-CAPA Internal\s*(-->)?\s||gs;
1.94 raeburn 325: if (($target eq 'tex') || ($target eq 'tex_answer')) {
1.111.2.1 raeburn 326: $output =~ s/^([^&]+)\\begin\{document}//;
327: $output =~ s/\\end\{document}//;
1.92 foxr 328: # $output = '\parbox{\minipagewidth}{ '.$output.' }';
1.46 sakharuk 329: #some additional cleanup necessary for LateX (due to limitations of table environment
330: $output =~ s/(\\vskip\s*\d+mm)\s*(\\\\)+/$1/g;
331: }
1.107 raeburn 332: my $matheditor;
333: if ($output =~ /\Qjavascript:LC_mathedit_HWVAL_\E/) {
334: $matheditor = 'dragmath';
335: } elsif ($output =~ /LCmathField/) {
336: $matheditor = 'lcmath';
337: }
1.6 www 338: my $parser=HTML::TokeParser->new(\$output);
339: my $token;
1.12 www 340: my $thisdir=$src;
1.6 www 341: my $bodydef=0;
1.7 www 342: my $thisxml=0;
1.12 www 343: my @rlinks=();
1.7 www 344: if ($output=~/\?xml/) {
345: $isxml=1;
346: $thisxml=1;
347: $output=~
348: /((?:\<(?:\?xml|\!DOC|html)[^\>]*(?:\>|\>\]\>)\s*)+)\<body[^\>]*\>/si;
349: $xmlheader=$1;
350: }
1.12 www 351: while ($token=$parser->get_token) {
352: if ($token->[0] eq 'S') {
353: if ($token->[1] eq 'a') {
354: if ($token->[2]->{'href'}) {
355: $rlinks[$#rlinks+1]=
356: $token->[2]->{'href'};
357: }
358: } elsif ($token->[1] eq 'img') {
359: $rlinks[$#rlinks+1]=
360: $token->[2]->{'src'};
361: } elsif ($token->[1] eq 'embed') {
362: $rlinks[$#rlinks+1]=
363: $token->[2]->{'src'};
364: } elsif ($token->[1] eq 'base') {
365: $thisdir=$token->[2]->{'href'};
366: } elsif ($token->[1] eq 'body') {
1.7 www 367: $bodydef=1;
368: $ssibgcolor{$_}=$token->[2]->{'bgcolor'};
369: $ssitext{$_}=$token->[2]->{'text'};
370: $ssilink{$_}=$token->[2]->{'link'};
371: $ssivlink{$_}=$token->[2]->{'vlink'};
372: $ssialink{$_}=$token->[2]->{'alink'};
373: if ($thisxml) {
374: $xmlbody=$token->[4];
375: }
1.12 www 376: } elsif ($token->[1] eq 'meta') {
1.28 albertel 377: if ($token->[4] !~ m:/>$:) {
1.7 www 378: $allmeta.="\n".$token->[4].'</meta>';
1.28 albertel 379: } else {
380: $allmeta.="\n".$token->[4];
381: }
1.12 www 382: } elsif (($token->[1] eq 'script') &&
383: ($bodydef==0)) {
1.7 www 384: $allscript.="\n\n"
385: .$parser->get_text('/script');
1.6 www 386: }
1.12 www 387: }
388: }
1.6 www 389: if ($output=~/\<body[^\>]*\>(.*)/si) {
390: $output=$1;
391: }
392: $output=~s/\<\/body\>.*//si;
1.7 www 393: if ($output=~/\<form/si) {
1.110 raeburn 394: my $hastimer;
1.7 www 395: $nforms++;
396: $output=~s/\<form[^\>]*\>//gsi;
397: $output=~s/\<\/form[^\>]*\>//gsi;
1.96 raeburn 398: if ($output=~/\<input[^\>]+name\s*=\s*[\'\"]*HWFILE/) {
399: $nuploads++;
400: }
1.110 raeburn 401: if ($output=~/\<input[^\>]+name\s*=\s*[\'\"]*accessbutton/) {
402: $ntimers++;
403: $hastimer = 1;
404: }
1.17 www 405: $output=~
1.80 albertel 406: s/\<((?:input|select|button|textarea)[^\>]+)name\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 name="$prefix$2" $3\>/gsi;
1.101 raeburn 407: $output=~
408: s/\<((?:input|select|button|textarea)[^\>]+)id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 id="$idprefix$2" $3\>/gsi;
1.111.2.5 raeburn 409: $output=~
410: s/(\Qthis.form.elements['\E)(HW(?:VAL|CHK)_[^']+\'\]\.(?:value=\'|checked))/$1$prefix$2/gsi;
1.110 raeburn 411: if ($hastimer) {
412: $output=~
413: s/\<(input[^\>]+name=\Q"$prefix\Eaccessbutton"[^\>]+)(?:\Qdocument.markaccess.submit();\E)([^\>]*)\>/\<$1pageTimer(this.form,'$prefix')$2\>/gsi;
414: $output=~ s/\<(input[^\>]+name=\Q"$prefix\Emarkaccess"[^\>]+value=["'])(?:yes)(['"][^\>]*)\>/\<$1$2\>/gsi;
415: }
1.107 raeburn 416: if ($matheditor eq 'dragmath') {
417: $output=~
418: s/(\Qjavascript:LC_mathedit_\E)(HWVAL_)([^'"]+?)(\(['"]*)(\QHWVAL_\E\3['"]\)\;void\(0\)\;)/$1$idprefix$2$3$4$idprefix$5/g;
419: $output=~
420: s/(function\s+LC_mathedit_)(HWVAL_)([^'"]+?)(\s+\(LCtextline\))/$1$idprefix$2$3$4/g;
421: } elsif ($matheditor eq 'lcmath') {
422: $output=~
423: s/(var\s+LCmathField\s+=\s+document\.getElementById\(['"])([^'"]+?)(['"]\)\;)/$1$idprefix$2$3/g;
424: }
1.105 raeburn 425: $output=~
426: s/(\Q<div id="msg_\E)(\Qsubmit_\E)([^"]*)(\Q" style="display:none">\E)/<input type="hidden" name="$prefix$2$3_pressed" id="$idprefix$2$3_pressed" value="" \/>$1$idprefix$2$3$4/g;
427: $output=~
428: s/(\Q<td class="LC_status_\E)(\Qsubmit_\E)([^\"]*)(\s*[^\"]*"\>)/$1$idprefix$2$3$4/g;
1.96 raeburn 429: if ($nuploads) {
430: $output=~
431: s/\<(input[^\>]+name=\"\Q$prefix\EHWFILE[^\>]+)\s*id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\)]*)\>/\<$1 id="$prefix$2" $3\>/gsi;
432: ($turninpaths{$prefix},$multiresps{$prefix}) =
433: &Apache::loncommon::get_turnedin_filepath($symb,$env{'user.name'},$env{'user.domain'});
434: if ($turninparent eq '') {
435: $turninparent = $turninpaths{$prefix};
436: $turninparent =~ s{(/[^/]+)$}{};
437: }
438: }
1.95 raeburn 439: $output=~
440: s/\<((?:input|select)[^\>]+\Qjavascript:setSubmittedPart\E)\(\s*[\'\"]([^\'\"]+)[\'\"]*\s*\)/\<$1('$2','$prefix')/gsi;
1.108 raeburn 441: $output=~
442: s/\<(input[^\>]+\Qonfocus=\"javascript:disableAutoComplete\E)\(\'([^\']+)\'\)(;\")/\<$1('$idprefix$2')$3/gsi;
1.111 raeburn 443: unless ($hastimer) {
1.111.2.3 raeburn 444: if ($plainsrc =~ /$LONCAPA::assess_re/) {
1.111 raeburn 445: %Apache::lonhomework::history =
446: &Apache::lonnet::restore($symb,$courseid,$domain,$name);
447: my $type = 'problem';
1.111.2.3 raeburn 448: if ($extension eq 'task') {
1.111 raeburn 449: $type = 'Task';
450: }
451: my ($status,$accessmsg,$slot_name,$slot) =
452: &Apache::lonhomework::check_slot_access('0',$type,$symb);
453: undef(%Apache::lonhomework::history);
454: my $probstatus = &Apache::lonnet::EXT("resource.0.problemstatus",$symb);
455: if (($status eq 'CAN_ANSWER') || (($status eq 'CANNOT_ANSWER') &&
456: (($probstatus eq 'no') || ($probstatus eq 'no_feedback_ever')))) {
457: my ($slothastime,$timerhastime);
458: if ($slot_name ne '') {
459: if (ref($slot) eq 'HASH') {
460: if (($slot->{'starttime'} < $now) &&
461: ($slot->{'endtime'} > $now)) {
462: $slothastime = $now - $slot->{'endtime'};
463: }
464: }
465: }
466: my $duedate = &Apache::lonnet::EXT("resource.0.duedate",$symb);
467: my @interval=&Apache::lonnet::EXT("resource.0.interval",$symb);
468: if (@interval > 1) {
469: my $first_access=&Apache::lonnet::get_first_access($interval[1],$symb);
470: if ($first_access > 0) {
471: my $timeremains = $first_access+$interval[0] - $now;
472: if ($timeremains > 0) {
473: $timerhastime = $timeremains;
474: }
475: }
476: }
477: if (($duedate && $duedate > $now) ||
478: (!$duedate && $timerhastime > 0) ||
479: ($slot_name ne '' && $slothastime)) {
480: if ((@interval > 1 && $timerhastime) ||
481: ($type eq 'Task' && $slothastime)) {
482: $countdowndisp{$symb} = 'inline';
483: if ((@interval > 1) && ($timerhastime)) {
484: $hastimeleft{$symb} = $timerhastime;
485: } else {
486: $hastimeleft{$symb} = $slothastime;
487: }
488: } else {
489: $hastimeleft{$symb} = $duedate - $now;
490: $countdowndisp{$symb} = 'none';
491: }
492: }
493: }
494: }
495: }
1.7 www 496: }
1.12 www 497: $thisdir=~s/\/[^\/]*$//;
1.30 harris41 498: foreach (@rlinks) {
1.91 raeburn 499: unless (($_=~/^https?\:\/\//i) ||
1.31 albertel 500: ($_=~/^\//) ||
501: ($_=~/^javascript:/i) ||
502: ($_=~/^mailto:/i) ||
503: ($_=~/^\#/)) {
1.12 www 504: my $newlocation=
505: &Apache::lonnet::hreflocation($thisdir,$_);
506: $output=~s/(\"|\'|\=\s*)$_(\"|\'|\s|\>)/$1$newlocation$2/;
507: }
1.30 harris41 508: }
1.24 www 509: # -------------------------------------------------- Deal with Applet codebases
510: $output=~s/(\<applet[^\>]+)(codebase\=[^\S\>]+)*([^\>]*)\>/$1.($2?$2:' codebase="'.$thisdir.'"').$3.'>'/gei;
1.5 www 511: $ssibody{$_}=$output;
1.3 www 512: # ---------------------------------------------------------------- End SSI cell
513: }
1.30 harris41 514: }
1.4 www 515: }
1.2 www 516: }
1.6 www 517: unless ($contents) {
1.53 www 518: &Apache::loncommon::content_type($r,'text/html');
1.3 www 519: $r->send_http_header;
1.74 albertel 520: $r->print(&Apache::loncommon::start_page(undef,undef,
1.111.2.3 raeburn 521: {'force_register' => 1}));
1.59 raeburn 522: $r->print(&mt('This page is either empty or it only contains resources that are currently hidden').'. ');
1.74 albertel 523: $r->print('<br /><br />'.&mt('Please use the LON-CAPA navigation arrows to move to another item in the course').
524: &Apache::loncommon::end_page());
1.3 www 525: } else {
526: # ------------------------------------------------------------------ Build page
1.7 www 527:
528: # ---------------------------------------------------------------- Send headers
1.94 raeburn 529: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 530: if ($isxml) {
1.53 www 531: &Apache::loncommon::content_type($r,'text/xml');
1.37 sakharuk 532: } else {
1.53 www 533: &Apache::loncommon::content_type($r,'text/html');
1.37 sakharuk 534: }
1.74 albertel 535: $r->send_http_header;
1.7 www 536: # ------------------------------------------------------------------------ Head
1.37 sakharuk 537: if ($allscript) {
1.85 albertel 538: $allscript =
539: "\n".'<script type="text/javascript">'."\n".
540: $allscript.
541: "\n</script>\n";
1.37 sakharuk 542: }
1.96 raeburn 543: if (($nforms) && ($nuploads)) {
544: $allscript .= &Apache::lonhtmlcommon::file_submissionchk_js(\%turninpaths,\%multiresps);
545: }
1.101 raeburn 546: if (($nforms) && (&Apache::lonhtmlcommon::htmlareabrowser())) {
547: my %textarea_args = (
548: dragmath => 'math',
549: );
550: $allscript .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args);
551: }
1.110 raeburn 552: if ($ntimers) {
553: $allscript .= '<script type="text/javascript">'."\n".
554: '// <![CDATA['."\n".
555: 'function pageTimer(form,prefix) {'."\n".
556: " form.elements[prefix+'markaccess'].value = 'yes';\n".
557: " form.submit();\n".
558: '}'."\n".
559: '// ]]>'.
560: "\n</script>\n";
561: }
1.111 raeburn 562: if (keys(%hastimeleft)) {
563: my (%uniquetimes,%uniquedisplays);
564: foreach my $item (values(%hastimeleft)) {
565: if (exists($uniquetimes{$item})) {
566: $uniquetimes{$item} ++;
567: } else {
568: $uniquetimes{$item} = 1;
569: }
570: }
571: if (keys(%uniquetimes) == 1) {
572: my (%uniquedisplays,%uniquedones,$currdisp);
573: if (keys(%countdowndisp)) {
574: foreach my $item (values(%countdowndisp)) {
575: if (exists($uniquedisplays{$item})) {
576: $uniquedisplays{$item} ++;
577: } else {
578: $uniquedisplays{$item} = 1;
579: }
580: }
581: my @countdowndisplay = keys(%uniquedisplays);
582: if (scalar(@countdowndisplay) == 1) {
583: $currdisp = $countdowndisplay[0];
584: }
585: }
586: &add_countdown_timer($currdisp);
587: }
588: }
1.111.2.3 raeburn 589: my $pagebuttonshide;
590: if (keys(%buttonshide)) {
591: my %uniquebuttonhide;
592: foreach my $item (values(%buttonshide)) {
593: if (exists($uniquebuttonhide{$item})) {
594: $uniquebuttonhide{$item} ++;
595: } else {
596: $uniquebuttonhide{$item} = 1;
597: }
598: }
599: if (keys(%uniquebuttonhide) == 1) {
600: if (lc((keys(%uniquebuttonhide))[0]) eq 'yes') {
601: $pagebuttonshide = 'yes';
602: }
603: }
604: }
1.7 www 605: # ------------------------------------------------------------------ Start body
1.85 albertel 606: $r->print(&Apache::loncommon::start_page(undef,$allscript,
1.74 albertel 607: {'force_register' => 1,
1.111.2.3 raeburn 608: 'bgcolor' => '#ffffff',
609: 'hide_buttons' => $pagebuttonshide}));
1.7 www 610: # ------------------------------------------------------------------ Start form
1.37 sakharuk 611: if ($nforms) {
1.96 raeburn 612: my $fmtag = '<form name="lonhomework" method="post" enctype="multipart/form-data"';
613: if ($nuploads) {
614: my $multi;
615: if ($nuploads > 1) {
616: $multi = 1;
617: }
618: $fmtag .= 'onsubmit="return file_submission_check(this,'."'$turninparent','$multi'".');"';
619: }
620: $fmtag .= ' action="'.
1.61 albertel 621: &Apache::lonenc::check_encrypt($requrl)
1.105 raeburn 622: .'" id="LC_page">';
1.96 raeburn 623: $r->print($fmtag);
1.40 sakharuk 624: }
1.94 raeburn 625: } elsif (($target eq 'tex') || ($target eq 'tex_answer')) {
1.92 foxr 626: # I think this is not needed as the header
627: # will be put in for each of the page parts
628: # by the londefdef.pm now that we are opening up
629: # the parts of a page.
630: #$r->print('\documentclass{article}
631: # \newcommand{\keephidden}[1]{}
632: # \usepackage[dvips]{graphicx}
633: # \usepackage{epsfig}
634: # \usepackage{calc}
635: # \usepackage{longtable}
636: # \begin{document}');
1.40 sakharuk 637: }
1.7 www 638: # ----------------------------------------------------------------- Start table
1.94 raeburn 639: if (($target eq 'tex') || ($target eq 'tex_answer')) {
1.92 foxr 640: # # $r->print('\begin{longtable}INSERTTHEHEADOFLONGTABLE\endfirsthead\endhead ');
1.43 sakharuk 641: if ($number_of_columns le $lcm) {$number_of_columns=$lcm;};
1.40 sakharuk 642: } else {
1.63 albertel 643: $r->print('<table width="100%" cols="'.$lcm.'" border="0">');
1.37 sakharuk 644: }
1.78 www 645: # generate rows
1.5 www 646: for ($i=0;$i<=$#rows;$i++) {
647: if ($rows[$i]) {
1.94 raeburn 648: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 649: $r->print("\n<tr>");
650: }
1.4 www 651: my @colcont=split(/\&/,$rows[$i]);
1.6 www 652: my $avespan=$lcm/($#colcont+1);
653: for ($j=0;$j<=$#colcont;$j++) {
654: my $rid=$colcont[$j];
1.111.2.3 raeburn 655: my $metainfo =&get_buttons(\%hash,$rid,\%buttonshide).'<br />';
1.94 raeburn 656: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 657: $r->print('<td colspan="'.$avespan.'"');
658: }
1.99 raeburn 659: if (($cellemb{$rid} eq 'ssi') || ($cellexternal{$rid})) {
1.94 raeburn 660: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 661: if ($ssibgcolor{$rid}) {
662: $r->print(' bgcolor="'.
663: $ssibgcolor{$rid}.'"');
664: }
665: $r->print('>'.$metainfo.'<font');
666:
667: if ($ssitext{$rid}) {
668: $r->print(' text="'.$ssitext{$rid}.'"');
669: }
670: if ($ssilink{$rid}) {
671: $r->print(' link="'.$ssilink{$rid}.'"');
672: }
673: if ($ssitext{$rid}) {
674: $r->print(' vlink="'.$ssivlink{$rid}.'"');
675: }
676: if ($ssialink{$rid}) {
677: $r->print(' alink="'.$ssialink{$rid}.'"');
678: }
679: $r->print('>');
680: }
1.99 raeburn 681: unless (($cellexternal{$rid}) &&
682: ($target eq 'tex') && ($target eq 'tex_answer')) {
683: $r->print($ssibody{$rid});
684: }
1.94 raeburn 685: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 686: $r->print('</font>');
1.41 www 687: }
1.70 albertel 688: if ($env{'course.'.
689: $env{'request.course.id'}.
1.41 www 690: '.pageseparators'} eq 'yes') {
1.94 raeburn 691: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.41 www 692: $r->print('<hr />');
1.77 albertel 693: }
1.37 sakharuk 694: }
695: } elsif ($cellemb{$rid} eq 'img') {
1.14 www 696: $r->print('>'.$metainfo.'<img src="'.
1.77 albertel 697: $hash{'src_'.$rid}.'" />');
1.13 www 698: } elsif ($cellemb{$rid} eq 'emb') {
1.14 www 699: $r->print('>'.$metainfo.'<embed src="'.
1.13 www 700: $hash{'src_'.$rid}.'"></embed>');
1.60 raeburn 701: } elsif (&Apache::lonnet::declutter($hash{'src_'.$rid}) !~/\.(sequence|page)$/) {
1.104 raeburn 702: $r->print($metainfo.'<b>'.$hash{'title_'.$rid}.'</b><br />');
703: unless ($cellemb{$rid} eq 'wrp') {
704: $r->print(&mt('It is recommended that you use an up-to-date virus scanner before handling this file.'));
705: }
706: $r->print('</p><p><table>'.
707: &Apache::londocs::entryline(0,
708: &mt("Click to download or use your browser's Save Link function"),
709: '/'.&Apache::lonnet::declutter($hash{'src_'.$rid})).
710: '</table></p><br />');
1.13 www 711: }
1.94 raeburn 712: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 713: $r->print('</td>');
1.40 sakharuk 714: } else {
1.92 foxr 715: # for (my $incol=1;$incol<=$avespan;$incol++) {
716: # $r->print(' & ');
717: # }
1.37 sakharuk 718: }
1.4 www 719: }
1.94 raeburn 720: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 721: $r->print('</tr>');
1.40 sakharuk 722: } else {
1.92 foxr 723: # $r->print('REMOVETHEHEADOFLONGTABLE\\\\');
1.37 sakharuk 724: }
1.5 www 725: }
1.4 www 726: }
1.94 raeburn 727: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.37 sakharuk 728: $r->print("\n</table>");
1.40 sakharuk 729: } else {
1.92 foxr 730: # $r->print('\end{longtable}\strut');
1.37 sakharuk 731: }
1.7 www 732: # ---------------------------------------------------------------- Submit, etc.
733: if ($nforms) {
1.106 raeburn 734: my $class;
735: if ($nforms > 1) {
736: $class = ' class="LC_hwk_submit"';
1.110 raeburn 737: if ($ntimers) {
738: $nforms = 1;
739: $class = '';
740: }
1.106 raeburn 741: }
1.7 www 742: $r->print(
1.103 bisitz 743: '<input name="all_submit" value="'.&mt('Submit All').'" type="'.
1.106 raeburn 744: (($nforms>1)?'submit':'hidden').'"'.$class.' id="all_submit" />'.
745: '<div id="msg_all_submit" style="display:none">'.
746: &mt('Processing your submission ...').'</div></form>');
1.7 www 747: }
1.94 raeburn 748: unless (($target eq 'tex') || ($target eq 'tex_answer')) {
1.76 albertel 749: $r->print(&Apache::loncommon::end_page({'discussion'
750: => 1,}));
1.40 sakharuk 751: } else {
752: $r->print('\end{document}'.$number_of_columns);
753: }
1.66 albertel 754: &Apache::lonnet::symblist($requrl,%symbhash);
1.69 albertel 755: my ($map,$id,$url)=&Apache::lonnet::decode_symb(&Apache::lonnet::symbread());
756: &Apache::lonnet::symblist($map,'last_known'=>[$url,$id]);
1.3 www 757: # -------------------------------------------------------------------- End page
758: }
1.1 www 759: # ------------------------------------------------------------- End render page
760: } else {
1.67 albertel 761: &Apache::loncommon::content_type($r,'text/html');
1.3 www 762: $r->send_http_header;
1.39 www 763: &Apache::lonsequence::viewmap($r,$requrl);
1.1 www 764: }
765: # ------------------------------------------------------------------ Untie hash
766: unless (untie(%hash)) {
767: &Apache::lonnet::logthis("<font color=blue>WARNING: ".
768: "Could not untie coursemap $fn (browse).</font>");
769: }
770: # -------------------------------------------------------------------- All done
771: return OK;
772: # ----------------------------------------------- Errors, hash could no be tied
773: }
774: }
775: }
1.67 albertel 776: &Apache::loncommon::content_type($r,'text/html');
1.39 www 777: $r->send_http_header;
778: &Apache::lonsequence::viewmap($r,$requrl);
779: return OK;
1.1 www 780: }
781:
1.83 albertel 782: sub get_buttons {
1.111.2.3 raeburn 783: my ($hash,$rid,$buttonshide) = @_;
1.83 albertel 784:
785: my $metainfo = '';
786: my $esrc=&Apache::lonnet::declutter($hash->{'src_'.$rid});
787: my ($mapid,$resid)=split(/\./,$rid);
788: my $symb=&Apache::lonnet::encode_symb($hash->{'map_id_'.$mapid},
789: $resid,
790: $hash->{'src_'.$rid});
1.109 raeburn 791: unless ($env{'request.role.adv'}) {
1.111.2.3 raeburn 792: if ($buttonshide->{$symb} eq 'yes') {
1.109 raeburn 793: return;
794: }
795: }
1.83 albertel 796: if ($hash->{'encrypted_'.$rid}) {
797: $symb=&Apache::lonenc::encrypted($symb);
798: $esrc=&Apache::lonenc::encrypted($esrc);
799: }
800: if ($hash->{'src_'.$rid} !~ m-^/uploaded/-
1.99 raeburn 801: && $hash->{'src_'.$rid} !~ m{^https?://}
1.83 albertel 802: && !$env{'request.enc'}
803: && ($env{'request.role.adv'}
804: || !$hash->{'encrypted_'.$rid})) {
805: $metainfo .='<a name="'.&escape($symb).'" />'.
806: '<a href="'.$hash->{'src_'.$rid}.'.meta'.'" target="LONcatInfo">'.
1.100 bisitz 807: '<img src="/res/adm/pages/catalog.png" class="LC_icon"'.
808: ' alt="'.&mt('Show Metadata').'"'.
809: ' title="'.&mt('Show Metadata').'" />'.
1.83 albertel 810: '</a>';
811: }
1.99 raeburn 812: if (($hash->{'src_'.$rid} !~ m{^/uploaded/}) &&
813: ($hash->{'src_'.$rid} !~ m{^https?://})) {
1.98 raeburn 814: $metainfo .= '<a href="/adm/evaluate?postdata='.
815: &escape($esrc).
816: '" target="LONcatInfo">'.
1.100 bisitz 817: '<img src="/res/adm/pages/eval.png" class="LC_icon"'.
818: ' alt="'.&mt('Provide my evaluation of this resource').'"'.
819: ' title="'.&mt('Provide my evaluation of this resource').'" />'.
1.98 raeburn 820: '</a>';
821: }
1.97 www 822: if (($hash->{'src_'.$rid}=~/$LONCAPA::assess_re/) &&
1.83 albertel 823: ($hash->{'src_'.$rid} !~ m-^/uploaded/-)) {
824:
825: if (&Apache::lonnet::allowed('mgr',$env{'request.course.id'})) {
826: $metainfo.=
827: '<a href="/adm/grades?symb='.&escape($symb).
828: # '&command=submission" target="LONcatInfo">'.
829: '&command=submission">'.
1.100 bisitz 830: '<img src="/adm/lonMisc/subm_button.png" class="LC_icon"'.
831: ' alt="'.&mt('View Submissions for a Student or a Group of Students').'"'.
832: ' title="'.&mt('View Submissions for a Student or a Group of Students').'" />'.
1.83 albertel 833: '</a>'.
834: '<a href="/adm/grades?symb='.&escape($symb).
835: # '&command=gradingmenu" target="LONcatInfo">'.
836: '&command=gradingmenu">'.
1.100 bisitz 837: '<img src="/res/adm/pages/pgrd.png" class="LC_icon"'.
838: ' alt="'.&mt('Content Grades').'"'.
839: ' title="'.&mt('Content Grades').'" />'.
1.83 albertel 840: '</a>';
841: }
842: if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) {
843: $metainfo.=
844: '<a href="/adm/parmset?symb='.&escape($symb).
845: # '" target="LONcatInfo">'.
846: '" >'.
1.100 bisitz 847: '<img src="/adm/lonMisc/pprm_button.png" class="LC_icon"'.
848: ' alt="'.&mt('Content Settings').'"'.
849: ' title="'.&mt('Content Settings').'" />'.
1.83 albertel 850: '</a>';
851: }
852: }
1.111.2.6! raeburn 853: if ($env{'request.course.id'}) {
1.102 raeburn 854: my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
855: my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
856: my $file=&Apache::lonnet::declutter($hash->{'src_'.$rid});
1.111.2.6! raeburn 857: my $editbutton = '';
! 858: if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
! 859: my ($cfile,$home,$switchserver,$forceedit,$forceview) =
! 860: &Apache::lonnet::can_edit_resource($file,$cnum,$cdom,$hash->{'src_'.$rid},$symb);
! 861: if ($cfile ne '') {
! 862: my $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver,
! 863: $forceedit,1,$symb,undef,
! 864: &escape($env{'form.title'}));
! 865: if ($jscall) {
! 866: $editbutton = 1;
! 867: my $icon = 'pcstr.png';
! 868: my $label = &mt('Edit');
! 869: my $title = &mt('Edit this resource');
! 870: my $pic = '<img src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$icon).'"'.
! 871: ' class="LC_icon" alt="'.$label.'" title="'.$title.'" />';
! 872: $metainfo .= ' <a href="javascript:'.$jscall.';">'.$pic.'</a>';
! 873: }
! 874: }
! 875: }
! 876: if ((!$editbutton) && ($file=~/$LONCAPA::assess_re/)) {
! 877: my $url = &Apache::lonnet::clutter($file);
! 878: my $viewsrcbutton;
! 879: if ((&Apache::lonnet::allowed('cre','/')) &&
! 880: (&Apache::lonnet::metadata($url,'sourceavail') eq 'open')) {
! 881: $viewsrcbutton = 1;
! 882: } elsif (&Apache::lonnet::allowed('vxc',$env{'request.course.id'})) {
! 883: if ($url =~ m{^\Q/res/$cdom/\E($LONCAPA::match_username)/}) {
! 884: my $auname = $1;
! 885: if (($env{'request.course.adhocsrcaccess'} ne '') &&
! 886: (grep(/^\Q$auname\E$/,split(/,/,$env{'request.course.adhocsrcaccess'})))) {
! 887: $viewsrcbutton = 1;
! 888: }
! 889: }
! 890: }
! 891: if ($viewsrcbutton) {
1.102 raeburn 892: my $icon = 'pcstr.png';
1.111.2.6! raeburn 893: my $label = &mt('View Source');
! 894: my $title = &mt('View source code');
! 895: my $jsrid = $rid;
! 896: $jsrid =~ s/\./_/g;
! 897: my $showurl = &escape(&Apache::lonenc::check_encrypt($url));
1.102 raeburn 898: my $pic = '<img src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$icon).'"'.
899: ' class="LC_icon" alt="'.$label.'" title="'.$title.'" />';
1.111.2.6! raeburn 900: $metainfo .= ' <a href="javascript:open_source_'.$jsrid.'();">'.$pic.'</a>'."\n".
! 901: '<script type="text/javascript">'."\n".
! 902: "function open_source_$jsrid() {\n".
! 903: " sourcewin=window.open('/adm/source?inhibitmenu=yes&viewonly=1&filename=$showurl','LONsource',".
! 904: "'height=500,width=600,resizable=yes,location=no,menubar=no,toolbar=no,scrollbars=yes');\n".
! 905: "}\n".
! 906: "</script>\n";
1.102 raeburn 907: }
908: }
909: }
1.83 albertel 910: return $metainfo;
911: }
912:
1.111 raeburn 913: sub add_countdown_timer {
914: my ($currdisp) = @_;
915: my ($collapse,$expand,$alttxt,$title);
916: if ($currdisp eq 'inline') {
917: $collapse = '► ';
918: } else {
919: $expand = '◄ ';
920: }
921: unless ($env{'environment.icons'} eq 'iconsonly') {
922: $alttxt = &mt('Timer');
923: $title = $alttxt.' ';
924: }
925: my $desc = &mt('Countdown to due date/time');
926: my $output = <<END;
927: <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">
928: <span id="ddcountcollapse" class="LC_menubuttons_inline_text">
929: $collapse
930: </span></a>
931: <span id="duedatecountdown" class="LC_menubuttons_inline_text" style="display: $currdisp;"></span>
932: <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">
933: <span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span>
934: <img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon" alt="$alttxt" /><span class="LC_menubuttons_inline_text">$title</span></a>
935: END
936: &Apache::lonhtmlcommon::clear_breadcrumb_tools();
937: &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$output);
938: return;
939: }
940:
941:
1.1 www 942: 1;
943: __END__
944:
945:
1.89 jms 946: =head1 NAME
947:
948: Apache::lonpage - Page Handler
949:
950: =head1 SYNOPSIS
951:
952: Invoked by /etc/httpd/conf/srm.conf:
953:
954: <LocationMatch "^/res/.*\.page$>
955: SetHandler perl-script
956: PerlHandler Apache::lonpage
957: </LocationMatch>
958:
959: =head1 INTRODUCTION
960:
961: This module renders a .page resource.
962:
963: This is part of the LearningOnline Network with CAPA project
964: described at http://www.lon-capa.org.
965:
966: =head1 HANDLER SUBROUTINE
967:
968: This routine is called by Apache and mod_perl.
969:
970: =over 4
971:
972: =item *
973:
974: set document type for header only
975:
976: =item *
977:
978: tie db file
979:
980: =item *
981:
982: render page
983:
984: =item *
985:
986: add to symb list
987:
988: =item *
989:
990: page parms
991:
992: =item *
993:
994: Get SSI output, post parameters
1.1 www 995:
1.89 jms 996: =item *
997:
998: SSI cell rendering
999:
1000: =item *
1001:
1002: Deal with Applet codebases
1003:
1004: =item *
1005:
1006: Build page
1007:
1008: =item *
1009:
1010: send headers
1011:
1012: =item *
1013:
1014: start body
1015:
1016: =item *
1017:
1018: start form
1019:
1020: =item *
1021:
1022: start table
1023:
1024: =item *
1025:
1026: submit element, etc, render page, untie hash
1027:
1028: =back
1029:
1030: =head1 OTHER SUBROUTINES
1031:
1032: =over 4
1033:
1034: =item *
1035:
1036: euclid() : Euclid's method for determining the greatest common denominator.
1037:
1038: =item *
1039:
1040: tracetable() : Build page table.
1041:
1042: =back
1043:
1044: =cut
1.1 www 1045:
1046:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>