File:  [LON-CAPA] / rat / lonpage.pm
Revision 1.112: download - view: text, annotated - select for diffs
Fri Jul 17 19:48:51 2015 UTC (8 years, 9 months ago) by raeburn
Branches: MAIN
CVS tags: HEAD
- Include "done" button if composite page includes countdown
  timer, and interval parameter is set for resource(s) at map level.

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

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